WeaponHackBan
#1

Hey guys,

after i tried to code an anti weaponhack check/ban, i failed , but the problem is, i don't know where is the mistake.

pawn Код:
foward WeaponCheck(playerid);
public WeaponCheck(playerid)
{
    new weapons;
    weapons = GetPlayerWeapon(playerid);
    if(weapons == 38,44,45,43,42,41,40,39,37,36,35,17 && acheck[playerid] == 0 && spawned[playerid] == 1)
    {
        new string[128],name[24];
         GetPlayerName(playerid,name,24);
        format(string,128,"[BANN] %s wurde automatisch vom Server gebannt. (Grund: Weaponhack)",name);
        new string1[128];
        format(string1,128,"[BAN] %s was automatically banned from the server. (Reason: Weaponhack)",name);
        LangMessageToAll(THIAZ_RED,string,string1);
        Ban(playerid);
    }
}
The script bans me, but i have only weaponids 26(Sawnoff),28(Uzi),24(Deagle)



it'd be nice if someone could help me, thanks...thiaZ_
Reply
#2

if you're shure that the acheck and spawned functions are correct try this:


Код:
foward WeaponCheck(playerid);
public WeaponCheck(playerid)
{
	new weapons;
	weapons = GetPlayerWeapon(playerid);
	if(acheck[playerid] == 0 && spawned[playerid] == 1)
	{
		switch(weapons)
		{
			case 38, 44, 45, 43, 42, 41, 40, 39, 37, 36, 35, 17:
			{
				new string[128],name[24];
				GetPlayerName(playerid,name,24);
				format(string,128,"[BANN] %s wurde automatisch vom Server gebannt. (Grund: Weaponhack)",name);
		 		new string1[128];
	 			format(string1,128,"[BAN] %s was automatically banned from the server. (Reason: Weaponhack)",name);
	 			LangMessageToAll(THIAZ_RED,string,string1);
				Ban(playerid);
			}
		}
 	}
}
Reply
#3

acheck is to detect if the player in a deathmatch arena and spawned is to detect if the player is spawned, but thanks it works...
Reply
#4

First, it is forward, not foward.
Reply
#5

Quote:
Originally Posted by Jakku
First, it is forward, not foward.
right, didn't see that one either
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)