Page 1 of 1

Cerere LICENTA PLUGIN [ REZOLVAT ]

Posted: 13 Oct 2013, 20:21
by levin
As dori sa stiu daca exista licenta in asa fel incat sa fie gen " Eu am pluginul xxp.amxx si vreau sa imi expire in anul x , luna y si ziua z "... Daca se poata si ora mimut, secunda..

Re: Cerere LICENTA PLUGIN

Posted: 13 Oct 2013, 20:37
by YONTU
| Afiseaza codul
#include < amxmodx >
#include < cstrike >
#include < hamsandwich >
#include < fun >
#include < CC_ColorChat >

#define PLUGIN "Test Licensing IP"
#define VERSION "1.0"

static const ServerLicensedIp[ ] = "xxx.xxx.xx.xx";

public plugin_init( )
{
	new ServerIp[ 22 ];
	get_user_ip( 0, ServerIp, sizeof ( ServerIp ) -1, 1 );
	
	if( equal( ServerIp, ServerLicensedIp ) )
	{
		new PluginName[ 32 ];
		format( PluginName, sizeof ( PluginName ) -1, "[Ip Licentiat] %s", PLUGIN );
		register_plugin( PluginName, VERSION, "YONTU" );

		RegisterHam( Ham_TakeDamage, "player", "Player_TakeDamage" );
		RegisterHam( Ham_Spawn, "player", "Spawn", 1 );

		server_print( "[ %s ] Felicitari! Detii o licenta valida, iar pluginul functioneaza perfect!", PLUGIN );
		server_print( "[ %s ] Pentru mai multe detalii y/m: < [email protected] >", PLUGIN );
		server_print( "[ %s ] Ip-ul Licentiat: < %s > | Ip-ul Serverului: < %s >", PLUGIN, ServerIp, ServerLicensedIp );
	}

	else
	{
		new PluginName[ 32 ];
		format( PluginName, sizeof ( PluginName ) -1, "[Ip Nelicentiat] %s", PLUGIN );
		register_plugin( PluginName, VERSION, "YONTU" );
		
		server_print( "[ %s ] Nu detii o licenta valabila ! Plugin-ul nu va functiona corespunzator !", PLUGIN );
		server_print( "[ %s ] Pentru mai multe detalii y/m: < [email protected] >", PLUGIN );
		server_print( "[ %s ] Ip-ul Licentiat: < %s > | Ip-ul Serverului: < %s >", PLUGIN, ServerIp, ServerLicensedIp );
		
		pause( "ade" );
	}
}

public Spawn( id )
{
	set_user_health( id, get_user_health( id ) + 200 );
	set_task( 10.0, "MesaJ", id );
}

public MesaJ( id )
{
	ColorChat( id, TEAM_COLOR, "^x04YONTU^x03 e cel mai tare! " );
}

public Player_TakeDamage( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )
{
	if( get_user_weapon( iAttacker ) && is_user_vip( iAttacker ) && is_user_ct( iAttacker ) )
	{
		SetHamParamFloat( 4, fDamage * 10 );
		return HAM_HANDLED;
		
	}
	
	return HAM_IGNORED;
}

stock bool:is_user_vip( id )
{
	if( get_user_flags( id ) & ADMIN_IMMUNITY )
		return true;
	
	return false;
}

stock is_user_ct( id ) 
{
	if( is_user_connected( id ) && !is_user_bot( id ) && cs_get_user_team( id ) == CS_TEAM_CT )
		return 1;
	
	return 0;
}

stock is_user_furien( id )
{
	if( is_user_connected( id ) && !is_user_bot( id ) && cs_get_user_team( id ) == CS_TEAM_T )
		return 1;
	
	return 0;
}
Stiu ca ai cerut altceva, dar... e bun si asta :)) !

Faza asta cu licentierea unui IP am vazut-o la un plugin de-al lui Askhanar ;)) !

Re: Cerere LICENTA PLUGIN

Posted: 13 Oct 2013, 20:39
by Cosmin
ASTEAPTA PUTIN, iti pun eu.

Re: Cerere LICENTA PLUGIN

Posted: 13 Oct 2013, 20:41
by munir
Folositi

Code: Select all

date( Year, Month, Day );

