How to make a simple anti weapon detector -
Tanush123 - 03.12.2011
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)
and 3 defined items
pawn Code:
new weaponid = GetPlayerWeapon(playerid);
new Nam[MAX_PLAYER_NAME];
new str[128];
Ok everyone under OnPlayerUpdate if you want to add a bad list weapon just add 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);
BanEx(playerid,"ANTI WEAPON HACK: Weapon Hack!");
}
return 1;
}
This code above will ban people that spawns a gernade and i will tell why. On the line
pawn Code:
if(weaponid == 16) // The weapon ID
The number i add "16" is the weapon id of Gernade, check
http://weedarr.wikidot.com/gunlist.
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;
}
on
pawn Code:
if(weaponid == WEAPONID) // The weapon ID
just replace the "WEAPON ID" to the weapon id you want to keep that is bad. The links are below for weapon list if you need help
Weapon ID'S:
http://weedarr.wikidot.com/gunlist
Thank you for reading, if you have any other question just ask below.
Re: How to make a simple anti weapon hack -
PjFord - 03.12.2011
Nice job Tan
Re: How to make a simple anti weapon hack -
Tanush123 - 03.12.2011
Ty pj ford
AW: How to make a simple anti weapon hack -
Bosnian - 03.12.2011
o.o
I dont get it... You just add from the one cod e to the other 10 fucking new things
Re: How to make a simple anti weapon hack -
ZzzzZ - 03.12.2011
Very good tutorial
Re: AW: How to make a simple anti weapon hack -
Tanush123 - 03.12.2011
Quote:
Originally Posted by Bosnian
o.o
I dont get it... You just add from the one cod e to the other 10 fucking new things
|
Lol what do you exactly mean?
Quote:
Originally Posted by ZzzzZ
Very good tutorial ![Smiley](images/smilies/smile.png)
|
Thank you
Re: How to make a simple anti weapon hack -
Wesley221 - 03.12.2011
There is an easier way of checking for different weapons instead of copy pasting it like 5 times
Ex:
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 || weaponid == WEAPONID || weaponid == WEAPONID2 /* etc etc */) // 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;
}
Re: How to make a simple anti weapon hack -
SmiT - 03.12.2011
https://sampforum.blast.hk/showthread.php?tid=65567
Re: How to make a simple anti weapon hack -
Tanush123 - 03.12.2011
Quote:
Originally Posted by Wesley221
There is an easier way of checking for different weapons instead of copy pasting it like 5 times
Ex:
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 || weaponid == WEAPONID || weaponid == WEAPONID2 /* etc etc */) // 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; }
|
Oh my bad wesley, i forgot about that.
Re: How to make a simple anti weapon hack -
Rob_Maate - 04.12.2011
This isn't an anti-weaponhack...
This just bans a player if he has a certain weapon.
What if I decide to hack a desert eagle? hows your script gonna detect that?
Re: How to make a simple anti weapon hack -
Tanush123 - 04.12.2011
Quote:
Originally Posted by Rob_Maate
This isn't an anti-weaponhack...
This just bans a player if he has a certain weapon.
What if I decide to hack a desert eagle? hows your script gonna detect that?
|
Just add the weapon id?
Re: How to make a simple anti weapon hack -
PjFord - 14.12.2011
he's right. you should put something to tell how much ammo they have, so if they have like, 9999+ ammo they'll get banned. and if you had deagle to the weapon id list then NOBODY can have a deagle without getting banned.
Re: How to make a simple anti weapon hack -
Tanush123 - 15.12.2011
Quote:
Originally Posted by PjFord
he's right. you should put something to tell how much ammo they have, so if they have like, 9999+ ammo they'll get banned. and if you had deagle to the weapon id list then NOBODY can have a deagle without getting banned.
|
Lol this will ban people if they have the gun in their HAND
Re: How to make a simple anti weapon hack -
PjFord - 15.12.2011
Yes Tan, meaning if you go to a store and buy it then you will get banned -_-
Re: How to make a simple anti weapon hack -
Tanush123 - 15.12.2011
Pj Ford, Why would someone add a bad weapon while they could buy that weapon at ammunation. Maybe they could disable the TEleports to ammu and do some next thing
Re: How to make a simple anti weapon hack -
PjFord - 15.12.2011
That's not what im saying. im saying let's say you blacklist minigun, rpg etc. but deagle isn't blacklisted. what if the hacker doesn't want to buy the ammo so he gives himself 9999 ammo. it wont ban him because deagle isn't blacklisted -_- and if you blacklist it, then anyone who buys one or gets one in their hand somehow will get banned.
AW: How to make a simple anti weapon hack -
BigETI - 15.12.2011
There is kinda a more accurate way how to write anticheats. Some months ago I've released an include, which calls callbacks, if the player is changed his/her holding weapons, weapon/ammo per slot, also weapon state, money, health, armour etc.
It could be very usefull at scripting accurate anticheats
Re: How to make a simple anti weapon hack -
Dragony92 - 15.12.2011
They still can buy gun with 1 ammo and make hundreds of them with cheat engine...
Re: How to make a simple anti weapon hack -
hustrine - 18.12.2011
Nice job.
Re: How to make a simple anti weapon hack -
Unknownich - 18.12.2011
Good,but is better to put timer, OnPlayerUpdate will cause lagg