[cerere plugin] SupplyBox CSGO REMAKE

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2155
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 349 times
Contact:

12 Apr 2019, 21:53

păi și nu merge pluginu?

Code: Select all

	/* 
	Plugin: Xmas Gifts 2.3.2 
	Autor: KronoS # GG 

	Credite: 
	@FakeNick - pentru pluginul Pick up present de unde a pornit tot 
	@joropito - pentru Super Spawns 
	@Askhanar - pentru fixarea Super Spawns 

	Cvar-uri: 
	- presents_respawn_time 60.0 (Dupa cat timp dupa ridicarea unui cadou apare altul pe harta) 
	- presents_on_map 11 (Cate cadouri sa apara pe harta) 
		ATENTIE*: Se calculeaza numarul cvar-ului - 1!!! 
			Daca puneti 11 or sa apara doar 10 cadouri! 

	Changelog: 

	* v2.3.2 - 28.12.2012 
	- cadourile primeau respawn chiar daca timpul era setat pe 0.0 
	* v2.3.1 - 28.12.2012 
	- cadourile nu primeau respawn 
	* v2.3 - 28.12.2012 
	- cod infrumusetat 
	- cadourile nu mai apareau dupa prima runda (fixat de Askhanar) 
	* v2.2 - 25.11.2010 
	- bug reparat: cadourile dispareau de pe harta 
	- FM_Think indeparta 
	* v2.1 - 17.11.2010 
	- super spawns 
	- cvar: presents_on_map 
	- bug reparat: cadourile apareau in aer 
	- variabila globala 
	- FUN -> Fakemeta 
	- Hamsandwich 
	- optimizare mesaje HUD 
	* v1.0 - 14.11.2010 
	- plugin publicat 
	*/ 

	#include < amxmodx >
	#include < cstrike >
	#include < hamsandwich >
	#include < engine >
	#include < fakemeta >

	#pragma tabsize 0

	native csgor_get_user_keys(id);
	native csgor_set_user_keys(id,amount);
	native csgor_get_user_dusts(id);
	native csgor_set_user_dusts(id,amount);
	native csgor_get_user_cases(id);
	native csgor_set_user_cases(id,amount);
	//native csgor_get_user_skins(id,amount)
	native csgor_set_user_skins(id,skinid,amount);
	native csgor_is_user_logged(id);


	/* Model cadou */
	#define MODEL_CUTIE "models/cutie.mdl"


	/* Extras din Super Spawns */ 
	#define SS_MIN_DISTANCE 500.0
	#define SS_MAX_LOOPS 100000

	new Array:g_vecSsOrigins;
	new Array:g_vecSsSpawns;
	new Array:g_vecSsUsed;
	new Float:g_flSsMinDist;
	new g_iSsTime;

	new const g_szStarts[ ][ ] = { "info_player_start", "info_player_deathmatch" };
	new const Float:g_flOffsets[ ] = { 3500.0, 3500.0, 1500.0 };

/*
// Floats
new Float:fMaxs[ 3 ]  =  {  13.0, 13.0, 35.0  };
new Float:fMins[ 3 ]  =  {  -13.0, -13.0, 0.0  };
*/


	new pcvar_respawn_time, pcvar_presents_on_map;

	public plugin_precache( )
	{
		engfunc( EngFunc_PrecacheModel, MODEL_CUTIE );

		pcvar_presents_on_map = register_cvar( "presents_on_map", "4" );
	}

	public plugin_init( )
	{
		register_plugin( "XMAS GIFTS", "2.3.2", "KronoS" );


	// Eventuri
		//register_event( "HLTV", "spawn_gifts", "a", "1=0", "2=0" );
		RegisterHam( Ham_Killed, "player", "client_death", 1 );
		register_forward( FM_Touch, "forward_touch" );


	// Cvar-uri
		pcvar_respawn_time = register_cvar( "presents_respawn_time", "90.0" );
		//NOI
			register_cvar("box_chei","1");
			register_cvar("box_cutii","1");
			register_cvar("box_pulbere","1");
			register_cvar("box_bani","333");
			register_cvar("box_skin_max","80");


		SsInit( 800.0 );
		SsScan( );

		XGIFTS_Spawn( );
	}


	public spawn_gifts( )	XGIFTS_Spawn( );


	public XGIFTS_Spawn( )
	{
		new Float:fOrigin[ 3 ];//xxx
		for( new i = 1; i <= get_pcvar_num( pcvar_presents_on_map ); i++ )	if ( SsGetOrigin( fOrigin ) ) XGIFTS_Create( fOrigin );
	}

	public XGIFTS_Create( const Float:fOrigin[ 3 ] )
	{
		//create
		new ent = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );

		if ( pev_valid( ent ) )
		{
			set_pev( ent, pev_classname, "csgo_supplybox" );

			engfunc( EngFunc_SetOrigin, ent, fOrigin );
			engfunc( EngFunc_SetModel, ent, MODEL_CUTIE );
			//entity_set_int(  ent, EV_INT_movetype, MOVETYPE_NONE  );
			set_pev( ent, pev_solid, SOLID_BBOX );
			static Float:fMaxs[ 3 ] = { 2.0, 2.0, 4.0 };
			static Float:fMins[ 3 ] = { -2.0, -2.0, -4.0 };
			engfunc( EngFunc_SetSize, ent, fMins, fMaxs );

			engfunc( EngFunc_DropToFloor, ent );
			//drop_to_floor(  ent  );
		}
		//return 1;
	}

	public XGIFTS_Respawn( iOrigin[ ] )
	{
		new Float:fOrigin[ 3 ], auxOrigin[ 3 ];
		auxOrigin[ 0 ] = iOrigin[ 0 ];
		auxOrigin[ 1 ] = iOrigin[ 1 ];
		auxOrigin[ 2 ] = iOrigin[ 2 ];

		IVecFVec( auxOrigin, fOrigin );
		XGIFTS_Create( fOrigin );

		set_hudmessage(255, 165, 0, 0.02, 0.73, 0, 6.0, 5.0,0.1,0.2,-1);
		show_hudmessage(0,"Tocmai a fost aruncata o cutie pe mapa!^nCautati-o pentru a afla ce ascunde.");

		return 0;
	}

	public forward_touch( const ent, const id )
	{
		if ( !pev_valid( ent )||!is_user_alive( id )/*||!( 1 <= id <= 32 )*/ )	return FMRES_IGNORED;

		static class[ 20 ];
		pev( ent, pev_classname, class, sizeof class - 1 );
		if ( !equal( class, "csgo_supplybox" ) ) return FMRES_IGNORED;

		set_pev( ent, pev_solid, SOLID_NOT );
		set_pev( ent, pev_effects, EF_NODRAW );

		if ( get_pcvar_float( pcvar_respawn_time ) > 0.0 )
		{
			//new iParm[ 3 ];
			new Float:flOrigin[ 3 ], iOrigin[ 3 ];
			entity_get_vector( ent, EV_VEC_origin, flOrigin );
			FVecIVec( flOrigin, iOrigin );
			/*iParm[ 0 ] = iOrigin[ 0 ];
			iParm[ 1 ] = iOrigin[ 1 ];
			iParm[ 2 ] = iOrigin[ 2 ];*/
			set_task( get_pcvar_float( pcvar_respawn_time ), "XGIFTS_Respawn", _, /*iParm*/iOrigin, 3 );
		} 

		switch ( random_num( 0, 4 ) )
		{
			case 0:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_keys(id,csgor_get_user_keys(id)+get_cvar_num("box_chei"));
					client_print(id,print_chat,"Super!Ai primit +%d chei%s",get_cvar_num("box_chei"),get_cvar_num("box_chei")==1?"e":"");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 1:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_cases(id,csgor_get_user_cases(id)+get_cvar_num("box_cutii"));
					client_print(id,print_chat,"Super!Ai primit +%d cuti%s",get_cvar_num("box_cutii"),get_cvar_num("box_cutii")==1?"e":"i");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 2:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_dusts(id,csgor_get_user_dusts(id)+get_cvar_num("box_pulbere"));
					client_print(id,print_chat,"Super!Ai primit +%d pulber%s",get_cvar_num("box_pulbere"),get_cvar_num("box_pulbere")==1?"e":"i");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 3:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_skins(id,random_num(0,get_cvar_num("box_skin_max")),1);
					client_print(id,print_chat,"Super!Ai primit +1 skin");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 4: Bani(id);
		}
		//remove_entity( ent );
		return FMRES_IGNORED;//0
	}

	public Bani(id)
	{
		cs_set_user_money(id,cs_get_user_money(id)+get_cvar_num("box_bani"),1);
		client_print(id,print_chat,"Super!Ai primit +%d$",get_cvar_num("box_bani"));
	}

	// Super spawns 
	public SsInit( Float:mindist )
	{
		g_flSsMinDist = mindist;
		g_vecSsOrigins = ArrayCreate( 3, 1 );
		g_vecSsSpawns = ArrayCreate( 3, 1 );
		g_vecSsUsed = ArrayCreate( 3, 1 );
	}

	stock SsClean( ) 
	{
		g_flSsMinDist = 0.0;
		ArrayClear( g_vecSsOrigins );
		ArrayClear( g_vecSsSpawns );
		ArrayClear( g_vecSsUsed );
	}

	stock SsGetOrigin( Float:origin[ 3 ] )
	{
		new Float:data[3], size;
		new ok = 1;

		while( ( size = ArraySize( g_vecSsOrigins ) ) )
		{
			new idx = random_num( 0, size - 1 );
			ArrayGetArray( g_vecSsOrigins, idx, origin );

			new used = ArraySize( g_vecSsUsed );
			for( new i = 0; i < used; i++ )
			{
				ok = 0;
				ArrayGetArray( g_vecSsUsed, i, data );
				if( get_distance_f( data, origin ) >= g_flSsMinDist )
				{
					ok = 1;
					break;
				}
			}

			ArrayDeleteItem( g_vecSsOrigins, idx );

			if ( ok ) 
			{ 
				ArrayPushArray( g_vecSsUsed, origin );
				return true;
			}
		}

		return false;
	}

	public SsScan( )
	{
		new start, Float:origin[ 3 ], starttime;
		starttime = get_systime( );

		for( start = 0; start < sizeof( g_szStarts ); start++ )
		{
			server_print( "Searching for %s", g_szStarts[ start ] );

			new ent;
			if( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", g_szStarts[ start ] ) ) )
			{
				new counter;

				pev( ent, pev_origin, origin );
				ArrayPushArray( g_vecSsSpawns, origin );

				while ( counter < SS_MAX_LOOPS ) counter = GetLocation( origin, counter );
			}
		}

		g_iSsTime = get_systime( );
		g_iSsTime -= starttime;
	}

	GetLocation( Float:start[ 3 ], &counter )
	{
		new Float:end[ 3 ];
		for( new i = 0; i < 3; i++ ) end[ i ] += random_float( 0.0 - g_flOffsets[ i ], g_flOffsets[ i ] );

		if( IsValid( start, end ) )
		{
			start[ 0 ] = end[ 0 ];
			start[ 1 ] = end[ 1 ];
			start[ 2 ] = end[ 2 ];

			ArrayPushArray( g_vecSsOrigins, end );
		}

		counter ++;

		return counter;
	}

	IsValid( Float:start[ 3 ], Float:end[ 3 ] )
	{
		SetFloor( end );
		end[ 2 ] += 36.0;
		new point = engfunc( EngFunc_PointContents, end );
		if( point == CONTENTS_EMPTY ) if ( CheckPoints( end ) && CheckDistance( end ) && CheckVisibility( start, end ) ) if ( !trace_hull( end, HULL_LARGE, -1 ) ) return true;

		return false;
	}

	CheckVisibility( Float:start[ 3 ], Float:end[ 3 ] )
	{
		new tr; 
		engfunc( EngFunc_TraceLine, start, end, IGNORE_GLASS, -1, tr );

		return ( get_tr2( tr, TR_pHit ) < 0 );
	}

	SetFloor( Float:start[ 3 ] )
	{
		new tr, Float:end[ 3 ];
		end[ 0 ] = start[ 0 ];
		end[ 1 ] = start[ 1 ];
		end[ 2 ] = -99999.9;
		engfunc( EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, start );
	}

	CheckPoints( Float:origin[ 3 ] )
	{
		new Float:data[ 3 ], tr, point;
		data[ 0 ] = origin[ 0 ];
		data[ 1 ] = origin[ 1 ];
		data[ 2 ] = 99999.9;

		engfunc( EngFunc_TraceLine, origin, data, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, data );
		point = engfunc( EngFunc_PointContents, data );

		if ( point == CONTENTS_SKY && get_distance_f( origin, data ) < 250.0 ) return false;

		data[ 2 ] = -99999.9;

		engfunc( EngFunc_TraceLine, origin, data, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, data );
		point = engfunc( EngFunc_PointContents, data );

		if ( point < CONTENTS_SOLID ) return false;

		return true;
	}

	CheckDistance( Float:origin[ 3 ] )
	{
		new Float:dist, Float:data[ 3 ];

		new count = ArraySize( g_vecSsSpawns );
		for( new i = 0; i < count; i++ ) 
		{
			ArrayGetArray( g_vecSsSpawns, i, data );
			dist = get_distance_f( origin, data );
			if( dist < SS_MIN_DISTANCE ) return false;
		}

		count = ArraySize( g_vecSsOrigins );
		for( new i = 0; i < count; i++ )
		{
			ArrayGetArray( g_vecSsOrigins, i, data );
			dist = get_distance_f( origin, data );
			if( dist < SS_MIN_DISTANCE ) return false;
		}

		return true;
	}

	stock fm_find_ent_by_owner(index, const classname[], owner, jghgtype = 0) {
		new strtype[11] = "classname", ent = index;
		switch (jghgtype) {
			case 1: strtype = "target";
			case 2: strtype = "targetname";
		}

		while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner) {}

		return ent;
	}
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
* Inactiv momentan.
eXtreamSHOP
User avatar
1TAP GOD
Membru, skill 0
Membru, skill 0
Posts: 65
Joined: 02 Sep 2018, 23:20
Detinator Steam: Da
CS Status: Be The Best And Fuck The Rest
SteamID: assasinssmdfk
Fond eXtream: 0
Been thanked: 1 time
Contact:

