A serious problem with antiCheat Weapons
#1

Thats all what i did the problam in the end -

PHP код:
forward GivePlayerWeaponEX(playeridweaponidammo);
public 
GivePlayerWeaponEX(playeridweaponidammo)
{
    
SafeWeapon[playerid] = 1;
    
PlayerHaveWeapon[playerid][weaponid] = 1;
    
GivePlayerWeapon(playeridweaponidammo);
    
SetTimerEx("SafeWeapons",1000,0,"%d",playerid);
return 
1;
}
forward ResetPlayerWeaponsEX(playerid);
public 
ResetPlayerWeaponsEX(playerid)
{
SafeWeapon[playerid] = 1;
ResetPlayerWeapons(playerid);
    for (new 
154i++)
    {
    
PlayerHaveWeapon[playerid][i] = 0;
    }
SetTimerEx("SafeWeapons",1000,0,"%d",playerid);
SafeWeapon[playerid] = 0;
return 
1;
}
forward SafeWeapons(playerid);
public 
SafeWeapons(playerid)
{
SafeWeapon[playerid] = 0;
return 
1;

in OnPlayerUpdate -

PHP код:
    if(PlayerHaveWeapon[playerid][GetPlayerWeapon(playerid)] == && GetPlayerWeapon(playerid) != && SafeWeapon[playerid] == 0)
    {
    
ResetPlayerWeaponsEX(playerid);
        if(
PlayerChecked2[playerid] == 0)
        {
         if(
PlayerConnect[playerid] == 0)
          {
            if(
Chance2[playerid] == 1)
            {
            
scm(playerid,red,"[Anti_Cheat] Weapon Cheat :чйбмъ бап одщшъ, сйбд");
            
BanEx(playerid,"Weapon Cheat");
            }
    
Chance2[playerid]++;
    new 
string[128],gunname[25];
    
GetWeaponNameEx(GetPlayerWeapon(playerid), gunnamesizeof(gunname));
    
format(stringsizeof(string), "[%s] тн зщщ мц'йи рщчйн, ра ифм бочшд жд [ID: %d] %s",gunname,playerid,GetName(playerid));
    
scmAdmin(white,string);
    
PlayerChecked2[playerid] = 1;
    
SetTimerEx("DownCheckANtiWeapon",10*1000,0,"%d",playerid);
         }
        }
    } 
The Problam -
When i start to example race, it's give me ban and reason - use weapon cheat - Desert Eagle

* the problam is in the ResetPlayerWeaponsEX because it's didn't zero the variables of the weapons [i think].. even they didn't on me !!



PLEASE I REALY NEED YOUR HELP !!!
Reply
#2

Код:
forward GivePlayerWeaponEX(playerid, weaponid, ammo);
public GivePlayerWeaponEX(playerid, weaponid, ammo)
{
    SafeWeapon[playerid] = 1;
    PlayerHaveWeapon[playerid][weaponid] = 1;
    GivePlayerWeapon(playerid, weaponid, ammo);
    SetTimerEx("SafeWeapons",1000,0,"%d",playerid);
return 1;
}
forward ResetPlayerWeaponsEX(playerid);
public ResetPlayerWeaponsEX(playerid)
{
SafeWeapon[playerid] = 1;
ResetPlayerWeapons(playerid);
    for (new i = 1; i < 54; i++)
    {
    PlayerHaveWeapon[playerid][i] = 0;
    }
SetTimerEx("SafeWeapons",1000,0,"%d",playerid);
SafeWeapon[playerid] = 0;
return 1;
}
First red line: Why not JUST remove safeweapon? It's more effective..

Second red line: You removed it twice.. POINTLESS, just remove it without a timer at the end of both functions.
Reply
#3

still not working .. that what i did -
PHP код:
forward GivePlayerWeaponEX(playeridweaponidammo);
public 
GivePlayerWeaponEX(playeridweaponidammo)
{
    
SafeWeapon[playerid] = 1;
    
PlayerHaveWeapon[playerid][weaponid] = 1;
    
GivePlayerWeapon(playeridweaponidammo);
    
SafeWeapon[playerid] = 0;
return 
1;
}
forward ResetPlayerWeaponsEX(playerid);
public 
ResetPlayerWeaponsEX(playerid)
{
SafeWeapon[playerid] = 1;
ResetPlayerWeapons(playerid);
    for (new 
154i++)
    {
    
PlayerHaveWeapon[playerid][i] = 0;
    }
SafeWeapon[playerid] = 0;
return 
1;

PLEASE HELP
Reply
#4

Код:
forward GivePlayerWeaponEX(playerid, weaponid, ammo);
public GivePlayerWeaponEX(playerid, weaponid, ammo)
{
    SafeWeapon[playerid] = 1;
    PlayerHaveWeapon[playerid][weaponid] = 1;
    GivePlayerWeapon(playerid, weaponid, ammo);
    SafeWeapon[playerid] = 0;
	return 1;
}
forward ResetPlayerWeaponsEX(playerid);
public ResetPlayerWeaponsEX(playerid)
{
	SafeWeapon[playerid] = 1;
	ResetPlayerWeapons(playerid);
    for (new i = 1; i < 54; i++)
    {
    	PlayerHaveWeapon[playerid][i] = 0;
    }
	SafeWeapon[playerid] = 0;
	return 1;
}
public OnPlayerUpdate(playerid)
{
    if(PlayerHaveWeapon[playerid][GetPlayerWeapon(playerid)] == 0 && GetPlayerWeapon(playerid) != 0 && SafeWeapon[playerid] == 0)
    {
    	ResetPlayerWeaponsEX(playerid);
    	if(PlayerChecked2[playerid] == 0)
    	{
     		if(PlayerConnect[playerid] == 0)
			{
        		if(Chance2[playerid] == 1)
        		{
      				scm(playerid,red,"[Anti_Cheat] Weapon Cheat :чйбмъ бап одщшъ, сйбд");
      				BanEx(playerid,"Weapon Cheat");
      				return 1;
        		}
			    Chance2[playerid]++;
			    new string[128],gunname[25];
			    GetWeaponNameEx(GetPlayerWeapon(playerid), gunname, sizeof(gunname));
			    format(string, sizeof(string), "[%s] тн зщщ мц'йи рщчйн, ра ифм бочшд жд [ID: %d] %s",gunname,playerid,GetName(playerid));
			    scmAdmin(white,string);
			    PlayerChecked2[playerid] = 1;
			    SetTimerEx("DownCheckANtiWeapon",10*1000,0,"%d",playerid);
			    return 1;
			}
		}
	}
	return 1;
}
Reply
#5

it's work now .. the problam was that i need to add && !IsPlayerInAnyVehicle(playerid) ...............

thank you anyway !!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)