Help - Dialog
#2

PHP код:
new makeAdminID[MAX_PLAYERS] = {-1,...};//Global
//OnPlayerConnect:
makeAdminID[playerid] = -1;
CMD:makeadmin(playerid,params[])
{
    if(
gPlayerLogged[playerid] == 0)return SendClientMessage(playerid,COLOR_LIGHTRED,"You need to login first.");
    if(
PlayerInfo[playerid][pAdmin] >= 6)
    {
        new 
id;
        if(
sscanf(params,"u",id))return SendClientMessage(playerid,0xFFFFFFFF,"{B8DBFF}Syntax: /makeadmin <Name/playerid>");
        if(!
IsPlayerConnected(id))return SendClientMessage(playeridCOLOR_WHITE"{FFFFCC}Error: Player not connected.");
        
makeAdminID[playerid] = id;
        
ShowPlayerDialog(playerid,DIALOG_ADMINRANKS,DIALOG_STYLE_LIST,"Admin Ranks","Admin Level 1\nAdmin Level 2\nAdmin Level 3","Next","Close");
    }
    return 
1;
}
//OnDialogResponse:
if(dialogid == DIALOG_ADMINSRANKS)
{
    if(
response)
    {
        new 
id makeAdminID[playerid];
        switch(
listitem)
        {
            case 
0:
            {
                
//Admin Level 1
                
PlayerInfo[id][pAdmin] = 1;
                return 
1;
            }
            case 
1:
            {
                
//Admin Level 2
                
PlayerInfo[id][pAdmin] = 2;
                return 
1;
            }
        }
    }
    return 
1;

Reply


Messages In This Thread
Help - Dialog - by Hazliu - 01.09.2015, 09:56
Re: Help - Dialog - by MarvinPWN - 01.09.2015, 10:02
Re: Help - Dialog - by Hazliu - 01.09.2015, 11:05
Re: Help - Dialog - by MarvinPWN - 01.09.2015, 11:10

Forum Jump:


Users browsing this thread: 1 Guest(s)