|
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
|
12-29-2014
, 13:29
Re: getting grenade count in csgo
|
#5
|
I don't know what's up with your code, but the following works for me - I just tested it:
test code to get grenade count
PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
#define HEGrenadeOffset 11 // (11 * 4)
#define FlashbangOffset 12 // (12 * 4)
#define SmokegrenadeOffset 13 // (13 * 4)
#define IncenderyGrenadesOffset 14 // (14 * 4) Also Molotovs
#define DecoyGrenadeOffset 15 // (15 * 4)
public OnPluginStart()
{
RegConsoleCmd("sm_test", test, "show # of grenades");
}
public Action:test(client, arg)
{
for (new i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i))
{
ReplyToCommand(client, "%L IncGrenade Count: %d", i, GetEntProp(i, Prop_Data, "m_iAmmo", _, IncenderyGrenadesOffset));
ReplyToCommand(client, "%L HEGrenade Count: %d", i, GetEntProp(i, Prop_Data, "m_iAmmo", _, HEGrenadeOffset));
ReplyToCommand(client, "%L SmokeGrenade Count: %d", i, GetEntProp(i, Prop_Data, "m_iAmmo", _, SmokegrenadeOffset));
ReplyToCommand(client, "%L Flashbang Count: %d", i, GetEntProp(i, Prop_Data, "m_iAmmo", _, FlashbangOffset));
ReplyToCommand(client, "%L Decoy Count: %d", i, GetEntProp(i, Prop_Data, "m_iAmmo", _, DecoyGrenadeOffset));
}
}
}
__________________
|
|
|
|