anti armour - 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)
+--- Thread: anti armour (
/showthread.php?tid=472161)
anti armour -
Another1 - 27.10.2013
hello i have this for anti armour cheat its compile fine but when i go in game and use armour cheat i didnt got kicked what the problem
pawn Код:
stock ArmourCheat(playerid, armour)
{
new str[100], p_name[MAX_PLAYER_NAME], Float:Armour;
GetPlayerArmour(playerid, Armour);
if(Armour = 100.0)
{
GetPlayerName(playerid, p_name,sizeof (p_name));
format(str,sizeof (str),"%s has been kicked for armour cheat",p_name);
SCMA(RED, str);
Kick(playerid);
}
return 1;
}
Re: anti armour -
DuongNghia - 27.10.2013
- Wrong line ?
Re: anti armour -
Pottus - 27.10.2013
Man... this can be written in 1 minute no kidding.....
pawn Код:
#include <YSI\y_hooks>
hook OnGameModeInit()
{
SetTimer("ArmourCheck", 4000, true);
return 1;
}
forward ArmourCheck();
public ArmourCheck()
{
new Float:armour;
foreach(new i : Player)
{
GetPlayerArmour(i, armour);
if(armour > 0.0)
{
// Do ban code or whatever here
}
}
return 1;
}
Re: anti armour -
Konstantinos - 27.10.2013
It does not work because you never call it.
Also, you need to use '==' in order to compare, not a single '=' which is assigning.
Pottus' code is fine if you exclude the hooking because it's not necessary at all. Just set the time to your gamemode and the callback for it to check about armour cheats.