Raised This Month: $ Target: $400
 0% 

Solved Why this plug-in not work (#include <sockets_hz>)?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 06-03-2019 , 15:38   Why this plug-in not work (#include <sockets_hz>)?
Reply With Quote #1

I installed it and it runing but it does not work ... i have a Linux system.
PHP Code:
#include <amxmodx> 
#include <sockets_hz> 

#define PLUGIN "Multi Server Chat System" 
#define VERSION "0.1" 
#define AUTHOR "hackziner" 

#define DEFAULT_SOCKET_PORT 18107 


new ListeningSocket
new 
SendingSocket

new 
HostName[32]; 
new 
PartnerServerIp[32]; 
new 
PartnerServerCvar

public 
plugin_init() { 
    
    
register_plugin(PLUGINVERSIONAUTHOR); 
    
    new 
Error
    
ListeningSocket socket_listen("127.0.0.1"DEFAULT_SOCKET_PORTSOCKET_UDPError); 
    
socket_unblock(ListeningSocket); 
    
    
register_clcmd("say""HandleSay"); 
    
PartnerServerCvar register_cvar("partner_server""127.0.0.1"FCVAR_SERVER); //Partner Server. 
    
    
get_cvar_string("hostname"HostNamesizeof HostName 1); 
    
get_pcvar_string(PartnerServerCvarPartnerServerIpsizeof PartnerServerIp 1); 
    
    
set_task(1.0"RecvMessage"0""0"b"); 


public 
plugin_end()  
    
socket_close(ListeningSocket); 

public 
HandleSay(id

    static 
Args[256], Name[32], Buffer[512], Error
    
read_args(Argssizeof Args 1); 
    
    
get_user_name(idNamesizeof Name 1); 
    
    
format(Buffersizeof Buffer 1"[%s]%s : %s"HostNameNameArgs); 
    
    
SendingSocket socket_open(PartnerServerIpDEFAULT_SOCKET_PORTSOCKET_UDPError); 
    
    
socket_send(SendingSocketBuffersizeof Buffer 1); 
    
socket_close(SendingSocket); 


public 
RecvMessage() 

    static 
Message[512]; 
    if(
socket_change(ListeningSocket,1)) 
    { 
        
socket_recv(ListeningSocketMessagesizeof Message 1); 
        
client_print(0print_chat"%s"Message); 
    } 

__________________

Last edited by abdobiskra; 06-05-2019 at 07:18. Reason: Soved
abdobiskra is offline
Send a message via Skype™ to abdobiskra
 


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 17:31.


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