View Single Post
Author Message
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-27-2014 , 19:09   getting grenade count in csgo
Reply With Quote #1

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(clientarg)
{
    new 
String:sWeaponName[64];
    
GetClientWeapon(clientsWeaponNamesizeof(sWeaponName));
    
PrintToChat(client"%s"sWeaponName);
    
PrintToChat(client"IncGrendae: %d"GetEntData(clientFindDataMapOffs(client"m_iAmmo")+56));
    
PrintToChat(client"HEGrenade: %d"GetEntData(clientFindDataMapOffs(client"m_iAmmo")+44));
    
PrintToChat(client"SmokeGrenade: %d"GetEntData(clientFindDataMapOffs(client"m_iAmmo")+52));

here is a video showing the weird ass result


Last edited by 8guawong; 12-27-2014 at 19:10.
8guawong is offline