activare hook

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

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

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
anaconda cs
Membru, skill +3
Membru, skill +3
Posts: 1045
Joined: 13 Nov 2012, 06:39
Detinator Steam: Da
Detinator server CS: Dr.InDungi.Ro
SteamID: anaconda_indungi
Location: Iasi
Has thanked: 49 times
Been thanked: 45 times
Contact:

01 Dec 2013, 02:06

stie careva cum se poate activa si dezactiva automat un cvar la o ora setata de mine?
exemplu vreau sa activez hook de la 12-3 noaptea...
la 12 sa inceapa
la 3 sa se termine
Image
Image
Rapidserver
PandaFrumosul
Membru, skill 0
Membru, skill 0
Posts: 1
Joined: 01 Dec 2013, 11:19
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Contact:

01 Dec 2013, 11:21

UP.! Am si eu nevoie , urgent ! [-o<
User avatar
YONTU
Moderator ajutator
Moderator ajutator
Posts: 2446
Joined: 10 May 2013, 13:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 255 times
Been thanked: 281 times
Contact:

01 Dec 2013, 16:29

buy_hook.sma | Afiseaza codul
#include < amxmodx >
#include < CC_ColorChat >
#include < hamsandwich >
#include < cstrike >
#include < fakemeta >

#define PLUGIN_NAME "[ ZP ] Zombie Class Twister"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "YONTU"

#define HookTask	24896172
#define HookSpeed	800.0		// NU MODIFICA

new const g_szTag[  ] = "[ZP Twister]";
new const g_szHook[  ] = "weapons/xbow_fire1.wav";

new bool:g_bUserHasHook[ 33 ];
new bool:Hook[ 33 ];
new iHookOrigin[ 33 ][ 3 ];

new iBeamSprite;

new g_iCvarCostHook, g_iCvarStopHook;

public plugin_init(  ) {

	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );

	register_clcmd( "+hook", "ClCmdUseHook" );
	register_clcmd( "-hook", "ClCmdStopUsingHook" );

	register_clcmd( "/hook", "ClCmdSayBuyHook" );

	g_iCvarCostHook = register_cvar( "hook_cost", "10000" );		// Cat sa coste puterea HOOK
	g_iCvarStopHook = register_cvar( "hook_stop", "20" );		// Cat timp sa dureze puterea HOOK
}

public plugin_precache(  ) {

	iBeamSprite = precache_model( "sprites/plasma.spr" );
	precache_sound( g_szHook );
}

public client_putinserver( id ) {
	
	g_bUserHasHook[ id ] = false;
}

public client_disconnect( id ) {
	
	g_bUserHasHook[ id ] = false;
}

public ClCmdSayBuyHook( id ) {
	
	if( !is_user_alive( id ) )
		return 1;
	
	if( is_user_alive( id ) ) {

		new g_iUserMoney = cs_get_user_money( id );
		new iNeededMoney = get_pcvar_num( g_iCvarCostHook );
 
		if( g_iUserMoney < iNeededMoney )
 
		ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Mai ai nevoie de^x03 %d $^x01 pentru a cumpara^x03 hook^x01 !", g_szTag, iNeededMoney - g_iUserMoney );
 
		else {
 
			client_cmd( id, "bind x +hook" );
			g_bUserHasHook[ id ] = true;

			set_task( get_pcvar_float( g_iCvarStopHook ), "task_StopHook" );

			cs_set_user_money( id, g_iUserMoney - iNeededMoney );
			ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Tocmai ai cumparat^x03 hook^x01 pentru^x03 %d $ !", g_szTag, iNeededMoney );
		}
	}

	return 0;
}

public fw_RoundStart(  ) {
	
	new szPlayers[ 32 ], iNum;
	get_players( szPlayers, iNum, "p" );
	
	for( new i = 0; i < iNum; i++)  {
		
		g_bUserHasHook[ szPlayers[ i ] ] = false;
	}
}

public Ham_PlayerSpawnPost( id ) {
	
	if( !is_user_alive( id ) || !is_user_connected( id ) )  return HAM_IGNORED;
	
	g_bUserHasHook[ id ] = false;
	
	return HAM_IGNORED;
}

public ClCmdUseHook( id ) {

	if( !g_bUserHasHook[ id ] )
		return 1;
		
	emit_sound( id,CHAN_VOICE, g_szHook, 1.0, ATTN_NORM, 0, PITCH_NORM );
	set_pev( id, pev_gravity, 0.0 );
	
	set_task( 0.1,"TaskHookPrethink", id + HookTask , "", 0, "b" );
	
	Hook[ id ] = true;
	iHookOrigin[ id ][ 0 ] = 999999;
	
	TaskHookPrethink( id + HookTask );
	return 1;
}

