Raised This Month: $ Target: $400
 0% 

Send client_print to another server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Podarok
BANNED
Join Date: Jan 2011
Location: Narnia
Old 07-22-2013 , 13:37   Send client_print to another server
Reply With Quote #1

Can I send a client_print to another server using Sockets (i guess), when a player types a certain command in chat. e.g.:
Client typed : /send
And on the other server we show this :
Code:
client_print(0, print_chat, "A client on XXX.XXX.XXX.XXX wrote /send, ... blah blah blah");

Is that possible ?
Podarok is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-22-2013 , 13:40   Re: Send client_print to another server
Reply With Quote #2

Take a look at this.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
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
Reply



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