Posts: 728
Threads: 109
Joined: May 2015
Reputation:
0
Hello guys,i want to start to make a cmd,/admins
If you type /admins,a list with full admin name is shown,and after their name,Offline if they are Offline or Online if they are online.
example:
admin A-Offline
admin B-Online
admin C-Online
admin D-Online
admin E-Offline
any ideas on how to do this?[mysql server]
Posts: 181
Threads: 38
Joined: Aug 2010
Reputation:
0
I guess a better way to do that is exporting the admin list into a file every couple of hours or so and then retrieve the info from there. Just incase he has a big amount of users in his table.
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
Lack of information, the admin level is in the main players table or you have a separated table for admins? Either way, retrieving the player's name and use it in sscanf (1st parameter) with "r" or "u" specifier can easily figure out if the player is connected (if variable (3rd parameter) is not equal to INVALID_PLAYER_ID then player is connected).
Don't forget to set the admin level column as index in the table's structure to make it faster.
Posts: 728
Threads: 109
Joined: May 2015
Reputation:
0
so,i got admin on users table,not in a separated one.
i was wondering if i can make another table in my database called adminlist,and where i can manually put my admin names on it.
But i dont know how to make a function that gets the names from the adminlist and checks if they are offline,i tried my best still all of them appear to be OFFLINE