Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //anty weapon hack
- #include <a_samp>
- enum weapons
- {
- Melee,
- Thrown,
- Pistols,
- Shotguns,
- SubMachine,
- Assault,
- Rifles,
- Heavy,
- Handheld,
- }
- new Weapons[MAX_PLAYERS][weapons];
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #endif
- public OnPlayerSpawn(playerid)
- {
- ServerWeapon(playerid, 24, 200);
- ServerWeapon(playerid, 31, 200);
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- CheckWeapons(playerid);
- return 1;
- }
- CheckWeapons(playerid)
- {
- new weaponid = GetPlayerWeapon(playerid);
- if(weaponid >= 1 && weaponid <= 15)
- {
- if(weaponid == Weapons[playerid][Melee])
- {
- return 1;
- }
- else
- {
- SendClientMessage(playerid, -1, "Weapon Hack.");
- }
- }
- if( weaponid >= 16 && weaponid <= 18 || weaponid == 39 )
- {
- if(weaponid == Weapons[playerid][Thrown])
- {
- return 1;
- }
- else
- {
- SendClientMessage(playerid, -1, "Weapon Hack.");
- }
- }
- if( weaponid >= 22 && weaponid <= 24 )
- {
- if(weaponid == Weapons[playerid][Pistols])
- {
- return 1;
- }
- else
- {
- SendClientMessage(playerid, -1, "Weapon Hack.");
- }
- }
- if( weaponid >= 25 && weaponid <= 27 )
- {
- if(weaponid == Weapons[playerid][Shotguns])
- {
- return 1;
- }
- else
- {
- SendClientMessage(playerid, -1, "Weapon Hack.");
- }
- }
- if( weaponid == 28 || weaponid == 29 || weaponid == 32 )
- {
- if(weaponid == Weapons[playerid][SubMachine])
- {
- return 1;
- }
- else
- {
- SendClientMessage(playerid, -1, "Weapon Hack.");
- }
- }
- if( weaponid == 30 || weaponid == 31 )
- {
- if(weaponid == Weapons[playerid][Assault])
- {
- return 1;
- }
- else
- {
- SendClientMessage(playerid, -1, "Weapon Hack.");
- }
- }
- if( weaponid == 33 || weaponid == 34 )
- {
- if(weaponid == Weapons[playerid][Rifles])
- {
- return 1;
- }
- else
- {
- SendClientMessage(playerid, -1, "Weapon Hack.");
- }
- }
- if( weaponid >= 35 && weaponid <= 38 )
- {
- if(weaponid == Weapons[playerid][Heavy])
- {
- return 1;
- }
- else
- {
- SendClientMessage(playerid, -1, "Weapon Hack.");
- }
- }
- else
- {
- return 1;
- }
- return 1;
- }
- ServerWeapon(playerid, weaponid, ammo)
- {
- if(weaponid >= 1 && weaponid <= 15)
- {
- Weapons[playerid][Melee] = weaponid;
- GivePlayerWeapon(playerid, weaponid, ammo);
- return 1;
- }
- if( weaponid >= 16 && weaponid <= 18 || weaponid == 39 )
- {
- Weapons[playerid][Thrown] = weaponid;
- GivePlayerWeapon(playerid, weaponid, ammo);
- return 1;
- }
- if( weaponid >= 22 && weaponid <= 24 )
- {
- Weapons[playerid][Pistols] = weaponid;
- GivePlayerWeapon(playerid, weaponid, ammo);
- return 1;
- }
- if( weaponid >= 25 && weaponid <= 27 )
- {
- Weapons[playerid][Shotguns] = weaponid;
- GivePlayerWeapon(playerid, weaponid, ammo);
- return 1;
- }
- if( weaponid == 28 || weaponid == 29 || weaponid == 32 )
- {
- Weapons[playerid][SubMachine] = weaponid;
- GivePlayerWeapon(playerid, weaponid, ammo);
- return 1;
- }
- if( weaponid == 30 || weaponid == 31 )
- {
- Weapons[playerid][Assault] = weaponid;
- GivePlayerWeapon(playerid, weaponid, ammo);
- return 1;
- }
- if( weaponid == 33 || weaponid == 34 )
- {
- Weapons[playerid][Rifles] = weaponid;
- GivePlayerWeapon(playerid, weaponid, ammo);
- return 1;
- }
- if( weaponid >= 35 && weaponid <= 38 )
- {
- Weapons[playerid][Heavy] = weaponid;
- GivePlayerWeapon(playerid, weaponid, ammo);
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment