15.07.2014, 10:24
Anti Hack/Cheat Weapon by VinPure
------------------------------------------------------------
Used: change GivePlayerWeapon to GivePlayerWeaponACIf player use Cleo or ****** Hack weapon -->Banned..
This very Simple i make it in some min's .. I hope you like it
Include : new samp callback :https://sampforum.blast.hk/showthread.php?tid=490436 by Emmet_.
ZCMD: for CMD test
Video:ComingSoon
CODE:
PHP Code:
//SIMPLE ANTI HACK WEAPON By VinPure
//Version 1
#include <a_samp>
#include <newsamp> //https://sampforum.blast.hk/showthread.php?tid=490436 by Emmet_
#include <zcmd>
enum wc
{
Weapon1,
Weapon2,
Weapon3,
Weapon4,
Weapon5,
Weapon6,
Weapon7,
Weapon8,
Weapon9,
Weapon10,
Weapon11,
Weapon12
}
new WeaponAnti[MAX_PLAYERS][wc];
///CMD TEST
CMD:hackweapon(playerid,params[])
{
GivePlayerWeapon(playerid,24,9999);
return 1;
}
CMD:weapon(playerid,params[])
{
GivePlayerWeaponAC(playerid,27,99999);
return 1;
}
//-----------------------------------
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerUpdate(playerid)
{
new weaponid = GetPlayerWeapon(playerid);
new weapon1 = WeaponAnti[playerid][Weapon1],
weapon2 =WeaponAnti[playerid][Weapon2],
weapon3 =WeaponAnti[playerid][Weapon3],
weapon4 =WeaponAnti[playerid][Weapon4],
weapon5 =WeaponAnti[playerid][Weapon5],
weapon6 =WeaponAnti[playerid][Weapon6],
weapon7 =WeaponAnti[playerid][Weapon7],
weapon8 =WeaponAnti[playerid][Weapon8],
weapon9 =WeaponAnti[playerid][Weapon9],
weapon10 =WeaponAnti[playerid][Weapon10],
weapon11 =WeaponAnti[playerid][Weapon11],
weapon12 =WeaponAnti[playerid][Weapon12];
new string[128];
switch(weaponid)
{
case 2..46:
{
if(weapon1 != weaponid&&weapon2 != weaponid&&weapon3 != weaponid&&weapon4 != weaponid&&weapon5 != weaponid&&weapon6 != weaponid&&weapon7 != weaponid&&weapon8!= weaponid&&weapon9 != weaponid&&weapon10 != weaponid&&weapon11 != weaponid&&weapon12 != weaponid)
{
//Player Hack Weapon
format(string,sizeof(string),"Player Id:%d has hack weapon id:%s",playerid,weaponid);
SendClientMessageToAll(-1,string);
RemovePlayerWeapon(playerid, weaponid);
//Or Banned Code
}
}
}
return 1;
}
public OnPlayerWeaponEmpty(playerid, weaponid)// new-samp callback
{
switch(weaponid)
{
case 2..9:
{
WeaponAnti[playerid][Weapon1] = 0;
}
case 10..15:
{
WeaponAnti[playerid][Weapon10] = 0;
}
case 16..18:
{
WeaponAnti[playerid][Weapon8] = 0;
}
case 22..24:
{
WeaponAnti[playerid][Weapon2] = 0;
}
case 25..27:
{
WeaponAnti[playerid][Weapon3] = 0;
}
case 28..29:
{
WeaponAnti[playerid][Weapon4] = 0;
}
case 30..31:
{
WeaponAnti[playerid][Weapon5] = 0;
}
case 32:
{
WeaponAnti[playerid][Weapon4] = 0;
}
case 33..34:
{
WeaponAnti[playerid][Weapon6] = 0;
}
case 35..38:
{
WeaponAnti[playerid][Weapon7] = 0;
}
case 41..42:
{
WeaponAnti[playerid][Weapon9] =0;
}
case 44..46:
{
WeaponAnti[playerid][Weapon11] = 0;
}
case 39:
{
WeaponAnti[playerid][Weapon8] = 0;
}
case 40:
{
WeaponAnti[playerid][Weapon12] = 0;
}
}
}
stock GivePlayerWeaponAC(playerid,weaponid,ammo)//change GivePlayerWeapon to GivePlayerWeaponAC to anti cheat
{
switch(weaponid)
{
case 2..9:
{
WeaponAnti[playerid][Weapon1] = weaponid;
}
case 10..15:
{
WeaponAnti[playerid][Weapon10] = weaponid;
}
case 16..18:
{
WeaponAnti[playerid][Weapon8] = weaponid;
}
case 22..24:
{
WeaponAnti[playerid][Weapon2] = weaponid;
}
case 25..27:
{
WeaponAnti[playerid][Weapon3] = weaponid;
}
case 28..29:
{
WeaponAnti[playerid][Weapon4] = weaponid;
}
case 30..31:
{
WeaponAnti[playerid][Weapon5] = weaponid;
}
case 32:
{
WeaponAnti[playerid][Weapon4] = weaponid;
}
case 33..34:
{
WeaponAnti[playerid][Weapon6] = weaponid;
}
case 35..38:
{
WeaponAnti[playerid][Weapon7] = weaponid;
}
case 41..42:
{
WeaponAnti[playerid][Weapon9] = weaponid;
}
case 44..46:
{
WeaponAnti[playerid][Weapon11] = weaponid;
}
case 39:
{
WeaponAnti[playerid][Weapon8] = weaponid;
}
case 40:
{
WeaponAnti[playerid][Weapon12] = weaponid;
}
}
GivePlayerWeapon(playerid,weaponid,ammo);
return 1;
}
stock RemovePlayerWeapon(playerid, weaponid)
{
if(!IsPlayerConnected(playerid) || weaponid < 0 || weaponid > 50)
return;
new saveweapon[13], saveammo[13];
for(new slot = 0; slot < 13; slot++)
GetPlayerWeaponData(playerid, slot, saveweapon[slot], saveammo[slot]);
ResetPlayerWeapons(playerid);
for(new slot; slot < 13; slot++)
{
if(saveweapon[slot] == weaponid || saveammo[slot] == 0)
continue;
GivePlayerWeapon(playerid, saveweapon[slot], saveammo[slot]);
}
GivePlayerWeapon(playerid, 0, 1);
}