PDA

View Full Version : armour hack anti cheat ain't working.


jueix
25/08/2012, 07:31 PM
Ok so i havn't scripted in a while and encountered a new problem in my server when coding.

Here is my code.

forward ahack1(playerid);
public ahack1(playerid)
{
new Float:armour;
armour = GetPlayerArmour(playerid, armour);
if(armour > 1 && PlayerInfo[playerid][pAllowedArmour] < 1)
{
new string[200];
format(string,sizeof(string),"You appear to be armour hacking reseting armour");
new string1[200];
new pname[MAX_PLAYER_NAME]; //the name of player two (the reported)
GetPlayerName(playerid,pname,sizeof(pname)); //get (receive) the player's name for the first
format(string1,sizeof(string1),"%s appear's to be armour hacking [Dosn't have armour rights]",pname);
GameTextForPlayer(playerid, string, 1000, 0);
SendMessageToAdmins(COLOR_WHITE,string1); //we'll talk about that later
SetPlayerArmour(playerid, 0);
}
return 1;
}


Ok so if a player has more than 1 armour and if not allowed is less than 1 its ment to do that script but it isn't. If i chane the line from this if(armour > 1 && PlayerInfo[playerid][pAllowedArmour] < 1) //and his level gotta be at least 1 (or higher) to this if(armour > 0 && PlayerInfo[playerid][pAllowedArmour] < 1) //and his level gotta be at least 1 (or higher) it spams the server. But if its the first one it dosn't do what its ment to.

ikkentim
26/08/2012, 01:06 AM
When are you modifying PlayerInfo[playerid][pAllowedArmour] ?

Also,
Try this
if(armour > PlayerInfo[playerid][pAllowedArmour] +5) //+5 is optional for lag compensation

Dragony92
26/08/2012, 01:16 AM
Check this out... http://forum.sa-mp.com/showthread.php?t=220089