07.01.2016, 18:26
Can anyone help me to make /offadmins command to i can see all offline admins? thanks
I use mysql gamemode
I use mysql gamemode
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 |
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","");