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
#2

someone please?
Reply
#3

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

itsCody it doesnt work i try..
Reply
#5

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
Reply
#6

Thanks you are the best <3 its work
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)