Anti Cheat Bug - 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: Anti Cheat Bug (
/showthread.php?tid=267509)
Anti Cheat Bug -
]B4E[kengston - 08.07.2011
Hey,
i made a AntiCheat. Its a bit buggy. When someone get banned because he cheated a weapon, he get banned, but when after the ban a new player joins he get also banned with the same reason. I dont know why, i hope you can help me. Here is the script.
Код:
if(Spieler[playerid][AdminLevel] == 0)
if(GetPVarInt(playerid,"DMStatus") == 0)
if(GetPlayerWeapon(playerid) == 45)
{
new name[128];
new string[128];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"Server: %s was banned by AntiBot. Reason: Thermal goggles",name);
SendClientMessageToAll(COLOR_LIGHTRED,string);
Ban(playerid);
new File:bans = fopen("/Server/bans.txt",io_append);
fwrite(bans,string);
fclose(bans);
ResetPlayerWeapons(playerid);
}
PS: I started "SetTimerEx" when someone connect and kill the timer when someone left. The example is a public.
Re: Anti Cheat Bug -
andruz99 - 08.07.2011
ґI suggest to put it under Public OnPlayerUpdate, and if someone gets the weapon.