i'm trying to get the number of grenades for player in csgo
but getting weird as hell results
PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
public OnPluginStart()
{
RegConsoleCmd("sm_test", test, "show # of grenades");
}
public Action:test(client, arg)
{
new String:sWeaponName[64];
GetClientWeapon(client, sWeaponName, sizeof(sWeaponName));
PrintToChat(client, "%s", sWeaponName);
PrintToChat(client, "IncGrendae: %d", GetEntData(client, FindDataMapOffs(client, "m_iAmmo")+56));
PrintToChat(client, "HEGrenade: %d", GetEntData(client, FindDataMapOffs(client, "m_iAmmo")+44));
PrintToChat(client, "SmokeGrenade: %d", GetEntData(client, FindDataMapOffs(client, "m_iAmmo")+52));
}
here is a video showing the weird ass result