Anticheat not work.
#1

Hello !

I have an anticheat, but, it's not work, look:

pawn Код:
static pWeapons[12] = {0};
static pAmmo[12] = {0};

public OnPlayerUpdate(playerid)
{
    new weapons[12], ammo[12];
    for(new s = 0; s < 12; s++)
    {
        GetPlayerWeaponData(playerid, s, weapons[s], ammo[s]);
        if(weapons[s] != pWeapons[s] && GetPVarInt(playerid, "Weapons") != 1) BanEx(playerid, "Cheat!");

        pWeapons[s] = weapons[s];
    }

}
In my command for give weapon:

pawn Код:
SetPVarInt(playerid, "Weapon", 1);
But it still detects a cheat while no ..
Reply
#2

Can place all code ?
Reply
#3

My code for give a weapon:

pawn Код:
stock AC_GivePlayerWeapon(playerid, weaponid, muni)
{
    SetPVarInt(playerid, "Weapon", 1);
    GivePlayerWeapon(playerid, weaponid, muni);
    SetTimerEx("stopWeapon", 300, false, "i", playerid);
    return 1;
}

forward stopWeapon(playerid);
public stopWeapon(playerid)
{
    DeletePVar(playerid, "Weapon");
    return 1;
}
And my OnPlayerUpdate for detect:

pawn Код:
static pWeapons[12] = {0};
static pAmmo[12] = {0};

public OnPlayerUpdate(playerid)
{
    new weapons[12], ammo[12];
    for(new s = 0; s < 12; s++)
    {
        GetPlayerWeaponData(playerid, s, weapons[s], ammo[s]);
        if(weapons[s] != pWeapons[s] && GetPVarInt(playerid, "Weapons") != 1) BanEx(playerid, "Cheat dgun !");

        pWeapons[s] = weapons[s];
    }
return 1;

}
Reply
#4

pawn Код:
GetPVarInt(playerid, "Weapons")
pawn Код:
SetPVarInt(playerid, "Weapon", 1);
Now do you see it?
Reply
#5

Quote:
Originally Posted by Threshold
Посмотреть сообщение
pawn Код:
GetPVarInt(playerid, "Weapons")
pawn Код:
SetPVarInt(playerid, "Weapon", 1);
Now do you see it?
Moreover, there are many weapons. You cannot use one variable to detect all of them...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)