Reset player weapons [LOCK OR DELETE THIS TOPIC]
#1

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
Reply
#2

Put the timer under OnGameModeInIt, and set the interval for lets say 5000ms?

pawn Код:
forward GunTimer(playerid);
public GunTimer(playerid)
{
    ResetPlayerWeapons(playerid);
return 1;}
Reply
#3

i've done that, nothing happens
Reply
#4

Код:
for(new i=0; i<MAX_PLAYERS; i++) ResetPlayerWeapons(i); //put this in your function
Reply
#5

thanks bro, now it works

mods, you can now LOCK or DELETE this topic

another time, thanks man
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)