Admin Warning System help
#2

Код:
if(PlayerInfo[playerid][pAdmin]  < 2) {
	
	    PlayerInfo[playerid][pAdminWarns] = PlayerInfo[playerid][pAdminWarns] + 1;
	    format(string, sizeof(string), "AdmWarning: %s has warned admin %s (Warn: #%d)", GetOOCName(playerid), GetOOCName(targetid), PlayerInfo[targetid][pAdminWarns]);
	    SendMessageToAdmins(COLOR_RED, string, 1);
	    printf("AdmWarning: %s has warned admin %s (Warn: #%d)", GetOOCName(playerid), GetOOCName(targetid), PlayerInfo[targetid][pAdminWarns]);
	    return 1;
	}
	else if(PlayerInfo[targetid][pAdminWarns] == 2)
	{
	    PlayerInfo[targetid][pAdminWarns] = 0;
	    PlayerInfo[targetid][pAdmin] = PlayerInfo[playerid][pAdmin] - 1;
	    format(string, sizeof(string), "AdmWarning: %s has been demoted by 1 level by SYSTEM because he had gathered 3 admin warnings!", GetOOCName(targetid));
	    SendMessageToAdmins(COLOR_RED, string, 1);
	    printf("AdmWarning: %s was demoted by 1 level by SYSTEM because he had had gathered 3 admin warnings", GetOOCName(targetid));
	    return 1;
	}
solution to problem 1...

You are actually checking if warns are greater than one and then checking for 2 so the condition of first one will be accomplished. So better use it like if its less than the limit you want
That might help.
.
Reply


Messages In This Thread
Admin Warning System help - by zork - 22.02.2015, 16:45
Re: Admin Warning System help - by -=Dar[K]Lord=- - 22.02.2015, 17:57
Re: Admin Warning System help - by zork - 22.02.2015, 18:11
Re: Admin Warning System help - by -=Dar[K]Lord=- - 23.02.2015, 00:05
Re: Admin Warning System help - by zork - 23.02.2015, 06:45

Forum Jump:


Users browsing this thread: 1 Guest(s)