AntiCheat [ Help ]
#1

Hello

i want make if is admin or helper , not kick for cheat

code :
pawn Код:
public antiCheat()
{
    foreach(Player, i)
    {
        if(playerVariables[i][pStatus] >= 1)
        {
            if(playerVariables[i][pAdminLevel] < 1 || playerVariables[i][pHelper] < 1)
            {
                GetPlayerName(i,szPlayerName, MAX_PLAYER_NAME);
                if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK && playerVariables[i][pJetpack] == 0)
                {
                    scriptBan(i, "Cheats (Jetpack)");
                }
                if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
                {
                    new speed=GetPlayerSpeed(i,0);
                    if(speed>290)
                    {
                        scriptBan(i,"Cheats (Speed Hack)");
                    }
                }
                else if(!IsPlayerInAnyVehicle(i))
                {
                    new speed=GetPlayerSpeed(i,0);
                    if(speed>300)
                    {
                        scriptBan(i,"Cheats (Speed Hack)");
                    }  
                }
            }  
        }
    }
    return 1;
}
stock scriptBan(playerid, reason[])
{
    new aString[240];

    GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);


    format(aString, sizeof(aString), "Kick: %s has been kicked By AntiCheat, reason: %s", szPlayerName, reason);
    SendClientMessageToAll(COLOR_LIGHTRED, aString);

    mysql_real_escape_string(aString, aString);
    adminLog(aString);


    Kick(playerid);
    return 1;
}
Reply
#2

pawn Код:
stock scriptBan(playerid, reason[])
{
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{ff0000}You tried to hack");

    new aString[240];

    GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);


    format(aString, sizeof(aString), "Kick: %s has been kicked By AntiCheat, reason: %s", szPlayerName, reason);
    SendClientMessageToAll(COLOR_LIGHTRED, aString);

    mysql_real_escape_string(aString, aString);
    adminLog(aString);


    Kick(playerid);
    return 1;
}
change ur stock function to this, if u're logged in rcon, then u'll just get client message instead of getting banned/kicked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)