How to make /offadmins command to see offline admins? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to make /offadmins command to see offline admins? (
/showthread.php?tid=598002)
How to make /offadmins command to see offline admins? -
ervinmasic - 07.01.2016
Can anyone help me to make /offadmins command to i can see all offline admins? thanks
I use mysql gamemode
Re: How to make /offadmins command to see offline admins? -
Jimmy0wns - 07.01.2016
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.
Re: How to make /offadmins command to see offline admins? -
ervinmasic - 07.01.2016
I dont know how to do it, i need code
Re: How to make /offadmins command to see offline admins? -
Jefff - 07.01.2016
are you saving admin names into DB ? and which mysql version
Re: How to make /offadmins command to see offline admins? -
ervinmasic - 07.01.2016
Yes it saving in DB, R39 version.
Re: How to make /offadmins command to see offline admins? -
Jefff - 07.01.2016
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","");