Anti Weapon Hack
#3

Thanks for help, i remade it hope its better:

Код:
public SafeGivePlayerWeapon(playerid, weaponid, ammo)
{
	for(new j = 0; j < 13; j++)
	{
		new wep, ammo23;
		GetPlayerWeaponData(playerid, j, wep, ammo23);
		{
			if(AntiCheatWeapon[playerid][j] == wep)
			{
				AntiCheatAmmo[playerid][j] = ammo23+ammo;
				GivePlayerWeapon(playerid, weaponid, ammo);
			}
			else if((AntiCheatWeapon[playerid][j] != wep) && (AntiCheatAmmo[playerid][j] == 0))
			{
			    AntiCheatAmmo[playerid][j] = ammo;
			    AntiCheatWeapon[playerid][j] = wep;
			}
		}
	}
	ScriptWeaponsUpdated[playerid] = 1;
    SetTimerEx("UpdateWeapons",2500,false,"i",playerid);
	return 1;
}
forward MaticAntiWeaponHack();
public MaticAntiWeaponHack()
{
	new t[128];
	new WeponCheckDone[MAX_PLAYERS];
	new giveplayer[MAX_PLAYER_NAME];
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    if(gPlayerLogged[i] == 1)
	    {
			for(new j = 0; j < 13; j++)
			{
			    new wep, ammo;
			    GetPlayerWeaponData(i, j, wep, ammo);

			    if(ammo == 0)
				{
					continue;
				}
			    if(((AntiCheatWeapon[i][j] != wep) || (AntiCheatAmmo[i][j] < ammo)) && wep != 46 && wep != 40)
				{
					GetPlayerName(i, giveplayer, sizeof(giveplayer));
					if(admins >= 1)
					{
						format(t, sizeof(t), "%s[%i] - Has Been Kicked for possible weapon hacking!!", giveplayer, i);
						SendClientMessageToAll(COLOR_NICERED,t);
						Kick(i);
					}
					else
					{
					    new HackedAmmo123;
					    HackedAmmo123 = ammo-AntiCheatAmmo[i][j]
						format(t, sizeof(t), "%s[%d] - Is possible weapon(SLOT:%d AMMO: %s) hecking check him!(/checkweapons) ", giveplayer, i, j,HackedAmmo123);
						SendAdminMessage(COLOR_NICERED,t);
					}
			    }
			    WeponCheckDone[i] = 1;
			}
		}
		SetTimer("MaticAntiWeaponHack", 10000, false);
	}
	return 1;
}

public SafeResetPlayerWeapons(playerid)
{
	ScriptWeaponsUpdated[playerid] = 1;
	ResetPlayerWeapons(playerid);
	for(new j = 0; j < 13; j++)
	{
	    AntiCheatWeapon[playerid][j] = 0;
	    AntiCheatAmmo[playerid][j] = 0;
	}
	SetTimerEx("UpdateWeapons",2500,false,"i",playerid);
	return 1;
}
Reply


Messages In This Thread
Anti Weapon Hack - by kepa333 - 25.06.2013, 00:44
Re: Anti Weapon Hack - by Alternative112 - 25.06.2013, 05:16
Re: Anti Weapon Hack - by kepa333 - 26.06.2013, 09:30

Forum Jump:


Users browsing this thread: 1 Guest(s)