12 Apr 2019, 22:16

pluginul merge dar nu cad cutile
Daca vreti ceva da-ti add aici https://steamcommunity.com/id/assasinssmdfk/
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2155
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 349 times
Contact:

12 Apr 2019, 22:30

ai testat ce am dat mai sus?
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
* Inactiv momentan.
User avatar
1TAP GOD
Membru, skill 0
Membru, skill 0
Posts: 65
Joined: 02 Sep 2018, 23:20
Detinator Steam: Da
CS Status: Be The Best And Fuck The Rest
SteamID: assasinssmdfk
Fond eXtream: 0
Been thanked: 1 time
Contact:

12 Apr 2019, 22:38

dap,asta nu da eroarea aia dar sunt pe sv de 30 min cred si nu da spaw
edit: poti face un meniu sa adaug eu si sa sterg cutii pe mapa doar sa vad daca merge ?
Daca vreti ceva da-ti add aici https://steamcommunity.com/id/assasinssmdfk/
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2155
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 349 times
Contact:

13 Apr 2019, 00:06

pluginu rulează??

Code: Select all

	/* 
	Plugin: Xmas Gifts 2.3.2 
	Autor: KronoS # GG 

	Credite: 
	@FakeNick - pentru pluginul Pick up present de unde a pornit tot 
	@joropito - pentru Super Spawns 
	@Askhanar - pentru fixarea Super Spawns 

	Cvar-uri: 
	- presents_respawn_time 60.0 (Dupa cat timp dupa ridicarea unui cadou apare altul pe harta) 
	- presents_on_map 11 (Cate cadouri sa apara pe harta) 
		ATENTIE*: Se calculeaza numarul cvar-ului - 1!!! 
			Daca puneti 11 or sa apara doar 10 cadouri! 

	Changelog: 

	* v2.3.2 - 28.12.2012 
	- cadourile primeau respawn chiar daca timpul era setat pe 0.0 
	* v2.3.1 - 28.12.2012 
	- cadourile nu primeau respawn 
	* v2.3 - 28.12.2012 
	- cod infrumusetat 
	- cadourile nu mai apareau dupa prima runda (fixat de Askhanar) 
	* v2.2 - 25.11.2010 
	- bug reparat: cadourile dispareau de pe harta 
	- FM_Think indeparta 
	* v2.1 - 17.11.2010 
	- super spawns 
	- cvar: presents_on_map 
	- bug reparat: cadourile apareau in aer 
	- variabila globala 
	- FUN -> Fakemeta 
	- Hamsandwich 
	- optimizare mesaje HUD 
	* v1.0 - 14.11.2010 
	- plugin publicat 
	*/ 

	#include < amxmodx >
	#include < cstrike >
	#include < hamsandwich >
	#include < engine >
	#include < fakemeta >

	#pragma tabsize 0

	native csgor_get_user_keys(id);
	native csgor_set_user_keys(id,amount);
	native csgor_get_user_dusts(id);
	native csgor_set_user_dusts(id,amount);
	native csgor_get_user_cases(id);
	native csgor_set_user_cases(id,amount);
	//native csgor_get_user_skins(id,amount)
	native csgor_set_user_skins(id,skinid,amount);
	native csgor_is_user_logged(id);


	/* Model cadou */
	#define MODEL_CUTIE "models/cutie.mdl"


	/* Extras din Super Spawns */ 
	#define SS_MIN_DISTANCE 500.0
	#define SS_MAX_LOOPS 100000

	new Array:g_vecSsOrigins;
	new Array:g_vecSsSpawns;
	new Array:g_vecSsUsed;
	new Float:g_flSsMinDist;
	new g_iSsTime;

	new const g_szStarts[ ][ ] = { "info_player_start", "info_player_deathmatch" };
	new const Float:g_flOffsets[ ] = { 3500.0, 3500.0, 1500.0 };

