View Single Post
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-27-2014 , 22:01   Re: getting grenade count in csgo
Reply With Quote #3

Hello i tried your code but it still returning wrong number of grenades

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(clientarg)
{
    new 
String:sWeaponName[64];
    
GetClientWeapon(clientsWeaponNamesizeof(sWeaponName));
    
PrintToChat(client"%s"sWeaponName);
    
PrintToChat(client"IncGrendae: %d"GetEntProp(clientProp_Data"m_iAmmo"_IncenderyGrenadesOffset));
    
PrintToChat(client"HEGrenade: %d"GetEntProp(clientProp_Data"m_iAmmo"_HEGrenadeOffset));
    
PrintToChat(client"SmokeGrenade: %d"GetEntProp(clientProp_Data"m_iAmmo"_SmokegrenadeOffset));


Last edited by 8guawong; 12-27-2014 at 22:02.
8guawong is offline