how to make my admin immune to antihack system
#1

how to make it so Rcon-admin are immune to the commands.

and certain skins immune to the weapons.

pawn Код:
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>
#include <sscanf>
forward ResetCount(playerid);
new bool:IsPlayerInModShop[MAX_PLAYERS];
forward ResetCommandCount(playerid);

#define SpamLimit (3000)

#define red 0xFF0000

#define version "1.0"


#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Virtual Homer ");
    print(" version 1.0");
    print("--------------------------------------\n");
    return 1;
   
}


public OnFilterScriptExit()
{
    print("[*] Virtual Homers Anti-Spam Unloaded.");
    return 1;
}

#endif
public OnPlayerText(playerid, text[])
{
        new TCount, KMessage[128];

        TCount = GetPVarInt(playerid, "TextSpamCount");

        TCount++;

        SetPVarInt(playerid, "TextSpamCount", TCount);

        if(TCount == 2) {
            SendClientMessage(playerid, 0xFFFFFF, "{ff0000}[Virtual Homer Spam Warning You Will be Kicked for Spamming");
        }
        else if(TCount == 3) {
            GetPlayerName(playerid, KMessage, sizeof(KMessage));
            format(KMessage, sizeof(KMessage), " {00ff00}Virtual Homer Has kicked: {ff0000}%s {00ff00}For Spamming", KMessage);
            SendClientMessageToAll(0xFFFFFF, KMessage);
            print(KMessage);
            Kick(playerid);
        }

        SetTimerEx("ResetCount", SpamLimit, false, "i", playerid);

        return 1;
}

public ResetCount(playerid)
{
        SetPVarInt(playerid, "TextSpamCount", 0);
}
public ResetCommandCount(playerid)
{
        SetPVarInt(playerid, "CommandSpamCount", 0);
}

public OnEnterExitModShop(playerid, enterexit, interiorid)
{
    if(!enterexit) IsPlayerInModShop[playerid] = false;
    else IsPlayerInModShop[playerid] = true;
    return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
    if(!IsPlayerInModShop[playerid])
    {
        new sendername[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, 128, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}Tune Hack", sendername);
        SendClientMessageToAll(red, string);
        format( string, sizeof(string), "VIRTUAL HOMER ");
        GameTextForAll( string, 5000, 3 );
        BanEx(playerid, "Tune Hack");
    }
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    if(!IsPlayerInModShop[playerid])
    {
        new sendername[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, 128, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}Tune Hack", sendername);
        SendClientMessageToAll(red, string);
        format( string, sizeof(string), "VIRTUAL HOMER ");
        GameTextForAll( string, 5000, 3 );
        BanEx(playerid, "Tune Hack");
    }
}




public OnPlayerSpawn(playerid)
{
    SetPlayerArmour(playerid, 0.0);
    return 1;
}
public OnPlayerUpdate(playerid)
{
    if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN || GetPlayerWeapon(playerid) == 16 || GetPlayerWeapon(playerid) == 17 || GetPlayerWeapon(playerid) == 18 || GetPlayerWeapon(playerid) == WEAPON_SATCHEL || GetPlayerWeapon(playerid) == WEAPON_ROCKETLAUNCHER)
    {
        new sendername[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, 128, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}Weapon Hack", sendername);
        SendClientMessageToAll(red, string);
        format( string, sizeof(string), "VIRTUAL HOMER ");
        GameTextForAll( string, 5000, 3 );
        for ( new i = 0; i != MAX_PLAYERS; ++i ) PlayerPlaySound(i, 1057, 0.0, 0.0, 10.0);
        TogglePlayerControllable(playerid, 0);
        BanEx(playerid, "Weapon Hack");
        return 1;
    }
    new Float:health;
    if(GetPlayerHealth(playerid, health) > 999999)
    {
        new sendername[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, 128, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}Health Hack", sendername);
        SendClientMessageToAll(red, string);
        format( string, sizeof(string), "VIRTUAL HOMER ");
        GameTextForAll( string, 5000, 3 );
        TogglePlayerControllable(playerid, 0);
        BanEx(playerid, "Health Hack");
        return 1;
    }
    new Float:armor;
    if(GetPlayerArmour(playerid, armor) == 100)
    {
        new sendername[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, 128, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}Armour Hack", sendername);
        SendClientMessageToAll(red, string);
        format( string, sizeof(string), "VIRTUAL HOMER ");
        GameTextForAll( string, 5000, 3 );
        TogglePlayerControllable(playerid, 0);
        BanEx(playerid, "Armor Hack");
        return 1;
    }
    return 1;
}
Reply
#2

pawn Код:
if(!IsPlayerAdmin(playerid))
{
// your code
}
Reply
#3

that doesnt help, i no how to use is player admin but where i put it.

and also how to make it so all weapons are only useable by certain skin ids only
Reply
#4

there, i added it in for you.
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(!IsPlayerAdmin(playerid))
    {
        if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN || GetPlayerWeapon(playerid) == 16 || GetPlayerWeapon(playerid) == 17 || GetPlayerWeapon(playerid) == 18 || GetPlayerWeapon(playerid) == WEAPON_SATCHEL || GetPlayerWeapon(playerid) == WEAPON_ROCKETLAUNCHER)
        {
            new sendername[MAX_PLAYER_NAME];
            new string[128];
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, 128, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}Weapon Hack", sendername);
            SendClientMessageToAll(red, string);
            format( string, sizeof(string), "VIRTUAL HOMER ");
            GameTextForAll( string, 5000, 3 );
            for ( new i = 0; i != MAX_PLAYERS; ++i ) PlayerPlaySound(i, 1057, 0.0, 0.0, 10.0);
            TogglePlayerControllable(playerid, 0);
            BanEx(playerid, "Weapon Hack");
            return 1;
        }
        new Float:health;
        if(GetPlayerHealth(playerid, health) > 999999)
        {
            new sendername[MAX_PLAYER_NAME];
            new string[128];
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, 128, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}Health Hack", sendername);
            SendClientMessageToAll(red, string);
            format( string, sizeof(string), "VIRTUAL HOMER ");
            GameTextForAll( string, 5000, 3 );
            TogglePlayerControllable(playerid, 0);
            BanEx(playerid, "Health Hack");
            return 1;
        }
        new Float:armor;
        if(GetPlayerArmour(playerid, armor) == 100)
        {
            new sendername[MAX_PLAYER_NAME];
            new string[128];
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, 128, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}Armour Hack", sendername);
            SendClientMessageToAll(red, string);
            format( string, sizeof(string), "VIRTUAL HOMER ");
            GameTextForAll( string, 5000, 3 );
            TogglePlayerControllable(playerid, 0);
            BanEx(playerid, "Armor Hack");
            return 1;
        }
    }
    return 1;
}
Reply
#5

will that make it so only admins can use weapons , so basically if not logged into rcon they get banned
Reply
#6

yes, that would make the admins excluded from the anti-cheat checking process.

let me break it down for you:
pawn Код:
if(!IsPlayerAdmin(playerid))
the code above would check if the player is an admin or not (you know it already), if the player is an admin, the code below it would only done for non-admin players. and yes, RCON login.
Reply
#7

ok so how to make it that only certain players can get weapons so certain skins
Reply
#8

if there's only a few skins for that purpose, then you can do it using if - else if - else statements. but if there's a lot, i suggest that you create an array for the skins and their weapon limitations.
Reply
#9

Код:
public AntiCheat()
{
    for(new playerid; playerid<MAX_PLAYERS; playerid++)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerLogged[playerid] == 1 && PInfo[playerid][AdminLevel] == 0)
            {
              //Your anticheat codes here
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)