SA-MP Forums Archive
Anticheat not work. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Anticheat not work. (/showthread.php?tid=557351)



Anticheat not work. - Baltimore - 13.01.2015

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 ..


Re: Anticheat not work. - LucaAllexandre - 13.01.2015

Can place all code ?


Re : Anticheat not work. - Baltimore - 13.01.2015

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;

}



Re: Anticheat not work. - Threshold - 14.01.2015

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


Re: Anticheat not work. - Evocator - 14.01.2015

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...