04.10.2012, 20:02
It keeps saying I am off duty...
And to turn on/off adminduty:
Код:
COMMAND:admins(playerid, params[]) { if(IsPlayerLogged[playerid] == 1) { for(new i = 0; i <MAX_PLAYERS; i++) { if(PlayerInfo[i][pAdmin] >= 3) { SendClientMessage(playerid,COLOR_IORANGE, "online administrators"); new aname[24],astring[124]; GetPlayerName(playerid,aname,sizeof(aname)); if(AdminDuty[i] == 1) { format(astring,sizeof(astring),"%s %s - Onduty",adminlevel(playerid), aname); SendClientMessage(playerid,IGREEN,astring); return 1; } else { format(astring,sizeof(astring),"%s %s - Offduty",adminlevel(playerid), aname); SendClientMessage(playerid,GRAY,astring); return 1; } } else SendClientMessage(playerid, YELLOW, "No admins available!"); return 1; } } else SendClientMessage(playerid, RED, "You're not logged in!"); return 1; }
Код:
COMMAND:adminduty(playerid, params[]) { if(IsPlayerLogged[playerid] == 1) { if(PlayerInfo[playerid][pAdmin] >= 3) { if(AdminDuty[playerid] == 1) { AdminDuty[playerid] = 0; SendClientMessage(playerid, IYELLOW, "You are now off adminduty."); SetPlayerColor(playerid, 0xFFFFFFFF); return 1; } else { AdminDuty[playerid] = 1; SendClientMessage(playerid, IGREEN, "You are now on adminduty!"); SetPlayerColor(playerid, ORANGE); } return 1; } else SendClientMessage(playerid, COLOR_RED, "You are not authorized!"); } else SendClientMessage(playerid, COLOR_RED, "You're not logged in!"); return 1; }