Raised This Month: $ Target: $400
 0% 

Some questions about server_query API by Exolent


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Fedde
BANNED
Join Date: Sep 2011
Old 09-22-2011 , 21:58   Some questions about server_query API by Exolent
Reply With Quote #1

I have some question with this,and some doubts...

I want to use this in a menu,but I must made an delay to this,because if I made the menu on the forward called by sq_query(),the menu doesn't show the data of the server.

-How I must do to don't make a delay,and get the data of the server in that forward?

Maybe a task getting the data every 60 seconds,and when the user calls the menu,the menu shows the last data obteinad?

But I don't want to flood the server.

~~~~~~~~~~~~~~~~

How I can use the array called iServer(See in the code) with more servers,or making a multiple array and use it,without hardcodding the plugin.

This is because I want to make a *.ini file and set my servers there and I have 10.

~~~~~~~~~~~~~~~~

I get this message when I compile the plugin.
Code:
Warning: Symbol is assigned a value that is never used: "iServer" on line 24
Why? I use iServer when I open the data of a server in sq_query().

~~~~~~~~~~~~~~~~

Here is my code.

Code:
#include <amxmodx> #include <server_query> /* Pragma */ #pragma semicolon 1 public plugin_init() {     /* Plugin Registration */     register_plugin("Server Data","0.0.1","Fedde");         /* Command */     register_clcmd("say test","cmdTest"); } public cmdTest(id) {     new iServer;     new iError;     iServer = sq_query("201.212.2.185",27024,SQ_Server,"QueryResults",iError);         return PLUGIN_HANDLED; } public QueryResults(id,iServer,szBuffer[],iLen) {     new Mapname[64];     new aPlayers,mPlayers;     new bool:Password;         sq_readbuffer_server(szBuffer,iLen,_,_,Mapname,charsmax(Mapname),_,_,_,_,_,aPlayers,mPlayers,_,_,_,Password);         server_print("Server Results : %s (%d/%d) %s",Mapname,aPlayers,mPlayers,Password ? "[Closed]" : ""); }

Thanks
Sorry for my bad english.

[NOTE]
I am testing how to make the plugin,thats why the plugin doesn't check somethings,like iError,etc.

Last edited by Fedde; 09-22-2011 at 22:04.
Fedde is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode