/admins help! [ REP + ]
#1

How can i like send a message, if there is no admin online?

Код:
CMD:admins(playerid, params[])
{
 new string[128];
 new str[128];
 new Admin[50];
 if(PlayerInfo[playerid][pAdmin] == 1) Admin = "Administrбtor";
 if(PlayerInfo[playerid][pAdmin] == 2) Admin = "Globбlnн Administrбtor";
 if(PlayerInfo[playerid][pAdmin] == 3) Admin = "Hlavnн Administrбtor";
 if(PlayerInfo[playerid][pAdmin] == 4) Admin = "Zakladatel";
 foreach (new i : Player)
 {
     if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] > 0)
     {
         format(str, sizeof(str), "{FFFFFF}%s -> %s\n", GetName(i), Admin);
         strcat(string, str);
         ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "Online Administrбtoři", string, "Ok", "");
  }
 }
 return 1;
Reply
#2

PHP код:
foreach (new Player)
 {
     if(
IsPlayerConnected(i) && PlayerInfo[i][pAdmin] > 0)
     {
         
format(strsizeof(str), "{FFFFFF}%s -> %s\n"GetName(i), Admin);
         
strcat(stringstr);
         
ShowPlayerDialog(playeridDIALOG_ADMINSDIALOG_STYLE_MSGBOX"Online Administrбtori"string"Ok""");
       }
        if(!
IsPlayerConnected(i) && PlayerInfo[i][pAdmin] > 0)
     {
         
SendClientMessage(playerid,-1,"no admins");
       }
 } 
Reply
#3

pawn Код:
GetAdminRank(playerid)
{
    new rank[24];
    switch(PlayerInfo[playerid][pAdmin])
    {
        case 1: rank = "Administrбtor";
        case 2: rank = "Globбlnн Administrбtor";
        case 3: rank = "Hlavnн Administrбtor";
        case 4: rank = "Zakladatel";
        default: rank = "Unknown Rank";
    }
    return rank;
}

CMD:admins(playerid, params[])
{
    static str[3000 char], packed[64 char], szStr[64];

    str{0} = EOS;
    foreach(new i : Player)
    {
        if(0 < PlayerInfo[i][pAdmin] < 5)
        {
            format(szStr, sizeof(szStr), "{FFFFFF}%s -> %s\n", GetName(i), GetAdminRank(i));
            strpack(packed, szStr);
            strcat(str, packed);
        }
    }
    if(!str{0}) SendClientMessage(playerid,-1,"No Admins OnLine");
    else ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "Online Administrбtoři", str, "Ok", "");

    return 1;
}
Reply
#4

Thank you guys! Both REP+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)