03.12.2011, 01:45
(
Last edited by Tanush123; 26/06/2013 at 03:29 PM.
)
How to make a simple anti weapon detector
Hello everyone, i will teach you in this tutorial how to make a simple anti weapon hack. You don't need any timers or anything, in this tutorial i will only use pawn Code:
public OnPlayerUpdate(playerid)
pawn Code:
new weaponid = GetPlayerWeapon(playerid);
new Nam[MAX_PLAYER_NAME];
new str[128];
pawn Code:
public OnPlayerUpdate(playerid)
{
new weaponid = GetPlayerWeapon(playerid);//This will cause the "weaponid not defined" Error
new Nam[MAX_PLAYER_NAME];
new str[128];
if(weaponid == 16) // The weapon ID
{
GetPlayerName(playerid,Nam,sizeof(Nam));
format(str,sizeof(str),"ANTI WEAPON HACK: %s has been banned from server for spawning a bad weapon!",Nam);
SendClientMessageToAll(0xFF0000FF,str);
BanEx(playerid,"ANTI WEAPON HACK: Weapon Hack!");
}
return 1;
}
pawn Code:
if(weaponid == 16) // The weapon ID
So if you wondering how to add another weapon just do this
pawn Code:
public OnPlayerUpdate(playerid)
{
new weaponid = GetPlayerWeapon(playerid);//This will cause the "weaponid not defined" Error
new Nam[MAX_PLAYER_NAME];
new str[128];
if(weaponid == 16) // The weapon ID
{
GetPlayerName(playerid,Nam,sizeof(Nam));
format(str,sizeof(str),"ANTI WEAPON HACK: %s has been banned from server for spawning a bad weapon!",Nam);
SendClientMessageToAll(0xFF0000FF,str);// Sends message to everyone
BanEx(playerid,"ANTI WEAPON HACK: Weapon Hack!");
}
//make another line
if(weaponid == WEAPONID) // The weapon ID
{
GetPlayerName(playerid,Nam,sizeof(Nam));
format(str,sizeof(str),"ANTI WEAPON HACK: %s has been banned from server for spawning a bad weapon!",Nam);
SendClientMessageToAll(0xFF0000FF,str);// Sends message to everyone
BanEx(playerid,"ANTI WEAPON HACK: Weapon Hack!");
}
return 1;
}
pawn Code:
if(weaponid == WEAPONID) // The weapon ID
Weapon ID'S: http://weedarr.wikidot.com/gunlist
Thank you for reading, if you have any other question just ask below.