need PTaH Extension
choose your os sig and complie
PHP Code:
#pragma semicolon 1
#include <PTaH>
#include <sdktools>
#define addr_range 268
#define addr_primary_clip_size 20
#define addr_primary_default_clip_size 28
#define addr_secondary_default_clip_size 32
Handle hGetCCSWeaponData;
char sig[] = "\x85\xC9\x75\x2A\x33\xC0\xC3\x8B\x01"; //win
//char sig[] = "\x55\x89\xE5\x53\x83\xEC\x04\x8B\x45\x08\x85\xC0\x74\x4A\x8B\x15"; //linux
public void OnPluginStart()
{
StartPrepSDKCall(SDKCall_Raw);
PrepSDKCall_SetSignature(SDKLibrary_Server, sig, sizeof(sig) - 1);
PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
hGetCCSWeaponData = EndPrepSDKCall();
if(!hGetCCSWeaponData) SetFailState("Could not initialize call to GetCCSWeaponDataFromDef");
}
public void OnMapStart()
{
CEconItemDefinition ItemDef;
Address CCSWeaponData;
ItemDef = PTaH_GetItemDefinitionByName("weapon_taser");
if(ItemDef && (CCSWeaponData = SDKCall(hGetCCSWeaponData, ItemDef)))
{
StoreToAddress(CCSWeaponData + view_as<Address>(addr_range), 50, NumberType_Int32);
StoreToAddress(CCSWeaponData + view_as<Address>(addr_primary_clip_size), 10, NumberType_Int32);
StoreToAddress(CCSWeaponData + view_as<Address>(addr_primary_default_clip_size), 10, NumberType_Int32);
StoreToAddress(CCSWeaponData + view_as<Address>(addr_secondary_default_clip_size), 10, NumberType_Int32);
}
}