Scan Player Help
#1

Can someone help me with my idea?

I'm trying to make scanner that will scan player for ANY weapons, from Knuckles to Minigun.

Any idea how could I do that?
I tryed to use GetPlayerWeaponData but I can't make it to work...
Thanks for any suggestions.
Reply
#2

GetPlayerWeaponData is the right way. Loop through all weapon slots and check if the player has more than 0 ammo in there, or weapon 1 in slot 0 (brass knuckles)

(simple example, also detects camera etc)
pawn Код:
new weapon, ammo;
for(new i = 0; i < 11; i ++)
{
    GetPlayerWeaponData(playerid, i, weapon, ammo);
    if(weapon == 1 || ammo > 0)
    {
        //player has a weapon
    }
}
Reply
#3

Thanks mate!
I'll try to script something like the code you made me right away.
I've never thought of searching for players ammo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)