/admins in Dialog List
#1

Hy

Pls help me on /admins how to create on dialog i'm easy scripter :/ (sry for my bad english)

dcmd_admins(playerid,params[])
{
#pragma unused params
new count = 0;
new string[128];
new ChangeColor;
SendClientMessage(playerid, green, " ");
SendClientMessage(playerid, green, "___________ |- Online Adminok -| ___________");
SendClientMessage(playerid, green, " ");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(AccInfo[i][Level] >= 1 && AccInfo[i][Hide] == 0)
{
if(AccInfo[i][Level] > 5)
{
AdmRank = "Professional Admin";
ChangeColor = Color_Professional_Admin;
}
if(IsPlayerAdmin(i))
{
AdmRank = "RCON Adminisztrбtor";
ChangeColor = Color_RCON_Administrator;
}
else
{
switch(AccInfo[i][Level])
{
case 1: {
AdmRank = "Kezdő Moderбtor";
ChangeColor = Color_Basic_Moderator;
}
case 2: {
AdmRank = "Moderбtor";
ChangeColor = Color_Moderator;
}
case 3: {
AdmRank = "Mester Moderбtor";
ChangeColor = Color_Master_Moderator;
}
case 4: {
AdmRank = "Adminisztrбtor";
ChangeColor = Color_Administrator;
}
case 5: {
AdmRank = "Mester Adminisztrбtor";
ChangeColor = Color_Master_Administrator;
}
}
}
switch(AccInfo[i][OnDuty])
{
case 0: AdmDuty = "Jбtйk!";
case 1: AdmDuty = "On Duty!";
}
format(string, 128, "Szint: %d - %s (Id:%i) | %s | %s",AccInfo[i][Level], PlayerName2(i),i,AdmRank,AdmDuty);
SendClientMessage(playerid, ChangeColor, string);
count++;
}
}
}
if (count == 0)
SendClientMessage(playerid,red,"Nincs Admin a Szerveren!");
SendClientMessage(playerid, green, " _______________________________________");
return 1;
}
Reply
#2

Assuming "AdmRank" is declared as global string and removing the colors:
PHP код:
dcmd_admins(playeridparams[])
{
    
#pragma unused params
    
new countstring[512];
    
    for (new 
0MAX_PLAYERSi++) if (IsPlayerConnected(i)) // foreach(new i : Player)
    
{
        if (!
AccInfo[i][Hide])
        {
            switch (
AccInfo[i][Level])
            {
                case 
0: continue;
                case 
1AdmRank "Kezdő Moderбtor";
                case 
2AdmRank "Moderбtor";
                case 
3AdmRank "Mester Moderбtor";
                case 
4AdmRank "Adminisztrбtor";
                case 
5AdmRank "Mester Adminisztrбtor";
                default:
                {
                    if (
IsPlayerAdmin(i)) AdmRank "RCON Adminisztrбtor";
                    else 
AdmRank "Professional Admin";
                }
            }
            
format(stringsizeof (string), "%sSzint: %d - %s (Id:%i) | %s | %s"stringAccInfo[i][Level], PlayerName2(i), iAdmRank, (!AccInfo[i][OnDuty]) ? ("Jбtйk!") : ("On Duty!"));
            
count++;
        }
    }
    if (!
countSendClientMessage(playeridred"Nincs Admin a Szerveren!");
    else 
ShowPlayerDialog(playerid285DIALOG_STYLE_MSGBOX"___________ |- Online Adminok -| ___________"string"Close""");
    return 
1;

Reply
#3

thanks :3
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)