SA-MP Forums Archive
ResetPlayerWeapons - 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: ResetPlayerWeapons (/showthread.php?tid=617731)



ResetPlayerWeapons - MerryDeer - 25.09.2016

Hi,

It's a bug or what sometimes, i reset player weapons and man get ban for gun/ammo hacks. I do prints, i get in variables 0 weapon id,0 ammo (it's good), because resetplayerweapons i have stock where i reset variables and use simple resetplayerweapons function. But print give that player is holding a weapon before that resetion and ammo. So in anticheat i use getplayerweapon and getplayerammo, so it's need set timer when reseting weapons, and not check gun anti cheat?


Re: ResetPlayerWeapons - Maheerali - 26.09.2016

PHP код:
new ammo[MAX_PLAYERS];
cmd:give(playerid,params[])
{
     
ammo[playerid] += 200;
     
GivePlayerWeapon(playerid,24,ammo[playerid]);
}
cmd:take(playerid,params[])
{
    
GivePlayerWeapon(playerid,24,-ammo[playerid]);
    
ammo[playerid] = 0;




Re: ResetPlayerWeapons - Maheerali - 26.09.2016

Bro i got simple one for you
ResetPlayerWeapons(playerid);

And to change some weapons.
SetPlayerAmmo(playerid, 23, 0);