31.01.2014, 09:21
I would like a script that when you type /staff shows the list of staff currently online.
Help me please I'm italian...
Help me please I'm italian...
CMD:staffonline(playerid, params[])
{
new string[125];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(i))
{
format(string, sizeof(string), "%s is currently an administrator.");
}
}
SendClientMessage(playerid, WHITE, string);
return 1;
}
#define DIALOG_STAFF 1 // top of your script
CMD:staff(playerid, params[])
{
new count, string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!(1 <= PlayerInfo[i][pAdmin] <= 4)) continue;
format(string, sizeof(string), "%s%i) %s[%i] (Level %i)\n", string, ++count, PlayerName(i), i, PlayerInfo[i][pAdmin]);
}
if(!count)
{
ShowPlayerDialog(playerid, DIALOG_STAFF, DIALOG_STYLE_MSGBOX, "Online Admins", "There are no admins online", "OK", "");
return 1;
}
else
ShowPlayerDialog(playerid, DIALOG_STAFF, DIALOG_STYLE_MSGBOX, "Online Admins", string, "OK", "");
return true;
}