21.12.2015, 21:35
Better do something like this
UNTESTED
PHP код:
stock GetAdminLevel(playerid) {
new Rank[24];
switch(playerVariables[playerid][pAdminLevel]) {
case 1: "Level 1"; //change to what admin rank u want to call it
case 2: "Level 2";
case 3: "Level 3";
case 4: "Level 4";
case 5: "Level 5";
case 6: "Level 6";
case 7: "Level 7";
}
return Rank;
}
CMD:admins(playerid,params[])
{
new string[128],sendername[MAX_PLAYER_NAME],count;
foreach(Player,i) {
if(IsPlayerConnected(i)) {
format(string,sizeof(string),"Name: %s -- Rank: %s",GetAdminLevel(i),sendername);
count++;
SendClientMessage(playerid,COLOR_WHITE,string);
}
}
if(count == 0) return SendClientMessage(playerid,COLOR_RED,"There are no admins online");
else if(count >= 1) {
format(string,sizeof(string),"There are %i admins online",count);
SendClientMessage(playerid,COLOR_RED,string);
SendClientMessage(playerid, COLOR_TEAL, "----------------------------------------------------------------------------");
SendClientMessage(playerid, COLOR_WHITE, "Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
SendClientMessage(playerid, COLOR_TEAL, "----------------------------------------------------------------------------");
}
return true;
}