Re: Send client_print to another server
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_receive( szData[ ], 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 :/
|