SA-MP Forums Archive
Makeadmin and dialogs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Makeadmin and dialogs (/showthread.php?tid=599568)



Makeadmin and dialogs - Deny1 - 27.01.2016

Код:
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


Re: Makeadmin and dialogs - Deny1 - 27.01.2016

someone please?


Re: Makeadmin and dialogs - itsCody - 27.01.2016

Check your other thread.
https://sampforum.blast.hk/showthread.php?pid=3648065#pid3648065


Re: Makeadmin and dialogs - Deny1 - 27.01.2016

itsCody it doesnt work i try..


Re: Makeadmin and dialogs - Deny1 - 27.01.2016

Quote:

[data]
Location = 0
Skin = 20
Sex = 0
Age = 18
AdminKod = 0
Cash = 0
Password = 19726487
Deaths = 0
Kills = 0
Admin = 7

Look at admin kod


Re: Makeadmin and dialogs - Deny1 - 27.01.2016

Thanks you are the best <3 its work


Re: Makeadmin and dialogs - itsCody - 27.01.2016

AdminKod is a string, not an int.
Save it as a string, load it as a string.