How does GetPlayerWeaponData work?
#1

As the title says..
I want admins to be able to see the players weapons but I cant figure out how:/
Reply
#2

It's pretty reliable on getting the WEAPON info but not really the ammo.
Reply
#3

hmm.. how to use it?
Reply
#4

Get the weapon and ammo in a specific player's weapon slot.

https://sampwiki.blast.hk/wiki/GetPlayerWeaponData
Reply
#5

н readed that. but How do I make it so that I see all weapons?
Reply
#6

make a loop to check all that players weapons.

Код:
new weapons = 0;
new ammo;

for (new i=0; i < 13; i++)
{
     GetPlayerWeaponData(giveplayerid, i, weapons, ammo);
     if(weapons != 0)
     {
           format(string, sizeof(string), "%d: %d (%d)", i, weapons, ammo);
           SendClientMessage(playerid, COLOR_GRAD1, string);
     }
}
If it worked, feel free to +rep me
Reply
#7

and sometimes it'll still return old data like if they bought a sniper and it gets removed then it may return that they still have a sniper.
Reply
#8

Quote:
Originally Posted by cessil
Посмотреть сообщение
and sometimes it'll still return old data like if they bought a sniper and it gets removed then it may return that they still have a sniper.
Like this: https://sampforum.blast.hk/showthread.php?tid=312184 ?
Reply
#9

Quote:
Originally Posted by ******
Посмотреть сообщение
It might work slightly, but it's wrong - there are 13 slots, not 9.
Sorry about that, i took it from an old script i have in my files. Should of checked it really.
Reply
#10

Quote:
Originally Posted by leong124
Посмотреть сообщение
yes just like that.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)