GetPlayerAdminRank
#8

You were getting their Admin Rank before you were setting it.

This should resolve it all!

PHP код:
CMD:makeadmin(playerid,params[])
{
    new 
poruka[256],poruka2[650],poruka3[650],ID,level,randomiziraj random(99999);
    if(!
IsPlayerConnected(playerid)) return SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Niste se spojili na server");
    if(
pUlogiran[playerid] != 1) return SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Niste ulogirani na server.");
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Nemate dozvolu za tu komandu");
    if(
sscanf(params,"ud",ID,level)) return SendClientMessage(playerid,-1,"{FF0000}Koristenje:{FFFFFF} /makeadmin [ID/ime] [level]");
    {
        if(
level || level 5) return SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Dozvoljeni admin leveli za dodijelu: 0-5");
        if(
ID == playerid)
        {
            
PlayerInfo[playerid][pAdminKod] = randomiziraj;
            
PlayerInfo[playerid][pAdministrator] = level;
            
format(poruka,256,"{FF0000}[A-INFO]: %s {FFFFFF}%s je postavio sebe za administratora na levelu %d",GetPlayerAdminRank(playerid),GetName(playerid),level);
            
SendAdminMessage(-1,poruka);
            
format(poruka2,650,"{FFFFFF}Postavili ste se na administracijsku poziciju. Pozicija: %s.\nKao clan administracije prihvacate pravila napisana na nasoj forum stranici.\nCestitke na tituli od citave WG Administracije.Nadamo se da cete uspjesno ispunjvati svoju duznost.\n\n{FF0000}*{FFFFFF} Dolje navedeni kod zapisite negdje na papir ili u text dokument jer ce vam\npri svakom logiranju na server on biti potreban za ulazenje na racun:\n%d",GetPlayerAdminRank(playerid),randomiziraj);
            
ShowPlayerDialog(playerid,DIALOG_DEFAULT,DIALOG_STYLE_MSGBOX,"WG Administration",poruka2,"Uredu","");
            
printf("ADMIN: %s je postavio vlastiti admin level na %d",GetName(playerid),level);
            
            new 
INI:UFile INI_Open(UserPath(ID));
            
INI_SetTag(UFile,"Podatci");
            
INI_WriteInt(UFile,"pAdminKod",PlayerInfo[ID][pAdminKod]);
            
INI_Close(UFile);
        }
        else
        {
            
PlayerInfo[ID][pAdminKod] = randomiziraj;
            
PlayerInfo[ID][pAdministrator] = level;
            
format(poruka,256,"{0080FF}WG{FFFFFF}: %s {FFFFFF}%s vas je postavio za administratora na levelu %d. Cestitamo!",GetPlayerAdminRank(playerid),GetName(playerid),level);
            
SendClientMessage(ID,-1,poruka);
            
format(poruka3,650,"{FFFFFF}Postavljeni ste na administraciju poziciju od strane vlasnika. Pozicija: %s.\nKao clan administracije prihvacate pravila napisana na nasoj forum stranici.\nCestitke na tituli od citave WG Administracije.Nadamo se da cete uspjesno ispunjvati svoju duznost.\n\n{FF0000}*{FFFFFF} Dolje navedeni kod zapisite negdje na papir ili u text dokument jer ce vam\npri svakom logiranju na server on biti potreban za ulazenje na racun:\n%d",GetPlayerAdminRank(level),randomiziraj);
            
ShowPlayerDialog(ID,DIALOG_DEFAULT2,DIALOG_STYLE_MSGBOX,"WG Administration",poruka3,"Uredu","");
            
format(poruka,256,"{0080FF}WG{FFFFFF}: Postavili ste %sa za administratora na levelu %d",GetName(ID),level);
            
SendClientMessage(playerid,-1,poruka);
            
format(poruka,256,"{FF0000}[A-INFO]: %s {FFFFFF}%s je postavio %su administratora na levelu %d",GetPlayerAdminRank(playerid),GetName(playerid),GetName(ID),level);
            
SendAdminMessage(-1,poruka);
            
printf("ADMIN: %s je postavio %s za administratora na levelu %d",GetName(playerid),GetName(ID),level);
            
            new 
INI:UFile INI_Open(UserPath(ID));
            
INI_SetTag(UFile,"Podatci");
            
INI_WriteInt(UFile,"pAdminKod",PlayerInfo[ID][pAdminKod]);
            
INI_Close(UFile);
        }
     }
    return 
1;

EDIT: Un commencted the lines.
Reply


Messages In This Thread
GetPlayerAdminRank - by NoDi522 - 13.12.2015, 16:57
Re: GetPlayerAdminRank - by ATGOggy - 13.12.2015, 17:04
Re: GetPlayerAdminRank - by TwinkiDaBoss - 13.12.2015, 17:13
Re: GetPlayerAdminRank - by NoDi522 - 13.12.2015, 17:20
Re: GetPlayerAdminRank - by NoDi522 - 13.12.2015, 17:24
Re: GetPlayerAdminRank - by TwinkiDaBoss - 13.12.2015, 17:27
Re: GetPlayerAdminRank - by NoDi522 - 13.12.2015, 17:35
Re: GetPlayerAdminRank - by TwinkiDaBoss - 13.12.2015, 17:41
Re: GetPlayerAdminRank - by Sjn - 13.12.2015, 17:42
Re: GetPlayerAdminRank - by TwinkiDaBoss - 13.12.2015, 17:47

Forum Jump:


Users browsing this thread: 1 Guest(s)