Nothing is showing up / being done.
#1

I tried to make an Infinite-Ammo cheat detection, but for some reason, the script doesn't want to work..
pawn Код:
//Local
new
    LastSavedAmmo[ MAX_PLAYERS ],
    LastSavedWeapon[ MAX_PLAYERS ],
   
    CurrentAmmo[ MAX_PLAYERS ],
    CurrentWeapon[ MAX_PLAYERS ],
   
    CanCheckDifference[ MAX_PLAYERS ]
;
//OnPlayerConnect
    LastSavedAmmo[playerid] = 0;
    LastSavedWeapon[playerid] = 0;

    CurrentAmmo[playerid] = 0;
    CurrentWeapon[playerid] = 0;
//OnPlayerWeaponShot
if(LastSavedWeapon[playerid] == CurrentWeapon[playerid] && CanCheckDifference[playerid])
    {
        if(LastSavedAmmo[playerid] == CurrentAmmo[playerid])
        {
            SendClientMessage(playerid, -1, "Bad boy, stop using hax pls ;_;");
        }
        else
        {
            SendClientMessage(playerid, -1, "Good boy, no ammo hax :)");
        }
    }
//Timers and other stuff..
forward AllowChecking(playerid);
public AllowChecking(playerid)
{
    CanCheckDifference[playerid] = 1;
    SendClientMessage(playerid, -1, "CanCheckDifference = 1");
    return 1;
}
forward AntiAmmoHack();
public AntiAmmoHack()
{
    foreach(Player, i)
    {
        CurrentAmmo[i] = GetPlayerAmmo(i);
        CurrentWeapon[i] = GetPlayerWeapon(i);
        CanCheckDifference[i] = 0;
       
        SetTimerEx("AllowChecking", 500, false, "i", i);
       
        SendClientMessage(i, -1, "CurrentAmmo + CurrentWeapon + CanCheckDifference = 0");
    }
    return 1;
}
//Timer where i store 'LastSavedWeapon'/Ammo
forward AntiCheat();
public AntiCheat()
{
    //many things here
    foreach(Player, i)
    {
        //things here

        switch(GetPlayerWeapon(i))
        {
            case 16..43:
            {
                LastSavedAmmo[i] = GetPlayerAmmo(i);
                LastSavedWeapon[i] = GetPlayerWeapon(i);
                SendClientMessage(i, -1, "LastSavedAmmo + LastSavedWeapon used now");
            }
        }
I tried debugging it ( you can see by the messages ), but that doesn't work either.
Reply


Messages In This Thread
Nothing is showing up / being done. - by Kyance - 20.06.2014, 06:43
Re: Nothing is showing up / being done. - by Haydz - 20.06.2014, 06:59
Re: Nothing is showing up / being done. - by Kyance - 20.06.2014, 10:34

Forum Jump:


Users browsing this thread: 2 Guest(s)