How does GetPlayerWeaponData work? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How does GetPlayerWeaponData work? (
/showthread.php?tid=312282)
How does GetPlayerWeaponData work? -
milanosie - 20.01.2012
As the title says..
I want admins to be able to see the players weapons but I cant figure out how:/
Re: How does GetPlayerWeaponData work? -
Kyle - 20.01.2012
It's pretty reliable on getting the WEAPON info but not really the ammo.
Re: How does GetPlayerWeaponData work? -
milanosie - 20.01.2012
hmm.. how to use it?
Re: How does GetPlayerWeaponData work? -
sabretur - 20.01.2012
Get the weapon and ammo in a specific player's weapon slot.
https://sampwiki.blast.hk/wiki/GetPlayerWeaponData
Re: How does GetPlayerWeaponData work? -
milanosie - 20.01.2012
н readed that. but How do I make it so that I see all weapons?
Re: How does GetPlayerWeaponData work? -
Shadow_ - 20.01.2012
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
Re: How does GetPlayerWeaponData work? -
cessil - 21.01.2012
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.
Re: How does GetPlayerWeaponData work? -
leong124 - 21.01.2012
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 ?
Re: How does GetPlayerWeaponData work? -
Shadow_ - 21.01.2012
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.
Re: How does GetPlayerWeaponData work? -
cessil - 21.01.2012
Quote:
Originally Posted by leong124
|
yes just like that.