weapon anticheat bugging the server
#1

anytime someone gets banned from this it spams the lines 9 times in the server then noone can join.

pawn Код:
if(ScriptWeaponsUpdated[i] == 0)
        {
            if(IsSpawned[i] == 1)
            {
                for (new c = 0; c < 13; c++)
                {
                    GetPlayerWeaponData(i, c, weaponid, ammo);
                    if (weaponid != 0 && ammo != 0)
                    {
                        if (ScriptWeapons[i][c] != weaponid)
                        {
                            if(weaponid != 2 && weaponid != 3 && weaponid != 4 && weaponid != 5 &&
                            weaponid != 6 && weaponid != 7 && weaponid != 8 && weaponid != 9 && weaponid != 40 && weaponid != 46)
                            {
                            new weapon[24]; GetWeaponName(weaponid, weapon, 24);

                            new string[128];
                            format(string, sizeof(string), "**(AUTO BAN)** %s(%d) Has Been Banned From The Server - Reason: Weapon Hacks/Cheats",Playername(i),i);
                            SendClientMessageToAll(PINK, string);
                            format(string, sizeof(string),"You have Been Banned by The Anticheat For Weapon Hacking A %s(%d) For 15 Days",weapon,weaponid);
                            SendClientMessage(i,COLOR_LIGHTBLUE, string);
                            SendClientMessage(i, RED, "If You Think This Ban Was A Mistake, Or You Wish To Appeal This Ban, Press F8");
                            SendClientMessage(i, RED, "To Take A Screenshot Which Will Be Needed To Appeal Your Ban, Then Go To");
                            SendClientMessage(i, RED, "www.LasVenturas.Net, Click On The Ban Appeals Section, And Post You Ban Appeal.");
                            SafeBan(i,"Auto Weapon Hacks",15);
                            }
                        }
                    }
                }
            }
        }
its not the "Safeban" function causing the problem.
because i use it in the "SAME" Timer and it doesnt bug the server.

also this is banning for fake hacks i dont understand why

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    PlayerInfo[playerid][LastVeh] = vehicleid;
    ScriptWeaponsUpdated[playerid] = 1;
    SetTimerEx("UpdateWeapons",3000,false,"i",playerid);
    return 1;
}
if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER)
    {
        ScriptWeaponsUpdated[playerid] = 1;
        SetTimerEx("UpdateWeapons",2000,false,"i",playerid);
        SetPVarInt(playerid, "HoodsOn", 0);
        SetPVarInt(playerid, "EngineOn", 0);
        SetPVarInt(playerid, "TrunkOn", 0);
        SetPVarInt(playerid, "AlarmOn", 0);
        SetPVarInt(playerid, "LightsOn", 0);
    }
    if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
    {
        ScriptWeaponsUpdated[playerid] = 1;
        SetTimerEx("UpdateWeapons",2000,false,"i",playerid);
        SendClientMessage(playerid,White,"You Are Now Driving A Vehicle. Type /Vehhelp For More Information");
    }
    if(newstate == PLAYER_STATE_PASSENGER && oldstate == PLAYER_STATE_ONFOOT)
    {
        ScriptWeaponsUpdated[playerid] = 1;
        SetTimerEx("UpdateWeapons",2000,false,"i",playerid);
    }
    if(newstate == PLAYER_STATE_WASTED && oldstate == PLAYER_STATE_DRIVER)
    {
        ScriptWeaponsUpdated[playerid] = 1;
        SetTimerEx("UpdateWeapons",2500,false,"i",playerid);
    }
public SafeResetPlayerWeapons(playerid)
{
    ScriptWeaponsUpdated[playerid] = 1;
    for(new i = 0; i < 13; i++)
    {
        ScriptWeapons[playerid][i] = 0;
    }
    ResetPlayerWeapons(playerid);
    SetTimerEx("UpdateWeapons",2500,false,"i",playerid);
    return 1;
}
forward UpdateWeapon(playerid,weaponid);
public UpdateWeapon(playerid,weaponid)
{
    ScriptWeaponsUpdated[playerid] = 1;
    ScriptWeapons[playerid][GetWeaponSlot(weaponid)]=weaponid;
    SetTimerEx("UpdateWeapons",2500,false,"i",playerid);
    return 1;
}
forward UpdateWeapons(plyid);
public UpdateWeapons(plyid)
{
    new weaponid, ammo;
    for(new i = 0; i < 13; i++)
    {
        GetPlayerWeaponData(plyid, i, weaponid, ammo);
        ScriptWeapons[plyid][i] = weaponid;
    }
    ScriptWeaponsUpdated[plyid] = 0;
    return 1;
}
stock GetWeaponSlot( weaponid )
{
    switch( weaponid )
    {
        case 0, 1: return 0;
        case 2..9: return 1;
        case 10..15: return 10;
        case 16..18, 39: return 8;
        case 22..24: return 2;
        case 25..27: return 3;
        case 28, 29, 32: return 4;
        case 30, 31: return 5;
        case 33, 34: return 6;
        case 35..38: return 7;
        case 40: return 12;
        case 41..43: return 9;
        case 44..46: return 11;
        default: return -1;
    }
    return -1;
}
Reply
#2

don't ban someone from inside a weapondata loop
Reply
#3

or just use break;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)