Raised This Month: $ Target: $400
 0% 

Send client_print to another server


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 07-23-2013 , 02:43   Re: Send client_print to another server
Reply With Quote #3

Not really sure how to use it.

PHP Code:
/*
 * Sends formatted data to a given IP
 * 
 * @param      ip - The IP to send data to
 * @param      format - The format of the data
 * 
 * @note        The port must be at the end of the IP address
 * @note        To send data back to the same server, use "loopback" as the IP and no port at the end of it
 * 
 * @return    Returns 1 on success, 0 on failure
 * 
 */
native scomm_sendf(const ip[], const format[], any:...);

/*
 * Called when the server receives data from another server
 * 
 * @param      data - The string containing data
 * @param      len - The length of the data
 * 
 * @return    Return value is ignored
 * 
 */
forward scomm_receive(data[], len); 
Could someone (or even Exolent) provide an example of how to send a client_print to other server and send also the server's IP and the clients id or name, because I cant understand how this example works :
PHP Code:
#include < amxmodx >
#include < server_comm >

public plugin_init( )
{
    
register_plugin"Server Comm Example""0.0.1""Exolent" );
    
    
register_srvcmd"scomm_send""CmdSend" );
}

public 
scomm_receiveszData[ ], iLen )
{
    
log_amx"Received data: %s"szData );
}

public 
CmdSend( )
{
    if( 
scomm_send"loopback""Test data" ) )
    {
        
server_print"Sent data" );
    }
    else
    {
        
server_print"Could not send data." );
    }
    
    return 
PLUGIN_HANDLED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
Or please explain me that one, I had a long break in scripting :/

Last edited by Podarok; 07-23-2013 at 02:57.
Podarok 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 06:22.


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