25.08.2012, 19:31
Ok so i havn't scripted in a while and encountered a new problem in my server when coding.
Here is my code.
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.
Here is my code.
pawn Код:
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;
}