Re: Cerere LICENTA PLUGIN

Posted: 13 Oct 2013, 20:43
by Cosmin
uite-te aici http://www.extreamcs.com/forum/modifica ... 15300.html eu pe asta il folosesc :)

Re: Cerere LICENTA PLUGIN

Posted: 13 Oct 2013, 21:24
by levin
YONTU wrote:
| Afiseaza codul
#include < amxmodx >
#include < cstrike >
#include < hamsandwich >
#include < fun >
#include < CC_ColorChat >

#define PLUGIN "Test Licensing IP"
#define VERSION "1.0"

static const ServerLicensedIp[ ] = "xxx.xxx.xx.xx";

public plugin_init( )
{
	new ServerIp[ 22 ];
	get_user_ip( 0, ServerIp, sizeof ( ServerIp ) -1, 1 );
	
	if( equal( ServerIp, ServerLicensedIp ) )
	{
		new PluginName[ 32 ];
		format( PluginName, sizeof ( PluginName ) -1, "[Ip Licentiat] %s", PLUGIN );
		register_plugin( PluginName, VERSION, "YONTU" );

		RegisterHam( Ham_TakeDamage, "player", "Player_TakeDamage" );
		RegisterHam( Ham_Spawn, "player", "Spawn", 1 );

		server_print( "[ %s ] Felicitari! Detii o licenta valida, iar pluginul functioneaza perfect!", PLUGIN );
		server_print( "[ %s ] Pentru mai multe detalii y/m: < [email protected] >", PLUGIN );
		server_print( "[ %s ] Ip-ul Licentiat: < %s > | Ip-ul Serverului: < %s >", PLUGIN, ServerIp, ServerLicensedIp );
	}

	else
	{
		new PluginName[ 32 ];
		format( PluginName, sizeof ( PluginName ) -1, "[Ip Nelicentiat] %s", PLUGIN );
		register_plugin( PluginName, VERSION, "YONTU" );
		
		server_print( "[ %s ] Nu detii o licenta valabila ! Plugin-ul nu va functiona corespunzator !", PLUGIN );
		server_print( "[ %s ] Pentru mai multe detalii y/m: < [email protected] >", PLUGIN );
		server_print( "[ %s ] Ip-ul Licentiat: < %s > | Ip-ul Serverului: < %s >", PLUGIN, ServerIp, ServerLicensedIp );
		
		pause( "ade" );
	}
}

public Spawn( id )
{
	set_user_health( id, get_user_health( id ) + 200 );
	set_task( 10.0, "MesaJ", id );
}

public MesaJ( id )
{
	ColorChat( id, TEAM_COLOR, "^x04YONTU^x03 e cel mai tare! " );
}

public Player_TakeDamage( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )
{
	if( get_user_weapon( iAttacker ) && is_user_vip( iAttacker ) && is_user_ct( iAttacker ) )
	{
		SetHamParamFloat( 4, fDamage * 10 );
		return HAM_HANDLED;
		
	}
	
	return HAM_IGNORED;
}

stock bool:is_user_vip( id )
{
	if( get_user_flags( id ) & ADMIN_IMMUNITY )
		return true;
	
	return false;
}

stock is_user_ct( id ) 
{
	if( is_user_connected( id ) && !is_user_bot( id ) && cs_get_user_team( id ) == CS_TEAM_CT )
		return 1;
	
	return 0;
}

stock is_user_furien( id )
{
	if( is_user_connected( id ) && !is_user_bot( id ) && cs_get_user_team( id ) == CS_TEAM_T )
		return 1;
	
	return 0;
}
Stiu ca ai cerut altceva, dar... e bun si asta :)) !

Faza asta cu licentierea unui IP am vazut-o la un plugin de-al lui Askhanar ;)) !
îmi pare rău că am fost răutăcios

@scosmynnnn: Nu pricep :)) care e rezultatul final ?.. ( P.S: asa imi trb :D )

EDIT: scosmynn am rezolvat :P si testat => merge Ms
EDIT2: Cred ca a uitat sa puna si functia de a opri pluginul in cazul in care nu are licenta.. => " pause( "ade" ); "

Puteti da T.C

editu lu ask - nu a uitat, a pus set_fail_state care e cam tot aia