SA-MP Forums Archive
Where Shall i place this? - 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: Where Shall i place this? (/showthread.php?tid=300771)



Where Shall i place this? - Shockey HD - 01.12.2011

I created a quick script that if your armour is 100+, You will get banned for Amour hacking,
But, Where is the best place to place it?

Heres my Coding.

pawn Код:
new Float:armour;
    GetPlayerArmour(playerid,armour);
    if (armour == 100)
    {
        new banned [MAX_PLAYERS],string[128];
        GetPlayerName(playerid, banned, sizeof(banned));
        format(string, sizeof(string), "AdminCMD: %s has been banned for Armour Hacks", banned);
        SendClientMessageToAll(COLOR_ORANGE, string);
        Ban(playerid);
    }



Re: Where Shall i place this? - English-Conceptz - 01.12.2011

edit: ignore comment, realised what i said =[


Re: Where Shall i place this? - Kostas' - 01.12.2011

OnPlayerUpdate I guess. Not sure


Re: Where Shall i place this? - [MG]Dimi - 01.12.2011

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
OnPlayerUpdate I guess. Not sure
I would create Timer.
pawn Код:
forward ArmourCheck();

public ArmourCheck()
{
    new Float:armour;
    for(new c=0;c<MAX_PLAYERS;c++) 
    if(IsPlayerConnected(c))
    {
        GetPlayerArmour(c,armour);
        if (armour > 100.0)
        {
            new banned[MAX_PLAYER_NAME],string[128];
            GetPlayerName(c, banned, sizeof(banned));
            format(string, sizeof(string), "AdminCMD: %s has been banned for Armour Hacks", banned);
            SendClientMessageToAll(COLOR_ORANGE, string);
            Ban(c);
        }
    }
    return 1;
}

public OnGameModeInit()
{
    SetTimer("ArmourCheck",1000,true);
    return 1;
}
I have also edited you code