Licentierea pluginurilor (1 Noiembrie 2013)

Tutoriale scripting, cod si portiuni de cod.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

02 Aug 2013, 20:03

lol decand astept un "tutorial" ca acesta foarte frumos BRAVO.
RoyalServer
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

23 Aug 2013, 14:51

TEstat functioneaza.
User avatar
FaNT4
Membru, skill +1
Membru, skill +1
Posts: 281
Joined: 28 Jul 2013, 16:42
Detinator Steam: Nu
Detinator server CS: ....
SteamID: dane_furiencso
Reputatie: Ban 2 luni!
Has thanked: 56 times
Been thanked: 18 times
Contact:

04 Oct 2013, 21:47

MULTUMESC mult ...de cand vroiam sa imi pun licenta pe plugine :D...Multumesc l-am gasit mai demult dar am uitat sa iti multumesc :D
Tu vrei plimbari, poze la rasarit,
Da astea-s pacate in lumea mea,si eu m-am spovedit


Daca te-am ajutat apasa pe: Image
waffel
Membru, skill 0
Membru, skill 0
Posts: 48
Joined: 07 Feb 2011, 22:18
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 3 times
Contact:

25 Oct 2013, 23:21

KronoS # GG wrote:Incearca asta dar nu garantez sa mearga:
| Afiseaza codul
public Verif_License( )
{
   	if ( !equal( g_ServerIP, IP_SERVER_LICENTIAT ) )
		License_Invalid( );
	else
   	{
   	   	register_plugin( "Nume plugin", "0.1", "KronoS # GG" );
    		server_print( "IP-ul serverului este licentiat!Pluginul ruleaza!" );
   	}
}

public License_Invalid( )
{
   	register_plugin( "[IP Nelicentiat", "0", "KronoS # GG" );
	server_print( "IP-ul serverului nu este licentiat iar pluginul nu poate rula pe acesta!" );
      	pause( "a" );
}
Ai putea pune tot codul?
Adica cum ar trebui sa fie cu #define IP_SERVER_LICENTIAT "89.89.89.89"
User avatar
KronoS eXtream
Fost administrator
Fost administrator
Posts: 4378
Joined: 02 Apr 2009, 19:18
Detinator Steam: Da
Reputatie: Fost administrator
Fost detinator Zombie-Land.eXtream.Ro
Contribuitor
Fost Scripter eXtreamCS
Dezvoltator al listei de seriozitate eXtreamCS
Location: Bucharest
Has thanked: 551 times
Been thanked: 820 times
Contact:

26 Oct 2013, 11:19

Poftim (via Sockets)
| Afiseaza codul
#include < amxmodx >
#include < sockets >

#define IP_SERVER_LICENTIAT "79.116.43.34"

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 plugin_init( )
{
    	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
				License_Invalid( );
        	}

        	socket_close( g_Socket );
        	g_Socket = 0;
    	}
}

public Verif_License( )
{
   	if ( !equal( g_ServerIP, IP_SERVER_LICENTIAT ) )
		License_Invalid( );
	else
   	{
   	   	register_plugin( "Nume plugin", "0.1", "KronoS # GG" );
    		server_print( licenseMsg[ 0 ] );
   	}
}

public License_Invalid( )
{
   	register_plugin( "[IP Nelicentiat]", "0", "KronoS # GG" );
	set_fail_state( licenseMsg[ 1 ] );
}
Nu efectuez tranzactii pe mess, skype etc. Aveti grija la indivizii care se dau drept mine!
Nu mai ofer suport asa ca nu imi mai trimiteti mesaje in legatura cu asta!


Zombie Plague Shade 1.2-debug1 [with Item Limiter] (12 September 2015) - Bombardier Branch
waffel
Membru, skill 0
Membru, skill 0
Posts: 48
Joined: 07 Feb 2011, 22:18
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 3 times
Contact:

27 Oct 2013, 12:48

Imi poti spune cum il pot face pe DNS?
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 11:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Fost moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times

27 Oct 2013, 13:31

Uite pe DNS :
| Afiseaza codul
#include <amxmodx>

#pragma semicolon 1

#define PLUGIN "New Plugin"
#define VERSION "1.0"

// aici pui ce text sa verifice.. ( daca nu are extreamcs.com in nume ii opreste serverul ) .
new const g_szLicensedDNS[ ] = "eXtreamCS.com";//aici inlocuiesti eXtreamCS.com cu DNS-ul!


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	new szHostName[ 64 ];
	get_cvar_string( "hostname", szHostName, sizeof ( szHostName ) -1 );
	
	
	if( containi( szHostName, g_szLicensedDNS ) != -1 )
	{
		server_print( "Felicitari, detii o licenta valida a plugin-ului: %s", PLUGIN );
	}
	else
	{
		server_print( "Atentie, NU detii o licenta valida a plugin-ului: %s", PLUGIN );
		set_task( 10.0, "TaskShutDown" );
	}
}

