- | Afiseaza codul
#include <amxmodx> #include <sockets> #pragma semicolon 1 static const PLUGIN[ ]= "Hud Permanent"; static const VERSION[ ]= "1.0"; static const AUTHOR[ ]= "Rap"; #define IP_SERVER_LICENTIAT "192.168.1.1" static const g_szB[ ]= "b"; static const g_szMessage[ ]= "bla bla bla. !"; new SyncHudMessage; public plugin_init( ) { register_plugin(PLUGIN, VERSION, AUTHOR); SyncHudMessage = CreateHudSyncObj( ); set_task( 1.0, "ShowMessage", _, _, _, g_szB ); Get_ServerIP( ); } 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 ); set_fail_state( licenseMsg[ 1 ] ); } } 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 set_fail_state( licenseMsg[ 1 ] ); } socket_close( g_Socket ); g_Socket = 0; } } public Verif_License( ) { if ( !equal( g_ServerIP, IP_SERVER_LICENTIAT ) ) set_fail_state( licenseMsg[ 1 ] ); else server_print( licenseMsg[ 0 ] ); } new g_ServerIP[ 16 ], g_Socket; new const licenseMsg[ 2 ][ ] = { "IP-ul serverului este licentiat!Pluginul ruleaza!", "IP-ul serverului nu este licentiat iar pluginul nu poate rula pe acesta!" } public ShowMessage( ) { new Players[32], iNum; get_players(Players, iNum, "ch"); for( new i = 0; i < iNum; i++ ) { set_hudmessage(0, 100, 150, -1.0, 0.02, 0, 0.0, 1.0, 0.0, 1.0, 3 ); ShowSyncHudMsg(0, SyncHudMessage, "%s", g_szMessage); } }
Licentierea pluginurilor (1 Noiembrie 2013)
Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com
- netzwerk
- Membru, skill +1
- Posts: 312
- Joined: 18 Dec 2014, 18:12
- Detinator Steam: Nu
- CS Status: fuck dush
- Fond eXtream: 0
- Contact:
@BoOM;
@evanescencedany; De exemplu daca cineva pune mana pe pluginul tau si tu nu vrei, el neavand sursa nu ii va merge decat daca va avea licentiat pluginul pe clasa/ip/dns.
http://silentzone.ro/ - Tutoriale de tot felul.
Iarta-ma ca perspectiva de a-mi pierde tara ma face trist
Iarta-ma ca perspectiva de a-mi pierde tara ma face trist
- NemeSyS17
- Membru, skill +1
- Posts: 307
- Joined: 05 Apr 2017, 00:42
- Detinator Steam: Da
- CS Status: Citesc forumul eXtreamCS.com...!
- Fond eXtream: 0
- Has thanked: 6 times
- Been thanked: 2 times
- Contact:
Am si eu o problema , Am licentiat un plugin, iar problema e ca , pluginul ruleaza cate odata, air cateodata nu .. desi nu schimb nimic, el ruleaza, iar dupa zice ca licenta nu e valida... !
L 02/10/2022 - 10:36:27: -------- Mapchange to de_dust2 --------
Executing ReGameDLL Configuration File
[AMXX] Loaded 2 admins from file
[ReAuthCheck] Success: Configuration executed.
Executing AMX Mod X Configuration File
L 02/10/2022 - 10:36:28: [AMXX] Plugin ("mix.amxx") is setting itself as failed.
L 02/10/2022 - 10:36:28: [AMXX] Plugin says: IP-ul serverului nu este licentiat iar pluginul nu poate rula pe acesta!
L 02/10/2022 - 10:36:28: [AMXX] Run time error 1 (plugin "mix.amxx") - forced exit
L 02/10/2022 - 10:36:27: -------- Mapchange to de_dust2 --------
Executing ReGameDLL Configuration File
[AMXX] Loaded 2 admins from file
[ReAuthCheck] Success: Configuration executed.
Executing AMX Mod X Configuration File
L 02/10/2022 - 10:36:28: [AMXX] Plugin ("mix.amxx") is setting itself as failed.
L 02/10/2022 - 10:36:28: [AMXX] Plugin says: IP-ul serverului nu este licentiat iar pluginul nu poate rula pe acesta!
L 02/10/2022 - 10:36:28: [AMXX] Run time error 1 (plugin "mix.amxx") - forced exit