anti armour
#1

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

- Wrong line ?
Reply
#3

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;
}
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)