26.04.2014, 22:30
Why does my script return this if no one is on duty?
And if there is a user on duty
pawn Код:
____________Admins_On_Duty____________
Unknown Command
pawn Код:
____________Admins_On_Duty____________
User_Name: Level 7 Admin
Unknown Command
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]){
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;
}