Anti Fail - 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 Fail (
/showthread.php?tid=169540)
Anti Fail -
willsuckformoney - 19.08.2010
pawn Код:
#if defined AntiWeap
public OnPlayerUpdate(playerid)
{
if(PlayerInfo[playerid][Level] >= 2 && IsPlayerAdmin(playerid))
{
return 1;
}
else if(GetPlayerInterior(playerid) == 1 && 4 && 6 && 7)
{
return 1;
} else if(GetPlayerInterior(playerid) == 0){
new weapon, ammo, str[128];
GetPlayerWeaponData(playerid, 7, weapon, ammo);
if(GetPlayerWeapon(playerid) == >= 1 && <= 39)
{
format(str, sizeof(str), "[FrosTiC AnTi]: %s (%d) has been Kicked by FrosTiC AnTi CheaT. (Reason: Weapon Hacks)",PlayerName(playerid),playerid);
format(strtofile, sizeof(strtofile), "%s (%d) has been Kicked by FrosTiC AnTi CheaT. (Reason: Weapon Hacks)",PlayerName(playerid),playerid);
SendClientMessageToAll(pink, str);
SaveToFile(AntiCheat, string);
Kick(playerid);
}
}
return 1;
}
#endif
It don't kick if someone hacks a weapon or even if is given a weapon outside of the ammu's
Re: Anti Fail -
Fj0rtizFredde - 19.08.2010
I think this:
pawn Код:
else if(GetPlayerInterior(playerid) == 1 && 4 && 6 && 7)
Should be like:
pawn Код:
else if(GetPlayerInterior(playerid) == 1 && GetPlayerInterior(playerid) == 4 && GetPlayerInterior(playerid) == 6 && GetPlayerInterior(playerid) == 7)
Also are you sure that you should have && insteed of || ?
Re: Anti Fail -
willsuckformoney - 19.08.2010
i don't use the || i use &&
EDIT: Failed
Re: Anti Fail -
ScottCFR - 20.08.2010
You shouldn't use OnPlayerUpdate. It gets called too much. Mine is on a 3000 timer, and it loops through everyone. You should try that.
Re: Anti Fail -
willsuckformoney - 20.08.2010
I learned that
![Cheesy](images/smilies/biggrin.png)
anyways I think I got it working now