GetPlayerWeaponData Help - 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: GetPlayerWeaponData Help (
/showthread.php?tid=325402)
GetPlayerWeaponData Help -
Abreezy - 13.03.2012
I don't really understand GetPlayerWeaponData.
I read the very small wiki page, but it confuses me.
pawn Код:
new weapons[13][2];
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
}
From the wiki page. If I use this, then ResetPlayerWeapons(playerid), how do I only remove 1 weapon though?
Im using this for a /give command, so if I give away desert eagle, how do i keep the rest of vehicles using this stuff?
Thank you advance, rep will be given.
Re: GetPlayerWeaponData Help -
eesh - 13.03.2012
pawn Код:
stock RemovePlayerWeapon(playerid, weaponid)
{
new plyWeapons[12]
new plyAmmo[12]
for(new slot = 0; slot != 12; slot++)
{
new wep, ammo
GetPlayerWeaponData(playerid, slot, wep, ammo)
if(wep != weaponid)
{
GetPlayerWeaponData(playerid, slot, plyWeapons[slot], plyAmmo[slot])
}
}
ResetPlayerWeapons(playerid)
for(new slot = 0; slot != 12; slot++)
{
GivePlayerWeapon(playerid, plyWeapons[slot], plyAmmo[slot])
}
}