/*
// Floats
new Float:fMaxs[ 3 ]  =  {  13.0, 13.0, 35.0  };
new Float:fMins[ 3 ]  =  {  -13.0, -13.0, 0.0  };
*/


	new pcvar_respawn_time, pcvar_presents_on_map;

	public plugin_precache( )
	{
		pcvar_presents_on_map = register_cvar( "presents_on_map", "4" );
	
		engfunc( EngFunc_PrecacheModel, MODEL_CUTIE );
	}

	public plugin_init( )
	{
		register_plugin( "XMAS GIFTS", "2.3.2", "KronoS" );


	// Eventuri
		register_event( "HLTV", "spawn_gifts", "a", "1=0", "2=0" );
		//register_logevent("spawn_gifts"", 2, "1=Round_Start")
		RegisterHam( Ham_Killed, "player", "client_death", 1 );
		register_forward( FM_Touch, "forward_touch" );


	// Cvar-uri
		pcvar_respawn_time = register_cvar( "presents_respawn_time", "90.0" );
		//NOI
			register_cvar("box_chei","1");
			register_cvar("box_cutii","1");
			register_cvar("box_pulbere","1");
			register_cvar("box_bani","333");
			register_cvar("box_skin_max","80");


		SsInit( 800.0 );
		SsScan( );

		XGIFTS_Spawn( );
	}


	public spawn_gifts( )	XGIFTS_Spawn( );


	public XGIFTS_Spawn( )
	{
		new Float: fOrigin[ 3 ];//xxx
		for( new i = 0; i <= get_pcvar_num( pcvar_presents_on_map ); i++ )	if ( SsGetOrigin( fOrigin ) ) XGIFTS_Create( fOrigin );
	}

	public XGIFTS_Create( const Float:fOrigin[ 3 ] )
	{
		//create
		new ent = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );

		if ( pev_valid( ent ) )
		{
			set_pev( ent, pev_classname, "csgo_supplybox" );

			engfunc( EngFunc_SetOrigin, ent, fOrigin );
			engfunc( EngFunc_SetModel, ent, MODEL_CUTIE );
			//entity_set_int(  ent, EV_INT_movetype, MOVETYPE_NONE  );
			set_pev( ent, pev_solid, SOLID_BBOX );
			static Float:fMaxs[ 3 ] = { 2.0, 2.0, 4.0 };
			static Float:fMins[ 3 ] = { -2.0, -2.0, -4.0 };
			engfunc( EngFunc_SetSize, ent, fMins, fMaxs );

			engfunc( EngFunc_DropToFloor, ent );
			//drop_to_floor(  ent  );
		}
		return 1;
	}

	public XGIFTS_Respawn( iOrigin[ ] )
	{
		new Float:fOrigin[ 3 ], auxOrigin[ 3 ];
		auxOrigin[ 0 ] = iOrigin[ 0 ];
		auxOrigin[ 1 ] = iOrigin[ 1 ];
		auxOrigin[ 2 ] = iOrigin[ 2 ];

		IVecFVec( auxOrigin, fOrigin );
		XGIFTS_Create( fOrigin );

		set_hudmessage(255, 165, 0, 0.02, 0.73, 0, 6.0, 5.0,0.1,0.2,-1);
		show_hudmessage(0,"Tocmai a fost aruncata o cutie pe mapa!^nCautati-o pentru a afla ce ascunde.");

		return 0;
	}

	public forward_touch( const ent, const id )
	{
		if ( !pev_valid( ent )||!is_user_alive( id )/*||!( 1 <= id <= 32 )*/ )	return FMRES_IGNORED;

		static class[ 20 ];
		pev( ent, pev_classname, class, sizeof class - 1 );
		if ( !equal( class, "csgo_supplybox" ) ) return FMRES_IGNORED;

		set_pev( ent, pev_solid, SOLID_NOT );
		set_pev( ent, pev_effects, EF_NODRAW );

		if ( get_pcvar_float( pcvar_respawn_time ) > 0.0 )
		{
			//new iParm[ 3 ];
			new Float:flOrigin[ 3 ], iOrigin[ 3 ];
			entity_get_vector( ent, EV_VEC_origin, flOrigin );
			FVecIVec( flOrigin, iOrigin );
			/*iParm[ 0 ] = iOrigin[ 0 ];
			iParm[ 1 ] = iOrigin[ 1 ];
			iParm[ 2 ] = iOrigin[ 2 ];*/
			set_task( get_pcvar_float( pcvar_respawn_time ), "XGIFTS_Respawn", _, /*iParm*/iOrigin, 3 );
		} 

		switch ( random_num( 0, 4 ) )
		{
			case 0:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_keys(id,csgor_get_user_keys(id)+get_cvar_num("box_chei"));
					client_print(id,print_chat,"Super!Ai primit +%d chei%s",get_cvar_num("box_chei"),get_cvar_num("box_chei")==1?"e":"");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 1:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_cases(id,csgor_get_user_cases(id)+get_cvar_num("box_cutii"));
					client_print(id,print_chat,"Super!Ai primit +%d cuti%s",get_cvar_num("box_cutii"),get_cvar_num("box_cutii")==1?"e":"i");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 2:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_dusts(id,csgor_get_user_dusts(id)+get_cvar_num("box_pulbere"));
					client_print(id,print_chat,"Super!Ai primit +%d pulber%s",get_cvar_num("box_pulbere"),get_cvar_num("box_pulbere")==1?"e":"i");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 3:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_skins(id,random_num(0,get_cvar_num("box_skin_max")),1);
					client_print(id,print_chat,"Super!Ai primit +1 skin");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 4: Bani(id);
		}
		//remove_entity( ent );
		return FMRES_IGNORED;//0
	}

	public Bani(id)
	{
		cs_set_user_money(id,cs_get_user_money(id)+get_cvar_num("box_bani"),1);
		client_print(id,print_chat,"Super!Ai primit +%d$",get_cvar_num("box_bani"));
		return PLUGIN_HANDLED;
	}

	// Super spawns 
	public SsInit( Float:mindist )
	{
		g_flSsMinDist = mindist;
		g_vecSsOrigins = ArrayCreate( 3, 1 );
		g_vecSsSpawns = ArrayCreate( 3, 1 );
		g_vecSsUsed = ArrayCreate( 3, 1 );
	}

	stock SsClean( ) 
	{
		g_flSsMinDist = 0.0;
		ArrayClear( g_vecSsOrigins );
		ArrayClear( g_vecSsSpawns );
		ArrayClear( g_vecSsUsed );
	}

	stock SsGetOrigin( Float:origin[ 3 ] )
	{
		new Float:data[3], size;
		new ok = 1;

		while( ( size = ArraySize( g_vecSsOrigins ) ) )
		{
			new idx = random_num( 0, size - 1 );
			ArrayGetArray( g_vecSsOrigins, idx, origin );

			new used = ArraySize( g_vecSsUsed );
			for( new i = 0; i < used; i++ )
			{
				ok = 0;
				ArrayGetArray( g_vecSsUsed, i, data );
				if( get_distance_f( data, origin ) >= g_flSsMinDist )
				{
					ok = 1;
					break;
				}
			}

			ArrayDeleteItem( g_vecSsOrigins, idx );

			if ( ok ) 
			{ 
				ArrayPushArray( g_vecSsUsed, origin );
				return true;
			}
		}

		return false;
	}

	public SsScan( )
	{
		new start, Float:origin[ 3 ], starttime;
		starttime = get_systime( );

		for( start = 0; start < sizeof( g_szStarts ); start++ )
		{
			server_print( "Searching for %s", g_szStarts[ start ] );

			new ent;
			if( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", g_szStarts[ start ] ) ) )
			{
				new counter;

				pev( ent, pev_origin, origin );
				ArrayPushArray( g_vecSsSpawns, origin );

				while ( counter < SS_MAX_LOOPS ) counter = GetLocation( origin, counter );
			}
		}

		g_iSsTime = get_systime( );
		g_iSsTime -= starttime;
	}

	GetLocation( Float:start[ 3 ], &counter )
	{
		new Float:end[ 3 ];
		for( new i = 0; i < 3; i++ ) end[ i ] += random_float( 0.0 - g_flOffsets[ i ], g_flOffsets[ i ] );

		if( IsValid( start, end ) )
		{
			start[ 0 ] = end[ 0 ];
			start[ 1 ] = end[ 1 ];
			start[ 2 ] = end[ 2 ];

			ArrayPushArray( g_vecSsOrigins, end );
		}

		counter ++;

		return counter;
	}

	IsValid( Float:start[ 3 ], Float:end[ 3 ] )
	{
		SetFloor( end );
		end[ 2 ] += 36.0;
		new point = engfunc( EngFunc_PointContents, end );
		if( point == CONTENTS_EMPTY ) if ( CheckPoints( end ) && CheckDistance( end ) && CheckVisibility( start, end ) ) if ( !trace_hull( end, HULL_LARGE, -1 ) ) return true;

		return false;
	}

	CheckVisibility( Float:start[ 3 ], Float:end[ 3 ] )
	{
		new tr; 
		engfunc( EngFunc_TraceLine, start, end, IGNORE_GLASS, -1, tr );

		return ( get_tr2( tr, TR_pHit ) < 0 );
	}

	SetFloor( Float:start[ 3 ] )
	{
		new tr, Float:end[ 3 ];
		end[ 0 ] = start[ 0 ];
		end[ 1 ] = start[ 1 ];
		end[ 2 ] = -99999.9;
		engfunc( EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, start );
	}

	CheckPoints( Float:origin[ 3 ] )
	{
		new Float:data[ 3 ], tr, point;
		data[ 0 ] = origin[ 0 ];
		data[ 1 ] = origin[ 1 ];
		data[ 2 ] = 99999.9;

		engfunc( EngFunc_TraceLine, origin, data, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, data );
		point = engfunc( EngFunc_PointContents, data );

		if ( point == CONTENTS_SKY && get_distance_f( origin, data ) < 250.0 ) return false;

		data[ 2 ] = -99999.9;

		engfunc( EngFunc_TraceLine, origin, data, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, data );
		point = engfunc( EngFunc_PointContents, data );

		if ( point < CONTENTS_SOLID ) return false;

		return true;
	}

	CheckDistance( Float:origin[ 3 ] )
	{
		new Float:dist, Float:data[ 3 ];

		new count = ArraySize( g_vecSsSpawns );
		for( new i = 0; i < count; i++ ) 
		{
			ArrayGetArray( g_vecSsSpawns, i, data );
			dist = get_distance_f( origin, data );
			if( dist < SS_MIN_DISTANCE ) return false;
		}

		count = ArraySize( g_vecSsOrigins );
		for( new i = 0; i < count; i++ )
		{
			ArrayGetArray( g_vecSsOrigins, i, data );
			dist = get_distance_f( origin, data );
			if( dist < SS_MIN_DISTANCE ) return false;
		}

		return true;
	}

	stock fm_find_ent_by_owner(index, const classname[], owner, jghgtype = 0) {
		new strtype[11] = "classname", ent = index;
		switch (jghgtype) {
			case 1: strtype = "target";
			case 2: strtype = "targetname";
		}

		while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner) {}

		return ent;
	}
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
* Inactiv momentan.
User avatar
1TAP GOD
Membru, skill 0
Membru, skill 0
Posts: 65
Joined: 02 Sep 2018, 23:20
Detinator Steam: Da
CS Status: Be The Best And Fuck The Rest
SteamID: assasinssmdfk
Fond eXtream: 0
Been thanked: 1 time
Contact:

