20.01.2013, 18:26
When you view the dialog, it shows the admin rank and if they're on duty or not, but it doesn't show their name and leaves a blank space there. Can someone help me fix this issue?
PHP код:
case 2:
{
new name[MAX_PLAYER_NAME],string[250],admin[20],duty[20];
new count = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] < 1) continue;
switch(PlayerInfo[i][pAdmin])
{
case 1: admin = "Moderator";
case 2: admin = "Administrator";
case 3: admin = "Head Administrator";
}
if(PlayerInfo[i][pDuty] == 0)
{
duty = "{FF0000}Off duty.";
}
else if(PlayerInfo[i][pDuty] == 1)
{
duty = "{007F0E}On duty!";
}
if(count == 0)
{
format(string,sizeof(string),"{FF7FB6}%s {A9C4E4}%s is %s\n",admin,name,duty);
} // Not showing the player's name
else
{
format(string,sizeof(string),"%s{FF7FB6}%s {A9C4E4}%s is %s\n",string,admin,name,duty);
}
count++;
}
if(count == 0)
{
format(string,sizeof(string),"There's no members of the staff team online.");
}
}
ShowPlayerDialog(playerid,6,DIALOG_STYLE_MSGBOX,"Staff Team", string, "Close", "");