This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[Snippet][TF2] Directly Spawning Mannpower Powerups and extra info...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 12-29-2014 , 20:09   [Snippet][TF2] Directly Spawning Mannpower Powerups and extra info...
Reply With Quote #1

Hi Guys

I'd like to share with you quite lazy snippet which allows you to spawn normally working powerups without mannpower mode on nor need to use info_target spawners. Directly thru 'CreateEntityByName'

Test Plugin:
PHP Code:
#include <sdktools>
#include <tf2_stocks>
 
public OnPluginStart()
{
    
RegConsoleCmd("sm_powerup_spawn_test"SpawnTest_Powerup);
}

public 
Action:SpawnTest_Powerup(clientargs)
{
    
decl String:argc[32]
    
GetCmdArg(1argcsizeof(argc))

    
decl Float:player_pos[3]
    
GetClientAbsOrigin(clientplayer_pos)

    new 
entity CreateEntityByName("item_powerup_rune")
    new 
Address:desu GetEntityAddress(entity) + Address:1256;

    new 
type StringToInt(argc)
    if(
type == 1)
    {
        
StoreToAddress(desu0x5ANumberType_Int8)
    }
    else if(
type == 2)
    {
        
StoreToAddress(desu0x5DNumberType_Int8)
    }
    else if(
type == 2)
    {
        
StoreToAddress(desu0x5CNumberType_Int8)
    }
    else if(
type == 3
    {
        
StoreToAddress(desu0x5CNumberType_Int8)
    }
    else if(
type == 4)
    {
        
StoreToAddress(desu0x5BNumberType_Int8)
    }
    else if(
type == 5)
    {
        
StoreToAddress(desu0x5ENumberType_Int8)
    }
    else if(
type == 6)
    {
        
StoreToAddress(desu0x5FNumberType_Int8)
    }
    else if(
type == 7)
    {
        
StoreToAddress(desu0x60NumberType_Int8)
    }
    else if(
type == 8)
    {
        
StoreToAddress(desu0x61NumberType_Int8)
    }
    
TeleportEntity(entityplayer_posNULL_VECTORNULL_VECTOR)
    
DispatchSpawn(entity)

IDs for Powerups
PHP Code:
 /*
 Table List:
0x5A: Strenght
0x5D: Resistance
0x5C: Regneration
0x5B: Haste
0x5E: Vampire
0x5F: Warlock
0x60: Precision
0x61: Agilty
 */ 
This is Windows version of plugin
For Linux you will probably need to change 'Address:1256' to linux equivalent of that address
It is either: 1276 or probably one of these:
PHP Code:
  *(_BYTE *)(v9 1260) = a3;
  *(
_DWORD *)(v9 1264) = a4;
  *(
_DWORD *)(v9 1268) = a5;
  *(
_DWORD *)(v9 1272) = a6
Found above informations in following things:
- CTFRune::CreateRune(Vector const&, int, bool, Vector) //Found in there offset for setting type of powerups\\ *You can find it on windows by searching string 'item_powerup_rune'.
- CTFRune::MyTouch(CBasePlayer *) //Found in there ids of powerups\\ *Can be found by searching 'You got the PRECISION power-up!' string*


- Enjoy. I'il probably update/refine/turn into plugin this snippet tommorow cause it's kinda messy at it's current state
__________________
...

Last edited by Oshizu; 12-29-2014 at 20:24.
Oshizu is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode