Reset player weapons [LOCK OR DELETE THIS TOPIC] - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Reset player weapons [LOCK OR DELETE THIS TOPIC] (
/showthread.php?tid=144915)
Reset player weapons [LOCK OR DELETE THIS TOPIC] -
Gigi-The-Beast - 29.04.2010
Hey guys, I need help
I have a server and some guys that got banned want to take revenge with cheat, so they spawn allowed weapons and then kill players...
so i tryed to make a code when a player spawns ingame, the server checks if he is under lvl 2 and then if he have any weapons, if that returns true, the server should reset his weapons
this is what i made:
Код:
forward GunTimer(playerid);
public GunTimer(playerid)
{
ResetPlayerWeapons(playerid);
}
then i made:
SetTimer("GunTimer", 3000, 1);
i tryed to put that timer under OnPlayerSpawn, under OnPlayerConnect and even in OnGameModeInit but nothing happens
Why?
(i know that this code would reset all players weapons every 3 seconds, i just want to know where i made a mistake)
If you help me to get this code to work, then i will add a check for if(PlayerInfo[playerid][pLevel] < 2) so cheaters and players lvl 1 can't get weapons
Re: Reset player weapons -
-Rebel Son- - 29.04.2010
Put the timer under OnGameModeInIt, and set the interval for lets say 5000ms?
pawn Код:
forward GunTimer(playerid);
public GunTimer(playerid)
{
ResetPlayerWeapons(playerid);
return 1;}
Re: Reset player weapons -
Gigi-The-Beast - 29.04.2010
i've done that, nothing happens
Re: Reset player weapons -
-Rebel Son- - 29.04.2010
Код:
for(new i=0; i<MAX_PLAYERS; i++) ResetPlayerWeapons(i); //put this in your function
Re: Reset player weapons -
Gigi-The-Beast - 29.04.2010
thanks bro, now it works
mods, you can now
LOCK or
DELETE this topic
another time, thanks man