13 Apr 2019, 00:40

dap,pluginul ruleaza dar nu cad cutii
edit am bagat ce ai dat acum si

L 04/13/2019 - 01:44:57: Invalid array handle provided (0)
L 04/13/2019 - 01:44:57: [AMXX] Displaying debug trace (plugin "csgo_box.amxx")
L 04/13/2019 - 01:44:57: [AMXX] Run time error 10: native error (native "ArraySize")
L 04/13/2019 - 01:44:57: [AMXX] [0] csgo_box.sma::SsGetOrigin (line 281)
L 04/13/2019 - 01:44:57: [AMXX] [1] csgo_box.sma::XGIFTS_Spawn (line 127)
L 04/13/2019 - 01:44:57: [AMXX] [2] csgo_box.sma::spawn_gifts (line 121)
Daca vreti ceva da-ti add aici https://steamcommunity.com/id/assasinssmdfk/
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2155
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 349 times
Contact:

13 Apr 2019, 11:19

nu știu ce are la tine, eu am folosit codu în trecut și nu am avut probleme

Code: Select all

	/* 
	Plugin: Xmas Gifts 2.3.2 
	Autor: KronoS # GG 

	Credite: 
	@FakeNick - pentru pluginul Pick up present de unde a pornit tot 
	@joropito - pentru Super Spawns 
	@Askhanar - pentru fixarea Super Spawns 

	Cvar-uri: 
	- presents_respawn_time 60.0 (Dupa cat timp dupa ridicarea unui cadou apare altul pe harta) 
	- presents_on_map 11 (Cate cadouri sa apara pe harta) 
		ATENTIE*: Se calculeaza numarul cvar-ului - 1!!! 
			Daca puneti 11 or sa apara doar 10 cadouri! 

	Changelog: 

	* v2.3.2 - 28.12.2012 
	- cadourile primeau respawn chiar daca timpul era setat pe 0.0 
	* v2.3.1 - 28.12.2012 
	- cadourile nu primeau respawn 
	* v2.3 - 28.12.2012 
	- cod infrumusetat 
	- cadourile nu mai apareau dupa prima runda (fixat de Askhanar) 
	* v2.2 - 25.11.2010 
	- bug reparat: cadourile dispareau de pe harta 
	- FM_Think indeparta 
	* v2.1 - 17.11.2010 
	- super spawns 
	- cvar: presents_on_map 
	- bug reparat: cadourile apareau in aer 
	- variabila globala 
	- FUN -> Fakemeta 
	- Hamsandwich 
	- optimizare mesaje HUD 
	* v1.0 - 14.11.2010 
	- plugin publicat 
	*/ 

	#include < amxmodx >
	#include < cstrike >
	#include < hamsandwich >
	#include < engine >
	#include < fakemeta >

	#pragma tabsize 0

	native csgor_get_user_keys(id);
	native csgor_set_user_keys(id,amount);
	native csgor_get_user_dusts(id);
	native csgor_set_user_dusts(id,amount);
	native csgor_get_user_cases(id);
	native csgor_set_user_cases(id,amount);
	//native csgor_get_user_skins(id,amount)
	native csgor_set_user_skins(id,skinid,amount);
	native csgor_is_user_logged(id);
	new const g_szFmuGiftClassName[ ] = "csgo_supplybox";


	/* Model cadou */
	#define MODEL_CUTIE "models/cutie.mdl"


	/* Super-Spawns */ 
	#define SS_VERSION "1.0"
	#define SS_MIN_DISTANCE 250.0
	#define SS_MAX_LOOPS 100000

	new Array:g_vecSsOrigins;
	new Array:g_vecSsSpawns;
	new Array:g_vecSsUsed;
	new Float:g_flSsMinDist;
	new g_iSsTime;

	new const g_szStarts[ ][ ] = { "info_player_start", "info_player_deathmatch" };
	new const Float:g_flOffsets[ ] = { 3500.0, 3500.0, 1500.0 };

	// Floats
	static Float:fMaxs[ 3 ] = { 13.0, 13.0, 35.0 };
	static Float:fMins[ 3 ] = { -13.0, -13.0, 0.0 };


	new pcvar_respawn_time, pcvar_presents_on_map;

	public plugin_precache( )
	{
		// Cvar-uri
		pcvar_presents_on_map = register_cvar( "presents_on_map", "4" );
		pcvar_respawn_time = register_cvar( "presents_respawn_time", "90.0" );
	
		precache_model( MODEL_CUTIE );
	}

	public plugin_init( )
	{
		register_plugin( "XMAS GIFTS", "2.3.2", "KronoS" );


	// Eventuri
		register_event( "HLTV", "spawn_gifts", "a", "1=0", "2=0" );
		//register_logevent("spawn_gifts"", 2, "1=Round_Start")
		RegisterHam( Ham_Killed, "player", "client_death", 1 );
		//register_forward( FM_Touch, "forward_touchX" );
		register_touch( g_szFmuGiftClassName, "player", "forward_touchX" );


		//NOI
			register_cvar("box_chei","1");
			register_cvar("box_cutii","1");
			register_cvar("box_pulbere","1");
			register_cvar("box_bani","333");
			register_cvar("box_skin_max","80");


		SsInit( 800.0 );
		SsScan( );

		XGIFTS_Spawn( );
	}


	public spawn_gifts( )	XGIFTS_Spawn( );


	public XGIFTS_Spawn( )
	{
		new Float: fOrigin[ 3 ];//xxx
		for( new i = 0; i < get_pcvar_num( pcvar_presents_on_map ); i++ )	if( SsGetOrigin( fOrigin ) )	XGIFTS_Create( fOrigin );
	}

	public XGIFTS_Create( const Float:fOrigin[ 3 ] )
	{
		//create
		new ent = create_entity( "info_target" );	//engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );
		if( !is_valid_ent( ent ) ) return 0;
		
		//if ( pev_valid( ent ) )
		//{
			entity_set_string( ent, EV_SZ_classname, g_szFmuGiftClassName );

			entity_set_origin( ent, fOrigin );
			entity_set_model( ent, MODEL_CUTIE );
			entity_set_int( ent, EV_INT_movetype, MOVETYPE_NONE  );
			entity_set_int( ent, EV_INT_solid, SOLID_BBOX );
			entity_set_size( ent, fMins, fMaxs );

			//engfunc( EngFunc_DropToFloor, ent );
			drop_to_floor( ent );
		//}
		return 1;
	}

	public XGIFTS_Respawn( iOrigin[ ] )
	{
		new Float:fOrigin[ 3 ], auxOrigin[ 3 ];
		auxOrigin[ 0 ] = iOrigin[ 0 ];
		auxOrigin[ 1 ] = iOrigin[ 1 ];
		auxOrigin[ 2 ] = iOrigin[ 2 ];

		IVecFVec( auxOrigin, fOrigin );
		XGIFTS_Create( fOrigin );

		set_hudmessage(255, 165, 0, 0.02, 0.73, 0, 6.0, 5.0,0.1,0.2,-1);
		show_hudmessage(0,"Tocmai a fost aruncata o cutie pe mapa!^nCautati-o pentru a afla ce ascunde.");

		return 0;
	}

	public forward_touchX( ent, id )
	{
		/*if ( !pev_valid( ent )||!is_user_alive( id ) )	return FMRES_IGNORED;

		static class[ 35 ];
		pev( ent, pev_classname, class, sizeof class - 1 );
		if ( !equal( class, "csgo_supplybox" ) ) return FMRES_IGNORED;

		set_pev( ent, pev_solid, SOLID_NOT );
		set_pev( ent, pev_effects, EF_NODRAW );*/
		if( is_valid_ent( ent ) && ( 1 <= id <= 32 ) && is_user_alive( id ) )
		{
		if ( get_pcvar_float( pcvar_respawn_time ) > 0.0 )
		{
			new iParm[ 3 ];
			new Float:flOrigin[ 3 ], iOrigin[ 3 ];
			entity_get_vector( ent, EV_VEC_origin, flOrigin );
			FVecIVec( flOrigin, iOrigin );
			iParm[ 0 ] = iOrigin[ 0 ];
			iParm[ 1 ] = iOrigin[ 1 ];
			iParm[ 2 ] = iOrigin[ 2 ];
			set_task( get_pcvar_float( pcvar_respawn_time ), "XGIFTS_Respawn", _, iParm, 3 );
		}

		switch( random_num( 0, 4 ) )
		{
			case 0:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_keys(id,csgor_get_user_keys(id)+get_cvar_num("box_chei"));
					client_print(id,print_chat,"Super!Ai primit +%d chei%s",get_cvar_num("box_chei"),get_cvar_num("box_chei")==1?"e":"");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 1:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_cases(id,csgor_get_user_cases(id)+get_cvar_num("box_cutii"));
					client_print(id,print_chat,"Super!Ai primit +%d cuti%s",get_cvar_num("box_cutii"),get_cvar_num("box_cutii")==1?"e":"i");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 2:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_dusts(id,csgor_get_user_dusts(id)+get_cvar_num("box_pulbere"));
					client_print(id,print_chat,"Super!Ai primit +%d pulber%s",get_cvar_num("box_pulbere"),get_cvar_num("box_pulbere")==1?"e":"i");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 3:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_skins(id,random_num(0,get_cvar_num("box_skin_max")),1);
					client_print(id,print_chat,"Super!Ai primit +1 skin");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 4: Bani(id);
		}
		remove_entity( ent );
		}
		return 0//FMRES_IGNORED;/
	}

	public Bani(id)
	{
		cs_set_user_money(id,cs_get_user_money(id)+get_cvar_num("box_bani"),1);
		client_print(id,print_chat,"Super!Ai primit +%d$",get_cvar_num("box_bani"));
		return PLUGIN_HANDLED;
	}

	
	// Super spawns
	