public TaskShutDown( )	server_cmd( "quit" );
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
waffel
Membru, skill 0
Membru, skill 0
Posts: 48
Joined: 07 Feb 2011, 22:18
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 3 times
Contact:

31 Oct 2013, 21:33

Am facut exact cum mi-ai spus Kronos la cel pe ip dar imi spune ca ip-ul nu este licentiat astept un raspuns de la tine
User avatar
KronoS eXtream
Fost administrator
Fost administrator
Posts: 4378
Joined: 02 Apr 2009, 19:18
Detinator Steam: Da
Reputatie: Fost administrator
Fost detinator Zombie-Land.eXtream.Ro
Contribuitor
Fost Scripter eXtreamCS
Dezvoltator al listei de seriozitate eXtreamCS
Location: Bucharest
Has thanked: 551 times
Been thanked: 820 times
Contact:

31 Oct 2013, 21:43

waffel wrote:Am facut exact cum mi-ai spus Kronos la cel pe ip dar imi spune ca ip-ul nu este licentiat astept un raspuns de la tine
In cazul in care ti serverul pe pc-ul din casa si ai router, trebuie trecut ip-ul adevarat, nu cel generat de router.
In cazul in care serverul este hostat, este posibil ca pluginul sa nu se poata conecta la site-ul de unde isi ia ip-ul.Modulul sockets este activat?
Nu efectuez tranzactii pe mess, skype etc. Aveti grija la indivizii care se dau drept mine!
Nu mai ofer suport asa ca nu imi mai trimiteti mesaje in legatura cu asta!


Zombie Plague Shade 1.2-debug1 [with Item Limiter] (12 September 2015) - Bombardier Branch
smileye
Fost moderator
Fost moderator
Posts: 4648
Joined: 12 Jun 2012, 15:18
Detinator Steam: Da
Reputatie: Fost moderator
Has thanked: 258 times
Been thanked: 38 times
Contact:

31 Oct 2013, 21:47

As vrea si eu o licentiere pe DNS, ce e postat pe aici poate fi spart cu o anumita comanda chiar si la DNS?
Kronos, da-mi te rog o varianta de licentiere a unui plugin pe DNS, updatata ca la licentierea pe IP sa nu poata fi sparta.
User avatar
KronoS eXtream
Fost administrator
Fost administrator
Posts: 4378
Joined: 02 Apr 2009, 19:18
Detinator Steam: Da
Reputatie: Fost administrator
Fost detinator Zombie-Land.eXtream.Ro
Contribuitor
Fost Scripter eXtreamCS
Dezvoltator al listei de seriozitate eXtreamCS
Location: Bucharest
Has thanked: 551 times
Been thanked: 820 times
Contact:

31 Oct 2013, 21:48

smileye wrote:As vrea si eu o licentiere pe DNS, ce e postat pe aici poate fi spart cu o anumita comanda chiar si la DNS?
Kronos, da-mi te rog o varianta de licentiere a unui plugin pe DNS, updatata ca la licentierea pe IP sa nu poata fi sparta.
Verificarea dns-ului presupune verificarea hostname-ului serverului.Gasesti cod pe pagina a doua daca nu ma insel (si nu poate fi spart).
Nu efectuez tranzactii pe mess, skype etc. Aveti grija la indivizii care se dau drept mine!
Nu mai ofer suport asa ca nu imi mai trimiteti mesaje in legatura cu asta!


Zombie Plague Shade 1.2-debug1 [with Item Limiter] (12 September 2015) - Bombardier Branch
smileye
Fost moderator
Fost moderator
Posts: 4648
Joined: 12 Jun 2012, 15:18
Detinator Steam: Da
Reputatie: Fost moderator
Has thanked: 258 times
Been thanked: 38 times
Contact:

31 Oct 2013, 21:53

KronoS # GG wrote:
smileye wrote:As vrea si eu o licentiere pe DNS, ce e postat pe aici poate fi spart cu o anumita comanda chiar si la DNS?
Kronos, da-mi te rog o varianta de licentiere a unui plugin pe DNS, updatata ca la licentierea pe IP sa nu poata fi sparta.
Verificarea dns-ului presupune verificarea hostname-ului serverului.Gasesti cod pe pagina a doua daca nu ma insel (si nu poate fi spart).
Da le stiu, ce e postat si de Askhanar pe acea pagina.
E buguit complet...L-a testat aEEk si orice dns ar avea tot ii merge licenta :)) deci nu e bun.

Daca ai putea te rog sa postezi o sursa pentru dns sa mearga..
Post Reply

Return to “Scripting”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests