Anti Cheat ^^
#1

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)