SA-MP Forums Archive
Why doesn't this work? ;S - 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: Why doesn't this work? ;S (/showthread.php?tid=179122)



Why doesn't this work? ;S - Nameless303 - 25.09.2010

This code should be a simple weapon hacker ban thingy but for some odd reason it bans random ppl when they spawn...

Код:
forward UpdatePlayer(playerid);
public UpdatePlayer(playerid)
{
	new string[128];

	if((GetPlayerWeapon(playerid) == 35) || (GetPlayerWeapon(playerid) == 36) || (GetPlayerWeapon(playerid) == 37) || (GetPlayerWeapon(playerid) == 38))
	{
	    format(string,sizeof(string),"[BANNED] System banned %s [REASON: Weapon hack]",pInfo[playerid][name]);
	    SendClientMessageToAll(COLOR_WHITE,string);
	    Ban(playerid);
		KillTimer(UpdateTimer[playerid]);
	}
return 1;
}
Ive got the UpdatePlayer timer all set up and I know it works because I've got other stuff in that timer aswel...
Cheers.


Re: Why doesn't this work? ;S - willsuckformoney - 25.09.2010

Don't know for sure, but...

pawn Код:
KillTimer(UpdateTimer[playerid]);
Should be OnPlayerDisconnect or FilterScriptExit


Re: Why doesn't this work? ;S - Nameless303 - 25.09.2010

Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
Don't know for sure, but...

pawn Код:
KillTimer(UpdateTimer[playerid]);
Should be OnPlayerDisconnect or FilterScriptExit
It's there to stop the message from spamming... (The timer is set to 1sec interval...)