SA-MP Forums Archive
Anti Cheat ^^ - 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 ^^ (/showthread.php?tid=233571)



Anti Cheat ^^ - Unknown123 - 02.03.2011

How can i make this so if im banned by using JetPack.. then i try to connect i get a message like
"You is banned from this server"
"You got banned because you spawned a jetpack"
How can i make like that,
pawn Код:
#include <a_samp>

forward AntiCheat();

public OnFilterScriptInit()
{
    SetTimer("AntiCheat", 1000, true);
    return 1;
}

public AntiCheat()
{
    //Jetpack
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerAdmin(i) && IsPlayerConnected(i))
        {
            if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK)
            {
                new name[MAX_PLAYER_NAME], string[128];
                GetPlayerName(i, name, sizeof(name));
                format(string, sizeof(string), "%s(%d) Spawned a Jetpack and got banned :)", name, i);
                SendClientMessageToAll(0xFF0000FF, string);
                BanEx(i, "Jetpack");
                return 1;
            }
        }
    }
    return 1;
}
Something like: xD
pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerBannedForJetpack))
    {
        SendClientMessage(playerid, 0xFF0000FF, "You is banned from this server");
        SendClientMessage(playerid, 0xFF0000FF, "Reason: JetPack hack");
        return 1;
    }
    return 1;
}



Re: Anti Cheat ^^ - [WF]Demon - 02.03.2011

store 2 things in that players file, 1. banned=1 and bannedreason=jetpack, on connect get banned, if banned = 1 than get bannedreason, use strcmp to compare what it says so you know what reason their banned, return why their banned and kick them, simple.


Re: Anti Cheat ^^ - Antonio [G-RP] - 02.03.2011

You could do what Demon said, or...

Ignore the player that was banned altogether. They hacked, if they want to apply for un-ban on your forums or website, then they can. You used BanEx(), so you know why they were banned. Really, you don't need to worry about it.