View Single Post
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 12-30-2014 , 22:39   Re: getting grenade count in csgo
Reply With Quote #12

Update the #defines to the new values and it works... Prop_Data vs Prop_Send wasn't the issue.

PHP Code:
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1

#define     HEGrenadeOffset        14    // (14 * 4)
#define     FlashbangOffset        15    // (15 * 4)
#define     SmokegrenadeOffset        16    // (16 * 4)
#define     IncenderyGrenadesOffset    17    // (17 * 4) Also Molotovs
#define     DecoyGrenadeOffset        18    // (18 * 4)

public OnPluginStart()
{
    
RegConsoleCmd("sm_test"test"show # of grenades");
}

public 
Action:test(clientarg)
{
    for (new 
1<= MaxClientsi++)
    {
        if (
IsClientInGame(i))
        {
            
ReplyToCommand(client"%L has the following nades: IncGrenade [%d] | HEGrenade [%d] | Smokers [%d] | Flashbangs [%d] | Decoys [%d]"iGetEntProp(iProp_Send"m_iAmmo"_IncenderyGrenadesOffset), GetEntProp(iProp_Send"m_iAmmo"_HEGrenadeOffset), GetEntProp(iProp_Send"m_iAmmo"_SmokegrenadeOffset), GetEntProp(iProp_Send"m_iAmmo"_FlashbangOffset), GetEntProp(iProp_Send"m_iAmmo"_DecoyGrenadeOffset));
        }
    }

__________________
View my Plugins | Donate

Last edited by TnTSCS; 12-30-2014 at 22:44.
TnTSCS is offline