27.01.2013, 16:45
How to put it on a admin list /admins /adminduty type /admins it say
Admin online:
Test: is now on duty Owner-Admin
i wanna it to show on /admins
my code:
Admin online:
Test: is now on duty Owner-Admin
i wanna it to show on /admins
my code:
Код:
COMMAND:admins(playerid, params[]) { // Send the command to all admins so they can see it SendAdminText(playerid, "/admins", params); new str[128],name[MAX_PLAYER_NAME]; SendClientMessage(playerid, 0xFFFFFFAA, "Admins Online:"); for(new i; i<=MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if (APlayerData[i][PlayerLevel] >= 1) { GetPlayerName(i,name,sizeof(name)); format(str, sizeof(str), "%s[%d] Level:%d",name, i,APlayerData[i][PlayerLevel]); format(str, sizeof(str), "%s: %s%s %s %i\n", name, AdminLevelName[APlayerData[i][PlayerLevel]], i, APlayerData[i][PlayerLevel]); // Add the name of the admin-player to the list SendClientMessage(playerid, 0xFFFFFFAA, str); } else return SendClientMessage(playerid,0xFF0000FF,"No Admin Online"); } } return 1; }
Код:
new bool:IsOnAdminDuty[MAX_PLAYERS] = false; CMD:adminduty(playerid,params[]) // Onduty { if (APlayerData[playerid][PlayerLevel] >= 1) if(IsOnAdminDuty[playerid] == false) { IsOnAdminDuty[playerid] = true; new pname[24],dstring[124]; GetPlayerName(playerid,pname,sizeof(pname)); format(dstring,sizeof(dstring),"Admin %s is now on duty.",pname); SendClientMessageToAll(-1,dstring); SetPlayerHealth(playerid,99999); } return 1; }
Код:
CMD:adminoffduty(playerid,params[]) // Off duty { if (APlayerData[playerid][PlayerLevel] >= 1) if(IsOnAdminDuty[playerid] == true) { IsOnAdminDuty[playerid] = false; new name[24],ostring[124]; GetPlayerName(playerid,name,sizeof(name)); format(ostring,sizeof(ostring),"Admin %s is now off duty.",name); SendClientMessageToAll(-1,ostring); SetPlayerHealth(playerid,100); } return 1; }