Quote:
Originally Posted by AhmedMohamed
another error:
pawn Код:
totalonduty = totalonduty+1;
make it
because X never equal X + 1
|
Yeah, that is the way I had it before. But it doesn't change the error.
Quote:
Originally Posted by AhmedMohamed
but I am not sure
pawn Код:
CMD:onduty(playerid, params[]) { SendClientMessage(playerid, COLOR_LIGHTSALMON, "____________Admins_On_Duty____________"); new totalonduty = 0; for(new i = 0; i < MAX_PLAYERS+1; i++) { if(pInfo[i][Admin] > 1){ if(aduty[i] == 1) { totalonduty = totalonduty+1; new aname[MAX_PLAYER_NAME]; new alevel = pInfo[i][Admin]; new line[128]; GetPlayerName(i, aname, MAX_PLAYER_NAME); format(line, sizeof(line), "%s: Level %i Admin", aname, alevel); SendClientMessage(playerid, COLOR_LIGHTSALMON, line); } } } } if(totalonduty == 0){ SendClientMessage(playerid, COLOR_RED, "There are no admins on duty."); } SendClientMessage(playerid, COLOR_RED, "_________________________________________"); return 1;
}
I think the problem is here :
I made it
pawn Код:
if(aduty[i] == 1) { //here is the content }
|
That code that you changed was what that other guy sent. The way you have it is how I had it orginally, except it was more like
because aduty isn't set to 1 when they are on duty, and 0 when they are off duty, they are set to True and False.