Makeadmin and dialogs
#1

Код:
new AdminKod[MAX_PLAYERS], 
    AdminLogovan[MAX_PLAYERS]; 

GiveAdminCode(playerid) { //When promoting, use 
    new rr = randomEx(1000,999999); 
    new string[128]; 
    format(string,sizeof(string),"Your admin code is %i",rr); 
    SendClientMessage(playerid,COLOR_RED,string); 
    AdminKod[playerid] = rr; 
    return true; 
} 


CMD:login(playerid,params[]) { //how to login as administrator 
    new nmr; 
    if(sscanf(params,"i",nmr)) return SendClientMessage(playerid,COLOR_RED,"Usage: /login [admin code]"); 
    if(nmr != AdminKod[playerid]) return SendClientMessage(playerid,COLOR_RED,"Wrong admin code"); 
    AdminLogovan[playerid] = 1; //admin logged in  
    SendClientMessage(playerid,COLOR_RED,"You have logged in as administrator!"); 
    return true; 
} 

CMD:makeadmin(playerid, params[]) //credits Cody 
{ 
    if(PlayerInfo[playerid][pAdmin] < 7) 
        return SendClientMessage(playerid, COLOR_BLUE, "You don't have acces to that command."); 

    new id, string[128], level; 
    if(sscanf(params, "dd", id, level)) 
        return SendClientMessage(playerid, COLOR_RED, "SERVER: /makeadmin [ID] [LEVEL]"); 

    //ShowPlayerDialog(id,DIALOG_ADMINBOX,DIALOG_STYLE_MSGBOX, "You are an admin", string, "Ok", ""); 
    format(string, sizeof(string), "%s promoted you to level %i.", PlayerName(playerid), level); 
    SendClientMessage(id, COLOR_BLUE, string); 
    PlayerInfo[id][pAdmin] = level; 
    GiveAdminCode(id); //Giving them a code 
    return 1; 
}
this is my admin cmd but i want to make when i give someone admin to show him in one dialog who make him admin , level and give him security code..and when he relog to must writte code in dialog
Reply


Messages In This Thread
Makeadmin and dialogs - by Deny1 - 27.01.2016, 17:52
Re: Makeadmin and dialogs - by Deny1 - 27.01.2016, 18:31
Re: Makeadmin and dialogs - by itsCody - 27.01.2016, 18:38
Re: Makeadmin and dialogs - by Deny1 - 27.01.2016, 18:44
Re: Makeadmin and dialogs - by Deny1 - 27.01.2016, 18:47
Re: Makeadmin and dialogs - by Deny1 - 27.01.2016, 18:52
Re: Makeadmin and dialogs - by itsCody - 27.01.2016, 19:02

Forum Jump:


Users browsing this thread: 1 Guest(s)