public ClCmdStopUsingHook( id ) {

	set_pev( id, pev_gravity, 1.0 );
	Hook[ id ] = false;
	
	return 1;
}

public TaskHookPrethink( id ) {

	id -= HookTask;

	if( !is_user_alive( id ) ) {

		Hook[ id ] = false;
	}
	
	if( !Hook[ id ] ) {

		remove_task( id + HookTask );
		return 1;
	}

	static iOrigin1[ 3 ];
	new Float:fOrigin[3];
	get_user_origin( id, iOrigin1 );
	pev( id, pev_origin, fOrigin);

	if( iHookOrigin[ id ][ 0 ] == 999999 ) {

		static iOrigin2[ 3 ];
		get_user_origin( id, iOrigin2, 3 );
		iHookOrigin[ id ][ 0 ] = iOrigin2[ 0 ];
		iHookOrigin[ id ][ 1 ] = iOrigin2[ 1 ];
		iHookOrigin[ id ][ 2 ] = iOrigin2[ 2 ];
	}

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 1 );
	write_short( id );
	write_coord( iHookOrigin[ id ][ 0 ] );
	write_coord( iHookOrigin[ id ][ 1 ]);
	write_coord( iHookOrigin[ id ][ 2 ] );
	write_short( iBeamSprite );
	write_byte( 1 );
	write_byte( 1 );
	write_byte( 5 );
	write_byte( 18 );
	write_byte( 0 );
	write_byte( random( 256 ) );
	write_byte( random( 256 ) );
	write_byte( random( 256 ) );
	write_byte( 200 );
	write_byte( 0 );
	message_end( );

	static Float:fVelocity[ 3 ];
	fVelocity[ 0 ] = ( float( iHookOrigin[ id ][ 0 ] ) - float( iOrigin1[ 0 ] ) ) * 3.0;
	fVelocity[ 1 ] = ( float( iHookOrigin[ id ][ 1 ] ) - float( iOrigin1[ 1 ] ) ) * 3.0;
	fVelocity[ 2 ] = ( float( iHookOrigin[ id ][ 2 ] ) - float( iOrigin1[ 2 ] ) ) * 3.0;

	static Float:fY;
	fY = fVelocity[ 0 ] * fVelocity[ 0 ] + fVelocity[ 1 ] * fVelocity[ 1 ] + fVelocity[ 2 ] * fVelocity[ 2 ];

	static Float:fX;
	fX = ( HookSpeed ) / floatsqroot( fY );

	fVelocity[ 0 ] *= fX;
	fVelocity[ 1 ] *= fX;
	fVelocity[ 2 ] *= fX;

	set_velo( id, fVelocity );

	return 0;
}

public set_velo( id, Float:fVelocity[ 3 ] ) {

	return set_pev( id, pev_velocity, fVelocity );
}

public task_StopHook( id ) {

	g_bUserHasHook[ id ] = false;
	ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Puterea ti-a expirat !" );
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
L.am facut in graba !
„Peste douăzeci de ani vei fi dezamăgit din cauza lucrurilor pe care nu le-ai făcut, nu din cauza celor pe care le-ai făcut.” - Mark Twain
„Asa e si in viata, hotii castiga, prostii care invata pierd.” - Mihai Nemeș

discord: IonutC#5114

Vrei sa joci pe un server de biohazard clasic specific timpurilor 2008-2012?
CLICK | Afiseaza codul
89.44.246.14:27015 biohazard clasic
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times
Contact:

01 Dec 2013, 17:17

Uite incearca asta
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
User avatar
anaconda cs
Membru, skill +3
Membru, skill +3
Posts: 1045
Joined: 13 Nov 2012, 06:39
Detinator Steam: Da
Detinator server CS: Dr.InDungi.Ro
SteamID: anaconda_indungi
Location: Iasi
Has thanked: 49 times
Been thanked: 45 times
Contact:

01 Dec 2013, 23:39

Fatzzu stiu si eu pluginu ala
faza ca pentru activarea hook-ului trebuie sa scrii o comanda dupa sa apesi pe 2..
amx_ghr_menu
dupa trebuie apasat 2
pluginul set task nu face decat sa execute o comanda :-?
http://s2.postimg.org/o2hw8lejc/sxq.jpg
Image
Image
User avatar
anaconda cs
Membru, skill +3
Membru, skill +3
Posts: 1045
Joined: 13 Nov 2012, 06:39
Detinator Steam: Da
Detinator server CS: Dr.InDungi.Ro
SteamID: anaconda_indungi
Location: Iasi
Has thanked: 49 times
Been thanked: 45 times
Contact:

04 Dec 2013, 11:28

UP, inca am nevoie
Image
Image
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 20 guests