Use Cases, ex:
PHP код:
switch(PlayerInfo[playerid][pAdmin])
{
case 2:
{
new string[159], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string),""green""COL_GREEN"You have been auto loggedin!\nName %s\nTrial Admin\nScore: %i\nDeaths: %i\nKills: %i\nPassword: %s",name, PlayerInfo[playerid][pScore], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pPass]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",string,"Ok","");
}
case 3:
{
new string[159], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string),""green""COL_GREEN"You have been auto loggedin!\nName %s\nTrial Admin\nScore: %i\nDeaths: %i\nKills: %i\nPassword: %s",name, PlayerInfo[playerid][pScore], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pPass]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",string,"Ok","");
}
Small code from my login/register script.
Switch(PlayerInfo[playerid][pAdmin])
PHP код:
case 2:
{
new string[159], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string),""green""COL_GREEN"You have been auto loggedin!\nName %s\nTrial Admin\nScore: %i\nDeaths: %i\nKills: %i\nPassword: %s",name, PlayerInfo[playerid][pScore], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pPass]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",string,"Ok","");
Ok so "case 2:" Means if PlayerInfo[playerid][pAdmin] equals the number 2.
PlayerInfo[playerid][pAdmin] = My admin variable.
So if I use "case 10:" it means that if PlayerInfo[playerid][pAdmin] equals the number 10 which is the Main Owner level, so let's make a dialog that says that he is the Main Owner on login.
PHP код:
switch(PlayerInfo[playerid][pAdmin])
{
case 10:
{
new string[159], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string),""green""COL_GREEN"You have been auto loggedin!\nName %s\nMain Owner\nScore: %i\nDeaths: %i\nKills: %i",name, PlayerInfo[playerid][pScore], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pKills]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",string,"Ok","");
}
}