public SsDump()
{
	new Float:origin[3];
	new count = ArraySize(g_vecSsOrigins);
	server_print("-------------------------------------------------------");
	for(new i = 0; i < count; i++)
	{
		ArrayGetArray(g_vecSsOrigins, i, origin);
		server_print("Origin: %f %f %f", origin[0], origin[1], origin[2]);
	}
	server_print("-------------------------------------------------------");
	server_print("Number of origins: %i", count);
	server_print("Time: %i", g_iSsTime);
	server_print("-------------------------------------------------------");
}
	
	public SsInit( Float:mindist )
	{
	register_cvar("sv_superspawns", SS_VERSION, (FCVAR_SERVER|FCVAR_SPONLY));
	register_concmd("_ss_dump", "SsDump");
	
		g_flSsMinDist = mindist;
		
		g_vecSsOrigins = ArrayCreate( 3, 1 );
		g_vecSsSpawns = ArrayCreate( 3, 1 );
		g_vecSsUsed = ArrayCreate( 3, 1 );
	}

	stock SsClean( ) 
	{
		g_flSsMinDist = 0.0;
		
		ArrayClear( g_vecSsOrigins );
		ArrayClear( g_vecSsSpawns );
		ArrayClear( g_vecSsUsed );
	}

	stock SsGetOrigin( Float:origin[ 3 ] )
	{
		new Float:data[3], size;
		new ok = 1;

		while( ( size = ArraySize( g_vecSsOrigins ) ) )
		{
			new idx = random_num( 0, size - 1 );
			ArrayGetArray( g_vecSsOrigins, idx, origin );

			new used = ArraySize( g_vecSsUsed );
			for( new i = 0; i < used; i++ )
			{
				ok = 0;
				ArrayGetArray( g_vecSsUsed, i, data );
				if( get_distance_f( data, origin ) >= g_flSsMinDist )
				{
					ok = 1;
					break;
				}
			}

			ArrayDeleteItem( g_vecSsOrigins, idx );

			if ( ok ) 
			{ 
				ArrayPushArray( g_vecSsUsed, origin );
				return true;
			}
		}
		return false;
	}

	public SsScan( )
	{
		new start, Float:origin[ 3 ], starttime;
		starttime = get_systime( );

		for( start = 0; start < sizeof( g_szStarts ); start++ )
		{
			server_print( "Searching for %s", g_szStarts[ start ] );

			new ent;
			if( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", g_szStarts[ start ] ) ) )
			{
				new counter;

				pev( ent, pev_origin, origin );
				ArrayPushArray( g_vecSsSpawns, origin );

				while ( counter < SS_MAX_LOOPS ) counter = GetLocation( origin, counter );
			}
		}

		g_iSsTime = get_systime( );
		g_iSsTime -= starttime;
	}

	GetLocation( Float:start[ 3 ], &counter )
	{
		new Float:end[ 3 ];
		for( new i = 0; i < 3; i++ ) end[ i ] += random_float( 0.0 - g_flOffsets[ i ], g_flOffsets[ i ] );

		if( IsValid( start, end ) )
		{
			start[ 0 ] = end[ 0 ];
			start[ 1 ] = end[ 1 ];
			start[ 2 ] = end[ 2 ];

			ArrayPushArray( g_vecSsOrigins, end );
		}

		counter ++;

		return counter;
	}

	IsValid( Float:start[ 3 ], Float:end[ 3 ] )
	{
		SetFloor( end );
		end[ 2 ] += 36.0;
		new point = engfunc( EngFunc_PointContents, end );
		if( point == CONTENTS_EMPTY ) if ( CheckPoints( end ) && CheckDistance( end ) && CheckVisibility( start, end ) ) if ( !trace_hull( end, HULL_LARGE, -1 ) ) return true;

		return false;
	}

	CheckVisibility( Float:start[ 3 ], Float:end[ 3 ] )
	{
		new tr; 
		engfunc( EngFunc_TraceLine, start, end, IGNORE_GLASS, -1, tr );

		return ( get_tr2( tr, TR_pHit ) < 0 );
	}

	SetFloor( Float:start[ 3 ] )
	{
		new tr, Float:end[ 3 ];
		end[ 0 ] = start[ 0 ];
		end[ 1 ] = start[ 1 ];
		end[ 2 ] = -99999.9;
		engfunc( EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, start );
	}

	CheckPoints( Float:origin[ 3 ] )
	{
		new Float:data[ 3 ], tr, point;
		data[ 0 ] = origin[ 0 ];
		data[ 1 ] = origin[ 1 ];
		data[ 2 ] = 99999.9;

		engfunc( EngFunc_TraceLine, origin, data, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, data );
		point = engfunc( EngFunc_PointContents, data );

		if ( point == CONTENTS_SKY && get_distance_f( origin, data ) < 250.0 ) return false;

		data[ 2 ] = -99999.9;

		engfunc( EngFunc_TraceLine, origin, data, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, data );
		point = engfunc( EngFunc_PointContents, data );

		if ( point < CONTENTS_SOLID ) return false;

		return true;
	}

	CheckDistance( Float:origin[ 3 ] )
	{
		new Float:dist, Float:data[ 3 ];

		new count = ArraySize( g_vecSsSpawns );
		for( new i = 0; i < count; i++ ) 
		{
			ArrayGetArray( g_vecSsSpawns, i, data );
			dist = get_distance_f( origin, data );
			if( dist < SS_MIN_DISTANCE ) return false;
		}

		count = ArraySize( g_vecSsOrigins );
		for( new i = 0; i < count; i++ )
		{
			ArrayGetArray( g_vecSsOrigins, i, data );
			dist = get_distance_f( origin, data );
			if( dist < SS_MIN_DISTANCE ) return false;
		}

		return true;
	}
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
* Inactiv momentan.
User avatar
DevilBoy.eXe
Membru, skill +3
Membru, skill +3
Posts: 1209
Joined: 05 Jun 2016, 22:04
Detinator Steam: Da
Detinator server CS: GO/CSGO.WARED.RO
SteamID: DevilBoy_eXe
Reputatie: Fost moderator ajutator
Fond eXtream: -1
Location: beyond the time
Has thanked: 1 time
Been thanked: 1 time
Contact:

15 Apr 2019, 11:26

Intradevar are probleme
| Afiseaza codul
L 04/15/2019 - 05:25:48: Invalid array handle provided (0)
L 04/15/2019 - 05:25:48: [AMXX] Displaying debug trace (plugin "supply.amxx")
L 04/15/2019 - 05:25:48: [AMXX] Run time error 10: native error (native "ArraySize")
L 04/15/2019 - 05:25:48: [AMXX]    [0] supply.sma::SsGetOrigin (line 306)
L 04/15/2019 - 05:25:48: [AMXX]    [1] supply.sma::XGIFTS_Spawn (line 128)
L 04/15/2019 - 05:25:48: [AMXX]    [2] supply.sma::spawn_gifts (line 122)
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2155
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 349 times
Contact:

15 Apr 2019, 15:41

am intrat la el în pc, și problemele erau de la server-ul lui(cum am și zis din primele eșuări), care era local și antic, am testat pe un sv hostat linux la zi cu actualizările, și a mers fără probleme, oricum l-a postat în acel addons
aici e ultima modificare, pe care a mai cerut-o și el, glow și mesaj în chat(era hud) pentru anunțarea unei noi cutii - https://raw.githubusercontent.com/raiz0 ... plybox.sma
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
* Inactiv momentan.
User avatar
Rainq
Manager ZM
Manager ZM
Posts: 2604
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ---
Reputatie: Fost moderator
Manager ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucuresti
Been thanked: 11 times
Contact:

20 Apr 2019, 23:48

L E V I N wrote:
15 Apr 2019, 15:41
am intrat la el în pc, și problemele erau de la server-ul lui(cum am și zis din primele eșuări), care era local și antic, am testat pe un sv hostat linux la zi cu actualizările, și a mers fără probleme, oricum l-a postat în acel addons
aici e ultima modificare, pe care a mai cerut-o și el, glow și mesaj în chat(era hud) pentru anunțarea unei noi cutii - https://raw.githubusercontent.com/raiz0 ... plybox.sma
AMX Mod X Compiler 1.8.3-manual
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

Modified for www.Freakz.ro / amx.freakz.ro

plugins.sma(47) : fatal error 100: cannot read from file: "csgo_remake"

Compilation aborted.
1 Error.
Done.

Code: Select all

// LAST EDIT ON - 14.04.2019 & 23:08
	
	/* 
	Plugin: Xmas Gifts 2.3.2 
	Autor: KronoS # GG 

	Credite: 
	@FakeNick - pentru pluginul Pick up present de unde a pornit tot 
	@joropito - pentru Super Spawns 
	@Askhanar - pentru fixarea Super Spawns 

	Cvar-uri: 
	- presents_respawn_time 60.0 (Dupa cat timp dupa ridicarea unui cadou apare altul pe harta) 
	- presents_on_map 11 (Cate cadouri sa apara pe harta) 
		ATENTIE*: Se calculeaza numarul cvar-ului - 1!!! 
			Daca puneti 11 or sa apara doar 10 cadouri! 

	Changelog: 

	* v2.3.2 - 28.12.2012 
	- cadourile primeau respawn chiar daca timpul era setat pe 0.0 
	* v2.3.1 - 28.12.2012 
	- cadourile nu primeau respawn 
	* v2.3 - 28.12.2012 
	- cod infrumusetat 
	- cadourile nu mai apareau dupa prima runda (fixat de Askhanar) 
	* v2.2 - 25.11.2010 
	- bug reparat: cadourile dispareau de pe harta 
	- FM_Think indeparta 
	* v2.1 - 17.11.2010 
	- super spawns 
	- cvar: presents_on_map 
	- bug reparat: cadourile apareau in aer 
	- variabila globala 
	- FUN -> Fakemeta 
	- Hamsandwich 
	- optimizare mesaje HUD 
	* v1.0 - 14.11.2010 
	- plugin publicat 
	*/ 

	#include < amxmodx >
	#include < cstrike >
	#include < hamsandwich >
	#include < engine >
	#include < fakemeta >
	#include <csgo_remake>

	#pragma tabsize 0

	new const g_szFmuGiftClassName[ ] = "csgo_supplybox";

	/* Model cadou */
	#define MODEL_CUTIE "models/cutie.mdl"

	/* Super-Spawns */ 
	#define SS_VERSION "1.0"
	#define SS_MIN_DISTANCE 500.0
	#define SS_MAX_LOOPS 100000

	new Array:g_vecSsOrigins;
	new Array:g_vecSsSpawns;
	new Array:g_vecSsUsed;
	new Float:g_flSsMinDist;
	new g_iSsTime;

	new const g_szStarts[ ][ ] = { "info_player_start", "info_player_deathmatch" };
	new const Float:g_flOffsets[ ] = { 3500.0, 3500.0, 1500.0 };


	new pcvar_respawn_time, pcvar_presents_on_map;

	public plugin_precache( )
	{
		// Cvar-uri
		pcvar_presents_on_map = register_cvar( "presents_on_map", "4" );
		pcvar_respawn_time = register_cvar( "presents_respawn_time", "90" );
	
		precache_model( MODEL_CUTIE );
	}

	public plugin_init( )
	{
		register_plugin( "XMAS GIFTS", "2.3.2", "KronoS" );


	// Eventuri
		//register_event( "HLTV", "spawn_gifts", "a", "1=0", "2=0" );
		register_logevent("spawn_gifts", 2, "0=World triggered", "1=Round_Start")
		register_forward( FM_Touch, "forward_touch" );


		//NOI
			register_cvar("box_chei","1");
			register_cvar("box_cutii","1");
			register_cvar("box_pulbere","1");
			register_cvar("box_bani","333");
			register_cvar("box_skin_max","80");


		SsInit( 800.0 );
		SsScan( );

		XGIFTS_Spawn( );
	}


	public spawn_gifts( )	XGIFTS_Spawn( );


	public XGIFTS_Spawn( )
	{
		new Float:fOrigin[ 3 ];
		for( new i = 0; i < get_pcvar_num( pcvar_presents_on_map ); i++ )	if( SsGetOrigin( fOrigin ) )	XGIFTS_Create( fOrigin );
	}

	public XGIFTS_Create( const Float:fOrigin[ 3 ] )
	{
		new ent = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) ); 

		if( pev_valid( ent ) )
		{
			engfunc( EngFunc_SetModel, ent, MODEL_CUTIE );
			engfunc( EngFunc_SetOrigin, ent, fOrigin );
			static Float:fMaxs[ 3 ] = { 2.0, 2.0, 4.0 };
			static Float:fMins[ 3 ] = { -2.0, -2.0, -4.0 };
			set_pev( ent, pev_solid, SOLID_BBOX );
			engfunc( EngFunc_SetSize, ent, fMins, fMaxs );
			engfunc( EngFunc_DropToFloor, ent );

			set_pev( ent, pev_classname, g_szFmuGiftClassName );
			
				set_rendering( ent,
			kRenderFxGlowShell,
			255,
			0,
			0,
			kRenderNormal,
			255 );
		}
	}

	public XGIFTS_Respawn( iOrigin[ ] )
	{
		new Float:fOrigin[ 3 ], auxOrigin[ 3 ];
		auxOrigin[ 0 ] = iOrigin[ 0 ];
		auxOrigin[ 1 ] = iOrigin[ 1 ];
		auxOrigin[ 2 ] = iOrigin[ 2 ];

		IVecFVec( auxOrigin, fOrigin );
		XGIFTS_Create( fOrigin );

		client_print(0,print_chat,"Tocmai a fost aruncata o cutie pe mapa!Cautati-o pentru a afla ce ascunde.");

		return 0;
	}

	public forward_touch( ent, id )
	{
		if ( !pev_valid( ent )||!is_user_alive( id ) )	return FMRES_IGNORED;

		static class[ 35 ];
		pev( ent, pev_classname, class, sizeof class - 1 );
		if ( !equal( class, g_szFmuGiftClassName ) ) return FMRES_IGNORED;

		set_pev( ent, pev_solid, SOLID_NOT );
		set_pev( ent, pev_effects, EF_NODRAW );

		if ( get_pcvar_float( pcvar_respawn_time ) > 0.0 )
		{
			new Float:flOrigin[ 3 ], iOrigin[ 3 ];
			entity_get_vector( ent, EV_VEC_origin, flOrigin );
			FVecIVec( flOrigin, iOrigin );
			set_task( float(get_pcvar_num( pcvar_respawn_time )), "XGIFTS_Respawn", _, iOrigin, 3 );
		}

		switch( random_num( 0, 4 ) )
		{
			case 0:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_keys(id,csgor_get_user_keys(id)+get_cvar_num("box_chei"));
					client_print(id,print_chat,"Super!Ai primit +%d chei%s",get_cvar_num("box_chei"),get_cvar_num("box_chei")==1?"e":"");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 1:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_cases(id,csgor_get_user_cases(id)+get_cvar_num("box_cutii"));
					client_print(id,print_chat,"Super!Ai primit +%d cuti%s",get_cvar_num("box_cutii"),get_cvar_num("box_cutii")==1?"e":"i");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 2:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_dusts(id,csgor_get_user_dusts(id)+get_cvar_num("box_pulbere"));
					client_print(id,print_chat,"Super!Ai primit +%d pulber%s",get_cvar_num("box_pulbere"),get_cvar_num("box_pulbere")==1?"e":"i");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 3:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_skins(id,random_num(0,get_cvar_num("box_skin_max")),1);
					client_print(id,print_chat,"Super!Ai primit +1 skin");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 4: Bani(id);
		}
		return FMRES_IGNORED;
	}

	public Bani(id)
	{
		cs_set_user_money(id,cs_get_user_money(id)+get_cvar_num("box_bani"),1);
		client_print(id,print_chat,"Super!Ai primit +%d$",get_cvar_num("box_bani"));
		//return PLUGIN_HANDLED;
	}

	
	// Super spawns
	
	public SsDump( )
	{
		new Float:origin[ 3 ];
		new count = ArraySize( g_vecSsOrigins );
		server_print( "-------------------------------------------------------" );
		for( new i = 0; i < count; i++ )
		{
			ArrayGetArray( g_vecSsOrigins, i, origin );
			server_print( "Origin: %f %f %f", origin[ 0 ], origin[ 1 ], origin[ 2 ] );
		}
		server_print( "-------------------------------------------------------" );
		server_print( "Number of origins: %i", count );
		server_print( "Time: %i", g_iSsTime );
		server_print( "-------------------------------------------------------" );
	}
	
	public SsInit( Float:mindist )
	{
		register_cvar( "sv_superspawns", SS_VERSION, ( FCVAR_SERVER|FCVAR_SPONLY ) );
		register_concmd( "_ss_dump", "SsDump" );
	
		g_flSsMinDist = mindist;
		
		g_vecSsOrigins = ArrayCreate( 3, 1 );
		g_vecSsSpawns = ArrayCreate( 3, 1 );
		g_vecSsUsed = ArrayCreate( 3, 1 );
	}

	stock SsClean( ) 
	{
		g_flSsMinDist = 0.0;
		
		ArrayClear( g_vecSsOrigins );
		ArrayClear( g_vecSsSpawns );
		ArrayClear( g_vecSsUsed );
	}

	stock SsGetOrigin( Float:origin[ 3 ] )
	{
		new Float:data[ 3 ], size;
		new ok = 1;

		while( ( size = ArraySize( g_vecSsOrigins ) ) )
		{
			new idx = random_num( 0, size - 1 );
			ArrayGetArray( g_vecSsOrigins, idx, origin );

			new used = ArraySize( g_vecSsUsed );
			for( new i = 0; i < used; i++ )
			{
				ok = 0;
				ArrayGetArray( g_vecSsUsed, i, data );
				if( get_distance_f( data, origin ) >= g_flSsMinDist )
				{
					ok = 1;
					break;
				}
			}

			ArrayDeleteItem( g_vecSsOrigins, idx );

			if ( ok ) 
			{ 
				ArrayPushArray( g_vecSsUsed, origin );
				return true;
			}
		}
		return false;
	}

	public SsScan( )
	{
		new start, Float:origin[ 3 ], starttime;
		starttime = get_systime( );

		for( start = 0; start < sizeof( g_szStarts ); start++ )
		{
			server_print( "Searching for %s", g_szStarts[ start ] );

			new ent;
			if( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", g_szStarts[ start ] ) ) )
			{
				new counter;

				pev( ent, pev_origin, origin );
				ArrayPushArray( g_vecSsSpawns, origin );

				while ( counter < SS_MAX_LOOPS ) counter = GetLocation( origin, counter );
			}
		}

		g_iSsTime = get_systime( );
		g_iSsTime -= starttime;
	}

	GetLocation( Float:start[ 3 ], &counter )
	{
		new Float:end[ 3 ];
		for( new i = 0; i < 3; i++ ) end[ i ] += random_float( 0.0 - g_flOffsets[ i ], g_flOffsets[ i ] );

		if( IsValid( start, end ) )
		{
			start[ 0 ] = end[ 0 ];
			start[ 1 ] = end[ 1 ];
			start[ 2 ] = end[ 2 ];

			ArrayPushArray( g_vecSsOrigins, end );
		}

		counter ++;

		return counter;
	}

	IsValid( Float:start[ 3 ], Float:end[ 3 ] )
	{
		SetFloor( end );
		end[ 2 ] += 36.0;
		new point = engfunc( EngFunc_PointContents, end );
		if( point == CONTENTS_EMPTY ) if ( CheckPoints( end ) && CheckDistance( end ) && CheckVisibility( start, end ) ) if ( !trace_hull( end, HULL_LARGE, -1 ) ) return true;

		return false;
	}

	CheckVisibility( Float:start[ 3 ], Float:end[ 3 ] )
	{
		new tr; 
		engfunc( EngFunc_TraceLine, start, end, IGNORE_GLASS, -1, tr );

		return ( get_tr2( tr, TR_pHit ) < 0 );
	}

	SetFloor( Float:start[ 3 ] )
	{
		new tr, Float:end[ 3 ];
		end[ 0 ] = start[ 0 ];
		end[ 1 ] = start[ 1 ];
		end[ 2 ] = -99999.9;
		engfunc( EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, start );
	}

	CheckPoints( Float:origin[ 3 ] )
	{
		new Float:data[ 3 ], tr, point;
		data[ 0 ] = origin[ 0 ];
		data[ 1 ] = origin[ 1 ];
		data[ 2 ] = 99999.9;

		engfunc( EngFunc_TraceLine, origin, data, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, data );
		point = engfunc( EngFunc_PointContents, data );

		if ( point == CONTENTS_SKY && get_distance_f( origin, data ) < 250.0 ) return false;

		data[ 2 ] = -99999.9;

		engfunc( EngFunc_TraceLine, origin, data, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, data );
		point = engfunc( EngFunc_PointContents, data );

		if ( point < CONTENTS_SOLID ) return false;

		return true;
	}

	CheckDistance( Float:origin[ 3 ] )
	{
		new Float:dist, Float:data[ 3 ];

		new count = ArraySize( g_vecSsSpawns );
		for( new i = 0; i < count; i++ ) 
		{
			ArrayGetArray( g_vecSsSpawns, i, data );
			dist = get_distance_f( origin, data );
			if( dist < SS_MIN_DISTANCE ) return false;
		}

		count = ArraySize( g_vecSsOrigins );
		for( new i = 0; i < count; i++ )
		{
			ArrayGetArray( g_vecSsOrigins, i, data );
			dist = get_distance_f( origin, data );
			if( dist < SS_MIN_DISTANCE ) return false;
		}

		return true;
	}
RETRAS
Image
Leul si tigru sunt mai puternici ca lupul,dar lupul la circ nu participa.
User avatar
1TAP GOD
Membru, skill 0
Membru, skill 0
Posts: 65
Joined: 02 Sep 2018, 23:20
Detinator Steam: Da
CS Status: Be The Best And Fuck The Rest
SteamID: assasinssmdfk
Fond eXtream: 0
Been thanked: 1 time
Contact:

21 Apr 2019, 12:14

uite fara csgo_remake.inc
EDIT: se poate da t/c ,multumesc LEVIN

Code: Select all

// LAST EDIT ON - 14.04.2019 & 23:08
	
	/* 
	Plugin: Xmas Gifts 2.3.2 
	Autor: KronoS # GG 

	Credite: 
	@FakeNick - pentru pluginul Pick up present de unde a pornit tot 
	@joropito - pentru Super Spawns 
	@Askhanar - pentru fixarea Super Spawns 

	Cvar-uri: 
	- presents_respawn_time 60.0 (Dupa cat timp dupa ridicarea unui cadou apare altul pe harta) 
	- presents_on_map 11 (Cate cadouri sa apara pe harta) 
		ATENTIE*: Se calculeaza numarul cvar-ului - 1!!! 
			Daca puneti 11 or sa apara doar 10 cadouri! 

	Changelog: 

	* v2.3.2 - 28.12.2012 
	- cadourile primeau respawn chiar daca timpul era setat pe 0.0 
	* v2.3.1 - 28.12.2012 
	- cadourile nu primeau respawn 
	* v2.3 - 28.12.2012 
	- cod infrumusetat 
	- cadourile nu mai apareau dupa prima runda (fixat de Askhanar) 
	* v2.2 - 25.11.2010 
	- bug reparat: cadourile dispareau de pe harta 
	- FM_Think indeparta 
	* v2.1 - 17.11.2010 
	- super spawns 
	- cvar: presents_on_map 
	- bug reparat: cadourile apareau in aer 
	- variabila globala 
	- FUN -> Fakemeta 
	- Hamsandwich 
	- optimizare mesaje HUD 
	* v1.0 - 14.11.2010 
	- plugin publicat 
	*/ 

	#include < amxmodx >
	#include < cstrike >
	#include < hamsandwich >
	#include < engine >
	#include < fakemeta >
	
       	native csgor_get_user_keys(id)
	native csgor_set_user_keys(id,amount)
	native csgor_get_user_dusts(id)
	native csgor_set_user_dusts(id,amount)
	native csgor_get_user_cases(id)
	native csgor_set_user_cases(id,amount)
	native csgor_get_user_skins(id,amount)
	native csgor_set_user_skins(id,skinid,amount)
	native csgor_is_user_logged(id)

	#pragma tabsize 0

	new const g_szFmuGiftClassName[ ] = "csgo_supplybox";

	/* Model cadou */
	#define MODEL_CUTIE "models/cutie.mdl"

	/* Super-Spawns */ 
	#define SS_VERSION "1.0"
	#define SS_MIN_DISTANCE 500.0
	#define SS_MAX_LOOPS 100000

	new Array:g_vecSsOrigins;
	new Array:g_vecSsSpawns;
	new Array:g_vecSsUsed;
	new Float:g_flSsMinDist;
	new g_iSsTime;

	new const g_szStarts[ ][ ] = { "info_player_start", "info_player_deathmatch" };
	new const Float:g_flOffsets[ ] = { 3500.0, 3500.0, 1500.0 };


	new pcvar_respawn_time, pcvar_presents_on_map;

	public plugin_precache( )
	{
		// Cvar-uri
		pcvar_presents_on_map = register_cvar( "presents_on_map", "4" );
		pcvar_respawn_time = register_cvar( "presents_respawn_time", "90" );
	
		precache_model( MODEL_CUTIE );
	}

	public plugin_init( )
	{
		register_plugin( "XMAS GIFTS", "2.3.2", "KronoS" );


	// Eventuri
		//register_event( "HLTV", "spawn_gifts", "a", "1=0", "2=0" );
		register_logevent("spawn_gifts", 2, "0=World triggered", "1=Round_Start")
		register_forward( FM_Touch, "forward_touch" );


		//NOI
			register_cvar("box_chei","1");
			register_cvar("box_cutii","1");
			register_cvar("box_pulbere","1");
			register_cvar("box_bani","333");
			register_cvar("box_skin_max","80");


		SsInit( 800.0 );
		SsScan( );

		XGIFTS_Spawn( );
	}


	public spawn_gifts( )	XGIFTS_Spawn( );


	public XGIFTS_Spawn( )
	{
		new Float:fOrigin[ 3 ];
		for( new i = 0; i < get_pcvar_num( pcvar_presents_on_map ); i++ )	if( SsGetOrigin( fOrigin ) )	XGIFTS_Create( fOrigin );
	}

	public XGIFTS_Create( const Float:fOrigin[ 3 ] )
	{
		new ent = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) ); 

		if( pev_valid( ent ) )
		{
			engfunc( EngFunc_SetModel, ent, MODEL_CUTIE );
			engfunc( EngFunc_SetOrigin, ent, fOrigin );
			static Float:fMaxs[ 3 ] = { 2.0, 2.0, 4.0 };
			static Float:fMins[ 3 ] = { -2.0, -2.0, -4.0 };
			set_pev( ent, pev_solid, SOLID_BBOX );
			engfunc( EngFunc_SetSize, ent, fMins, fMaxs );
			engfunc( EngFunc_DropToFloor, ent );

			set_pev( ent, pev_classname, g_szFmuGiftClassName );
			
				set_rendering( ent,
			kRenderFxGlowShell,
			255,
			0,
			0,
			kRenderNormal,
			255 );
		}
	}

	public XGIFTS_Respawn( iOrigin[ ] )
	{
		new Float:fOrigin[ 3 ], auxOrigin[ 3 ];
		auxOrigin[ 0 ] = iOrigin[ 0 ];
		auxOrigin[ 1 ] = iOrigin[ 1 ];
		auxOrigin[ 2 ] = iOrigin[ 2 ];

		IVecFVec( auxOrigin, fOrigin );
		XGIFTS_Create( fOrigin );

		client_print(0,print_chat,"Tocmai a fost aruncata o cutie pe mapa!Cautati-o pentru a afla ce ascunde.");

		return 0;
	}

	public forward_touch( ent, id )
	{
		if ( !pev_valid( ent )||!is_user_alive( id ) )	return FMRES_IGNORED;

		static class[ 35 ];
		pev( ent, pev_classname, class, sizeof class - 1 );
		if ( !equal( class, g_szFmuGiftClassName ) ) return FMRES_IGNORED;

		set_pev( ent, pev_solid, SOLID_NOT );
		set_pev( ent, pev_effects, EF_NODRAW );

		if ( get_pcvar_float( pcvar_respawn_time ) > 0.0 )
		{
			new Float:flOrigin[ 3 ], iOrigin[ 3 ];
			entity_get_vector( ent, EV_VEC_origin, flOrigin );
			FVecIVec( flOrigin, iOrigin );
			set_task( float(get_pcvar_num( pcvar_respawn_time )), "XGIFTS_Respawn", _, iOrigin, 3 );
		}

		switch( random_num( 0, 4 ) )
		{
			case 0:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_keys(id,csgor_get_user_keys(id)+get_cvar_num("box_chei"));
					client_print(id,print_chat,"Super!Ai primit +%d chei%s",get_cvar_num("box_chei"),get_cvar_num("box_chei")==1?"e":"");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 1:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_cases(id,csgor_get_user_cases(id)+get_cvar_num("box_cutii"));
					client_print(id,print_chat,"Super!Ai primit +%d cuti%s",get_cvar_num("box_cutii"),get_cvar_num("box_cutii")==1?"e":"i");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 2:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_dusts(id,csgor_get_user_dusts(id)+get_cvar_num("box_pulbere"));
					client_print(id,print_chat,"Super!Ai primit +%d pulber%s",get_cvar_num("box_pulbere"),get_cvar_num("box_pulbere")==1?"e":"i");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 3:
			{
				if(csgor_is_user_logged(id))
				{
					csgor_set_user_skins(id,random_num(0,get_cvar_num("box_skin_max")),1);
					client_print(id,print_chat,"Super!Ai primit +1 skin");
				}
				else
				{
					client_print(id,print_chat,"Inregistreaza-te prin /reg pentru a avea acces la Supply BOX");
					Bani(id);
				}
			}
			case 4: Bani(id);
		}
		return FMRES_IGNORED;
	}

	public Bani(id)
	{
		cs_set_user_money(id,cs_get_user_money(id)+get_cvar_num("box_bani"),1);
		client_print(id,print_chat,"Super!Ai primit +%d$",get_cvar_num("box_bani"));
		//return PLUGIN_HANDLED;
	}

	
	// Super spawns
	
	public SsDump( )
	{
		new Float:origin[ 3 ];
		new count = ArraySize( g_vecSsOrigins );
		server_print( "-------------------------------------------------------" );
		for( new i = 0; i < count; i++ )
		{
			ArrayGetArray( g_vecSsOrigins, i, origin );
			server_print( "Origin: %f %f %f", origin[ 0 ], origin[ 1 ], origin[ 2 ] );
		}
		server_print( "-------------------------------------------------------" );
		server_print( "Number of origins: %i", count );
		server_print( "Time: %i", g_iSsTime );
		server_print( "-------------------------------------------------------" );
	}
	
	public SsInit( Float:mindist )
	{
		register_cvar( "sv_superspawns", SS_VERSION, ( FCVAR_SERVER|FCVAR_SPONLY ) );
		register_concmd( "_ss_dump", "SsDump" );
	
		g_flSsMinDist = mindist;
		
		g_vecSsOrigins = ArrayCreate( 3, 1 );
		g_vecSsSpawns = ArrayCreate( 3, 1 );
		g_vecSsUsed = ArrayCreate( 3, 1 );
	}

	stock SsClean( ) 
	{
		g_flSsMinDist = 0.0;
		
		ArrayClear( g_vecSsOrigins );
		ArrayClear( g_vecSsSpawns );
		ArrayClear( g_vecSsUsed );
	}

	stock SsGetOrigin( Float:origin[ 3 ] )
	{
		new Float:data[ 3 ], size;
		new ok = 1;

		while( ( size = ArraySize( g_vecSsOrigins ) ) )
		{
			new idx = random_num( 0, size - 1 );
			ArrayGetArray( g_vecSsOrigins, idx, origin );

			new used = ArraySize( g_vecSsUsed );
			for( new i = 0; i < used; i++ )
			{
				ok = 0;
				ArrayGetArray( g_vecSsUsed, i, data );
				if( get_distance_f( data, origin ) >= g_flSsMinDist )
				{
					ok = 1;
					break;
				}
			}

			ArrayDeleteItem( g_vecSsOrigins, idx );

			if ( ok ) 
			{ 
				ArrayPushArray( g_vecSsUsed, origin );
				return true;
			}
		}
		return false;
	}

	public SsScan( )
	{
		new start, Float:origin[ 3 ], starttime;
		starttime = get_systime( );

		for( start = 0; start < sizeof( g_szStarts ); start++ )
		{
			server_print( "Searching for %s", g_szStarts[ start ] );

			new ent;
			if( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", g_szStarts[ start ] ) ) )
			{
				new counter;

				pev( ent, pev_origin, origin );
				ArrayPushArray( g_vecSsSpawns, origin );

				while ( counter < SS_MAX_LOOPS ) counter = GetLocation( origin, counter );
			}
		}

		g_iSsTime = get_systime( );
		g_iSsTime -= starttime;
	}

	GetLocation( Float:start[ 3 ], &counter )
	{
		new Float:end[ 3 ];
		for( new i = 0; i < 3; i++ ) end[ i ] += random_float( 0.0 - g_flOffsets[ i ], g_flOffsets[ i ] );

		if( IsValid( start, end ) )
		{
			start[ 0 ] = end[ 0 ];
			start[ 1 ] = end[ 1 ];
			start[ 2 ] = end[ 2 ];

			ArrayPushArray( g_vecSsOrigins, end );
		}

		counter ++;

		return counter;
	}

	IsValid( Float:start[ 3 ], Float:end[ 3 ] )
	{
		SetFloor( end );
		end[ 2 ] += 36.0;
		new point = engfunc( EngFunc_PointContents, end );
		if( point == CONTENTS_EMPTY ) if ( CheckPoints( end ) && CheckDistance( end ) && CheckVisibility( start, end ) ) if ( !trace_hull( end, HULL_LARGE, -1 ) ) return true;

		return false;
	}

	CheckVisibility( Float:start[ 3 ], Float:end[ 3 ] )
	{
		new tr; 
		engfunc( EngFunc_TraceLine, start, end, IGNORE_GLASS, -1, tr );

		return ( get_tr2( tr, TR_pHit ) < 0 );
	}

	SetFloor( Float:start[ 3 ] )
	{
		new tr, Float:end[ 3 ];
		end[ 0 ] = start[ 0 ];
		end[ 1 ] = start[ 1 ];
		end[ 2 ] = -99999.9;
		engfunc( EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, start );
	}

	CheckPoints( Float:origin[ 3 ] )
	{
		new Float:data[ 3 ], tr, point;
		data[ 0 ] = origin[ 0 ];
		data[ 1 ] = origin[ 1 ];
		data[ 2 ] = 99999.9;

		engfunc( EngFunc_TraceLine, origin, data, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, data );
		point = engfunc( EngFunc_PointContents, data );

		if ( point == CONTENTS_SKY && get_distance_f( origin, data ) < 250.0 ) return false;

		data[ 2 ] = -99999.9;

		engfunc( EngFunc_TraceLine, origin, data, DONT_IGNORE_MONSTERS, -1, tr );
		get_tr2( tr, TR_vecEndPos, data );
		point = engfunc( EngFunc_PointContents, data );

		if ( point < CONTENTS_SOLID ) return false;

		return true;
	}

	CheckDistance( Float:origin[ 3 ] )
	{
		new Float:dist, Float:data[ 3 ];

		new count = ArraySize( g_vecSsSpawns );
		for( new i = 0; i < count; i++ ) 
		{
			ArrayGetArray( g_vecSsSpawns, i, data );
			dist = get_distance_f( origin, data );
			if( dist < SS_MIN_DISTANCE ) return false;
		}

		count = ArraySize( g_vecSsOrigins );
		for( new i = 0; i < count; i++ )
		{
			ArrayGetArray( g_vecSsOrigins, i, data );
			dist = get_distance_f( origin, data );
			if( dist < SS_MIN_DISTANCE ) return false;
		}

		return true;
	}
Daca vreti ceva da-ti add aici https://steamcommunity.com/id/assasinssmdfk/
Post Reply

Return to “Cereri”

  • Information