[AJUDA] Qual problema com esse anti-cheat?
#1

Hoje fiz um anti-cheat, porйm ele estб banindo quem nao deveria, alguйm poderia me ajudar a resolver meu erro?

pawn Код:
#include <a_samp>

#define SLOTS_WEAPON 13

enum pInfo
{
    pWeapon[SLOTS_WEAPON],
    pAmmo[SLOTS_WEAPON]
}
new PlayerInfo[MAX_PLAYERS][pInfo];

new WeaponsSlot[47] = {
00, // 00
00, // 01
01, // 02
01, // 03
01, // 04
01, // 05
01, // 06
01, // 07
01, // 08
01, // 09
10, // 10
10, // 11
10, // 12
10, // 13
10, // 14
10, // 15
08, // 16
08, // 17
08, // 18
00, // 19
00, // 20
00, // 21
02, // 22
02, // 23
02, // 24
03, // 25
03, // 26
03, // 27
04, // 28
04, // 29
05, // 30
05, // 31
04, // 32
06, // 33
06, // 34
07, // 35
07, // 36
07, // 37
07, // 38
08, // 39
12, // 40
09, // 41
09, // 42
09, // 43
11, // 44
11, // 45
11  // 46
};

public OnPlayerConnect(playerid)
{
    ResetPlayerWeaponsEx(playerid);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    ResetPlayerWeaponsEx(playerid);
    return 1;
}

stock ResetPlayerWeaponsEx(playerid)
{
    ResetPlayerWeapons(playerid);
    for(new slot = 0; slot < SLOTS_WEAPON; slot++)
    {
        PlayerInfo[playerid][pWeapon][slot] = 0;
        PlayerInfo[playerid][pAmmo][slot] = 0;
    }
    return 1;
}

stock GivePlayerWeaponEx(playerid, weaponid, ammo)
{
    if(IsPlayerConnected(playerid))
    {
        ////////////////////////////////////////////////////////////////////////
        new slot = WeaponsSlot[weaponid];
        PlayerInfo[playerid][pWeapon][slot] = weaponid;
        PlayerInfo[playerid][pAmmo][slot] = ammo;
        ////////////////////////////////////////////////////////////////////////
        GivePlayerWeapon(playerid, weaponid, ammo);
    }
    return 1;
}

stock CheckWeaponsCheat(playerid)
{
    for(new slot = 0; slot < SLOTS_WEAPON; slot++)
    {
        new weapon, ammo;
        GetPlayerWeaponData(playerid, slot, weapon, ammo);

        if(ammo > 0) {
            if(weapon != PlayerInfo[playerid][pWeapon][slot]) return 1;
        }
    }
    return 0;
}

stock RemovePlayerWeapon(playerid, weaponid)
{
    new Weapon[SLOTS_WEAPON], Ammo[SLOTS_WEAPON];
    for(new slot = 0; slot < SLOTS_WEAPON; slot++)
    {
        new weapon, ammo;
        GetPlayerWeaponData(playerid, slot, weapon, ammo);
        if(weapon != weaponid) {
            Weapon[slot] = weapon; Ammo[slot] = ammo;
        }
    }
    ResetPlayerWeaponsEx(playerid);
    for(new slot = 0; slot < SLOTS_WEAPON; slot++)
    {
        GivePlayerWeaponEx(playerid, Weapon[slot], Ammo[slot]);
    }
    return 1;
}
Reply
#2

ai nгo tem nenhuma funзгo que faz banir o player.
poste o cуdigo todo.
Reply
#3

Isso aqui que bane o jogador:

pawn Код:
if(CheckWeaponsCheat(playerid))
{
    format(string, sizeof(string), "%s was banned from the Server | Reason: Weapon Cheat.",Nome(playerid));
    SendClientMessageToAll(azulescuro,string); Ban(playerid);
}
Isso estб dentro de um timer de 1 segundo.
Reply
#4

Posta a funзao : "CheckWeaponsCheat(playerid)".
Reply
#5

Quote:
Originally Posted by Gustavo_Araujo
Посмотреть сообщение
Posta a funзao : "CheckWeaponsCheat(playerid)".
Estб la em cima.
Reply
#6

pawn Код:
stock CheckWeaponsCheat(playerid)
{
    for(new slot = 0; slot < SLOTS_WEAPON; slot++)
    {
        new
            weapon,
            ammo
        ;
       
        GetPlayerWeaponData(playerid, slot, weapon, ammo);

        if(ammo > 0)
        {
            new is = WeaponsSlot[weapon]
            if(weapon != PlayerInfo[playerid][pWeapon][is]) return 1;
        }
    }
    return 0;
}
Tentas.
Reply
#7

Quote:
Originally Posted by [O.z]Caroline
Посмотреть сообщение
pawn Код:
stock CheckWeaponsCheat(playerid)
{
    for(new slot = 0; slot < SLOTS_WEAPON; slot++)
    {
        new
            weapon,
            ammo
        ;
       
        GetPlayerWeaponData(playerid, slot, weapon, ammo);

        if(ammo > 0)
        {
            new is = WeaponsSlot[weapon]
            if(weapon != PlayerInfo[playerid][pWeapon][is]) return 1;
        }
    }
    return 0;
}
Tentas.
Sera? Vou tentar...mas sera que nao do mesmo nao?
Reply
#8

Continua com problemas o Anti-Cheat, exemplo: Quando morre tambйm, estб kickando o jogador.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)