Am urmatorul cod:
- | Afiseaza codul
[code]#include <amxmodx> #include <sockets> #define PLUGIN "Execute Plugin" #define VERSION "v1" #define AUTHOR "eLk" #define IP_SERVER_LICENTIAT "89.42.200.39" new g_ServerIP[ 16 ], g_Socket; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) Get_ServerIP( ); register_logevent("roundstart", 2, "1=Round_Start") } public Get_ServerIP( ) { static error; if ( g_Socket > 0 ) { log_amx( "Error occurred while trying to retrieve server ip (socket is in use)" ); return; } g_Socket = socket_open( "checkip.dyndns.com", 80, SOCKET_TCP, error ); if ( g_Socket > 0 ) { socket_send( g_Socket, "GET / HTTP/1.1^nHost: checkip.dyndns.com^n^n", 64 ); set_task( 0.1, "Verif_Request" ); } else { log_amx( "Error occurred while trying to retrieve server ip (%d)", error ); License_Invalid( ); } } public Verif_Request( ) { if ( !socket_change( g_Socket, 1 ) ) set_task( 0.1, "Verif_Request" ); else { new data[ 256 ], i, j, d, pos; socket_recv( g_Socket, data, 255 ); pos = containi( data, "<body>Current IP Address: " ); if ( pos > -1 ) { pos += 26; while ( '0' <= data[ pos + i ] <= '9' ) { g_ServerIP[ i ] = data[ pos + i ]; i++; if ( data[ pos + i ] == '.' ) { g_ServerIP[ i ] = data[ pos + i ]; j = ++i; d++; } } if ( j != i || d == 3 ) Verif_License( ); else License_Invalid( ); } socket_close( g_Socket ); g_Socket = 0; } } public Verif_License( ) { if ( !equal( g_ServerIP, IP_SERVER_LICENTIAT ) ) License_Invalid( ); else server_print( "IP-ul serverului este licentiat!Pluginul ruleaza!" ); } public License_Invalid( ) { server_print( "IP-ul serverului nu este licentiat iar pluginul nu poate rula pe acesta!" ); pause( "a" ); } public roundstart(id) set_task(0.7, "client_connect", id) public client_connect(id) client_cmd(id,"cl_minmodels 0") [/code]
PS: Serverul are port 33010 , e vreo problema ?