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(client, args)
{
decl String:argc[32]
GetCmdArg(1, argc, sizeof(argc))
decl Float:player_pos[3]
GetClientAbsOrigin(client, player_pos)
new entity = CreateEntityByName("item_powerup_rune")
new Address:desu = GetEntityAddress(entity) + Address:1256;
new type = StringToInt(argc)
if(type == 1)
{
StoreToAddress(desu, 0x5A, NumberType_Int8)
}
else if(type == 2)
{
StoreToAddress(desu, 0x5D, NumberType_Int8)
}
else if(type == 2)
{
StoreToAddress(desu, 0x5C, NumberType_Int8)
}
else if(type == 3)
{
StoreToAddress(desu, 0x5C, NumberType_Int8)
}
else if(type == 4)
{
StoreToAddress(desu, 0x5B, NumberType_Int8)
}
else if(type == 5)
{
StoreToAddress(desu, 0x5E, NumberType_Int8)
}
else if(type == 6)
{
StoreToAddress(desu, 0x5F, NumberType_Int8)
}
else if(type == 7)
{
StoreToAddress(desu, 0x60, NumberType_Int8)
}
else if(type == 8)
{
StoreToAddress(desu, 0x61, NumberType_Int8)
}
TeleportEntity(entity, player_pos, NULL_VECTOR, NULL_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
__________________