View Single Post
Austin
Senior Member
Join Date: Oct 2005
Old 07-01-2023 , 20:40   Re: [CS:GO] How to get a Count of players inventory item?
Reply With Quote #3

Thanks goes to Vit_amin for suggesting this method to find the health shot offset.

1) Go in game and give yourself 4 health shots.
2) Write a plugin that lists all offsets and counts.

weapon_healthshot = offset 21 !!

PHP Code:
public Action Command_Test(int clientint args)
{
    
int item;
    for(
int i 0i<=31;i++)
    {
        
item GetEntProp(clientProp_Data"m_iAmmo"_i);
        
PrintToServer("item %d = %d"iitem);
    }
    return 
Plugin_Continue;

Output
item 0 = 0
item 1 = 0
item 2 = 0
item 3 = 0
item 4 = 0
item 5 = 0
item 6 = 0
item 7 = 0
item 8 = 0
item 9 = 0
item 10 = 0
item 11 = 0
item 12 = 0
item 13 = 203
item 14 = 2
item 15 = 2
item 16 = 2
item 17 = 1
item 18 = 2
item 19 = 0
item 20 = 0
item 21 = 4 <= was holding 4 weapon_healthshot
item 22 = 2
item 23 = 0
item 24 = 0
item 25 = 0
item 26 = 0
item 27 = 0
item 28 = 0
item 29 = 0
item 30 = 0
item 31 = 0

Last edited by Austin; 07-01-2023 at 20:41.
Austin is offline