Raised This Month: $12 Target: $400
 3% 

[REQ/HELP]Server Slot


Post New Thread Reply   
 
Thread Tools Display Modes
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 02-19-2018 , 03:24   Re: [REQ/HELP]Server Slot
Reply With Quote #11

A long time ago, i made this

PHP Code:

#include < amxmodx >
#include <colorchat>
#include < server_query >

new const SERVER_IP[ ] = "172.21.63.113"//this will be your server ip :3
const SERVER_PORT 27015// this will be the your server port

public plugin_init( )
{
    
register_clcmd"say /server""command_QueryPlayers" );
    
register_clcmd"say_team /server""command_QueryPlayers" );
}    

public 
command_QueryPlayersid 
{
    new 
iError;
    if( !
sq_querySERVER_IPSERVER_PORTSQ_Server"handle_playerQuery"iError ) ) 
    {
        new 
sError128 ];
        
sq_erroriErrorsErrorcharsmaxsError ) );
        
        
ColorChatidGREY"^4Error: %s"sError );
    } 
}

public 
handle_playerQueryQueryIDiTypeTrie:bufferFloat:queryTimebool:bFailedsData[ ], iDataSize 
{
    if( 
bFailed 
    {
        
ColorChat0GREY"^4Failed query for %d type"iType );
    } 
    else 
    {
        if( 
iType == SQ_Server )
        {
            new 
host[64], map[64];
            new 
numPlayersmaxPlayersbool:password;

        
            
TrieGetString(buffer"server_name"hostcharsmax(host));
            
TrieGetString(buffer"map"mapcharsmax(map));
            
TrieGetCell(buffer"num_players"numPlayers);
            
TrieGetCell(buffer"max_players"maxPlayers);
            
password TrieKeyExists(buffer"password");
            
            
set_hudmessage(025500.250.006.012.0)
            
show_hudmessage(0"Server name:%s^nIP:%s:%d^nMap:%s^nPlayers: (%d/%d)^nPassword:%s",host,SERVER_IP,SERVER_PORT,map,numPlayers,maxPlayers,password?"Yes":"No");
        }
    }

Link to server query api : https://forums.alliedmods.net/showthread.php?t=142858
indraraj striker is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-19-2018 , 04:09   Re: [REQ/HELP]Server Slot
Reply With Quote #12

Search redirect.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 02-19-2018 , 07:11   Re: [REQ/HELP]Server Slot
Reply With Quote #13

You can check the Source of XREDIRECT
I guess it has this type of features to check other server's INFO
instinctpt1 is offline
Reply


Thread Tools
Display Modes

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 07:54.


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