How to make /offadmins command to see offline admins?
#1

Can anyone help me to make /offadmins command to i can see all offline admins? thanks
I use mysql gamemode
Reply
#2

Quote:
Originally Posted by ZBits
Посмотреть сообщение
Check for a Admin level greater than 1 in the database, then loop through the ids and/or names(of admins) and check if they are online.

I'd recommend you look for MySQL tutorials and get some more knowledge
Quoting this message from this topic.
Reply
#3

I dont know how to do it, i need code
Reply
#4

are you saving admin names into DB ? and which mysql version
Reply
#5

Yes it saving in DB, R39 version.
Reply
#6

pawn Код:
OfflineAdmins()
{
    new str[MAX_PLAYER_NAME * 40],rows,player;
    new Name[MAX_PLAYER_NAME + 40];

    new Cache:result;
    result = mysql_query(conhandle, "SELECT * FROM Admins"); // SELECT `Nick` FROM Admins
    if((rows = cache_get_row_count()) > 0)
    {
        for(new i=0; i < rows; i++)
        {
            cache_get_row(i, 0, Name);
            sscanf(Name, "u", player);
            if(player > MAX_PLAYERS)
            {
                format(Name,sizeof(Name),"{FFFFFF}%s {FF0000}(offline)\n",Name);
                strcat(str, Name);
            }
        }
    }
    cache_delete(result);
    return str;
}

ShowPlayerDialog(playerid,DIALOG_ADMINS,DIALOG_STYLE_MSGBOX,"Offline admins",OfflineAdmins(),"Ok","");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)