Headshot Grave

Pluginuri facute de utilizatorii forumului eXtream.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
aNNakin
Fost administrator
Fost administrator
Posts: 10464
Joined: 17 Dec 2007, 21:42
Detinator Steam: Da
CS Status: a iubi - necesar si suficient
Detinator server CS: romania.cs16.ro
SteamID: anakin_cstrike16
Reputatie: Membru Club eXtreamCS
Fost Contribuitor
Fost Scripter eXtreamCS
Fost Lider Echipa eXtreamCS
Fost Administrator
Location: di.fm
Has thanked: 230 times
Been thanked: 787 times
Contact:

05 Oct 2008, 22:46

Descriere:
* Daca un jucator omoara alt jucator de la o distanta mai mare sau egal cu x (setabila), victima va exploda si va forma un mormant in functie de echipa langa locul unde a murit.
* Daca cineva se apropie de mormant, viata ii va incepe sa scada + inegrire a ecranului si aparitia unui sprite ce palpaie in partea stanga a ecranului. Daca se indeparteaza, toate acestea vor disparea
* Daca un jucator atinge mormantul, acesta va muri lovit de un traznet si se va face intuneric pe server.
Descarcare: Click!

sursa:
| Afiseaza codul
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Headshot Grave"
#define VERSION "1.0"
#define AUTHOR "anakin_cstrike"

#define fm_find_ent_by_class(%1,%2) engfunc( EngFunc_FindEntityByString, %1, "classname", %2 )
#define fm_remove_entity(%1) engfunc( EngFunc_RemoveEntity, %1 )

// thanks samurai
#define dmin Float:{ -2.440000, -3.540000, -4.960000 }
#define dmax Float:{ 5.880000, 3.780000, 4.750000 }

#define hsdistance 	1000.0
#define radius		400.0

#define sounds		2

new const gclass[] = 	"grave";
new const tmodel[] = 	"models/gravet.mdl";
new const ctmodel[] = 	"models/gravect.mdl";

new g_sounds[sounds][] =
{
	"misc/grave_sound1.wav",
	"misc/grave_sound2.wav"
};

new bool:g_Graved[33];
new g_explode,g_smoke,lightning;
new g_msgscreenfade,g_msgstatusicon;

new toggle_plugin,toggle_hs,toggle_touch,toggle_radius,
toggle_dmg,toggle_int,toggle_thunder,toggle_light,toggle_lighdur;
new p_plugin,p_hs,p_radius,p_dmg,p_int;

public plugin_init( ) 
{
	register_plugin( PLUGIN, VERSION, AUTHOR );
	
	register_forward( FM_Touch, "fw_touch" );
	register_forward( FM_PlayerPreThink, "fw_prethink" );
	
	register_event( "HLTV", "hook_newround",  "a", "1=0", "2=0" );
	register_event( "DeathMsg", "hook_death", "a" );
	register_event( "ResetHUD", "hook_reset", "b" );
	
	toggle_plugin = register_cvar( "hsgrave_plugin", "1" );
	toggle_hs = register_cvar( "hsgrave_explode", "1" );
	toggle_thunder = register_cvar( "hsgave_thunder", "1" );
	toggle_touch = register_cvar( "hsgrave_touchkill", "1" );
	toggle_light = register_cvar( "hsgrave_light", "1" );
	toggle_lighdur = register_cvar( "hsgrave_lightduration", "2" );
	toggle_radius = register_cvar( "hsgrave_radius", "1" );
	toggle_dmg = register_cvar( "hsgrave_damage", "5" );
	toggle_int = register_cvar( "hsgrave_interval", "3" );
	
	g_msgscreenfade = get_user_msgid( "ScreenFade" );
	g_msgstatusicon = get_user_msgid( "StatusIcon" );
}

public plugin_precache( )
{
	precache_model( tmodel );
	precache_model( ctmodel );
	precache_sound( "ambience/thunder_clap.wav" );
	
	lightning = precache_model( "sprites/lgtning.spr" );
	g_explode = precache_model( "sprites/shockwave.spr" );
	g_smoke = precache_model( "sprites/steam1.spr" );
	
	for( new i = 0; i < sounds; i++ )
		precache_sound(g_sounds);
}

public hook_death ()
{
	if( p_plugin != 1 )
		return PLUGIN_CONTINUE;
	
	new k = read_data( 1 );
	new v = read_data( 2 );
	new vteam = get_user_team( v );
	
	if( !k || !v )
		return PLUGIN_CONTINUE;
	if( get_user_team( k ) == vteam )
		return PLUGIN_CONTINUE;
	if( !read_data( 3 ) )
		return PLUGIN_CONTINUE;	
	
	new Float:korigin[3], Float:vorigin[3], Float:fdistance;
	pev( k, pev_origin, korigin );
	pev( v, pev_origin, vorigin );
	fdistance = get_distance_f( korigin, vorigin );
	
	if( fdistance >= hsdistance )
	{
		if( p_hs == 1 )
		{
			Smoke( vorigin, random_num( 30, 40 ), 5 );
			Cylinder( vorigin );
		}
		Fade( v,(6<<10), (5<<10), (1<<12), 0, 0, 0, 175 );
		
		new ent = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );
		vorigin[ 2 ] -= 35;
		engfunc( EngFunc_SetOrigin, ent, vorigin );
		
		if( !pev_valid( ent ) )
			return PLUGIN_CONTINUE;
		
		engfunc( EngFunc_SetModel, ent, vteam==1 ? tmodel : ctmodel );
		set_pev( ent,pev_classname, gclass );
		dllfunc( DLLFunc_Spawn, ent );
	
		set_pev( ent,pev_solid, SOLID_BBOX );
		set_pev( ent,pev_movetype, MOVETYPE_FLY );
	
		engfunc( EngFunc_SetSize, ent, dmin, dmax );
		engfunc( EngFunc_DropToFloor, ent );
	}
	
	return PLUGIN_CONTINUE;
}

public fw_touch( touched, toucher )
{
	if( p_plugin != 1 )
		return FMRES_IGNORED;
	if( get_pcvar_num ( toggle_touch ) != 1 )
		return FMRES_IGNORED;
	
	static dclass[32], rclass[32], Float:origin[3];
	pev( touched, pev_classname, dclass, sizeof dclass - 1 );
	pev( toucher, pev_classname, rclass, sizeof rclass - 1 );
	pev( toucher, pev_origin, origin );
	
	if( equali ( dclass, gclass ) && equali ( rclass, "player" ) )
	{
		user_kill( toucher );
		
		if( get_pcvar_num ( toggle_thunder ) == 1 )
		{
			new Float:vorigin[3];
			new Float:pos[3];
			pev(toucher, pev_origin, vorigin );
			
			vorigin[ 2 ] -= 26;
			pos[ 0 ] = vorigin[ 0 ] + 150;
			pos[ 1 ] = vorigin[ 1 ] + 150;
			pos[ 2 ] = vorigin[ 2 ] + 800;
			
			Thunder( pos, vorigin );
			Smoke( origin, 10, 10 );
			
			new x = random_num( 0, sounds - 1 );
			emit_sound( 0, CHAN_ITEM, g_sounds[x], 1.0, ATTN_NORM, 0, PITCH_NORM);
		}
		
		if( get_pcvar_num( toggle_light ) == 1 )
		{
			lights( "d" );
			set_task( float( get_pcvar_num( toggle_lighdur) ), "relights");
		}
	}
	
	
	return FMRES_IGNORED;
}

public hook_newround( )
{
	new ent = -1;
	while( ( ent = fm_find_ent_by_class ( ent, gclass ) ) )
		fm_remove_entity( ent );
	
	p_plugin = get_pcvar_num( toggle_plugin );
	p_hs = get_pcvar_num( toggle_hs );
	p_dmg = get_pcvar_num( toggle_dmg );
	p_int = get_pcvar_num( toggle_int );
	p_radius = get_pcvar_num( toggle_radius );
}

public fw_prethink( id )
{
	if( p_plugin != 1 )
		return FMRES_IGNORED;
	if( p_radius != 1 )
		return FMRES_IGNORED;
	
	if( !is_user_alive( id ))
		return FMRES_IGNORED;
	
	new Float:origin[3], Float:gorigin[3], Float:distance;
	new ent = -1;
	pev( id, pev_origin, origin );
	
	while(( ent = fm_find_ent_by_class( ent, gclass )))
	{
		pev(ent,pev_origin,gorigin);
		distance = get_distance_f( origin, gorigin );
		
		if( distance <= radius )
		{
			if(g_Graved[ id ])
				return FMRES_IGNORED;
			
			g_Graved[ id ] = true;
			
			Icon( id, 2,"dmg_gas",0,0,0);
			Fade( id, (1<<10), (1<<10), (1<<12), 0, 0, 0, 175 );
			
			set_task( float ( p_int ), "poison", id+123, _, _, "b" );
		
		} else {
			g_Graved[id] = false;
			
			if( task_exists( id+123 ))
				remove_task( id+123 );
			
			Icon( id, 0, "dmg_gas", 0, 0, 0 );
		}
	}
	
	return FMRES_IGNORED;
}

public poison( task )
{
	new index = task-123;
	new hp = get_user_health( index );
	new total = hp - p_dmg;
	new name[32];
	get_user_name( index, name, 31 );
	
	if( total <= 0 )
	{
		user_kill( index );
		Fade( index, (6<<10), (5<<10), (1<<12), 0, 0, 0, 175 );
	} else
		is_user_alive( index ) ? set_pev( index, pev_health, float( total ) ) : remove_task( index );
	
	Fade( index, (1<<10), (1<<10), (1<<12), 0, 0, 0, 35 );	
}

public hook_reset( id )
{
	g_Graved[ id ] = false;
	Icon( id, 0, "dmg_gas", 0, 0, 0 );
	
	if( task_exists( id+123 ) )
		remove_task( id+123 );
}

public Smoke( Float:forigin[3], scale, framerate )
{
	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( TE_SMOKE );
	write_coord( floatround( forigin[0] ) );
	write_coord( floatround( forigin[1] ) );
	write_coord( floatround( forigin[2] ) );
	write_short( g_smoke );
	write_byte( scale );
	write_byte( framerate );
	message_end();
}

public Cylinder( Float:forigin[3] )
{
	new origin[3];
	FVecIVec( forigin, origin );	
	
	CreateCylinder( origin, 550, g_explode, 0, 0, 6, 60, 0, 0, 210, 0, 175, 0 );
	CreateCylinder( origin, 700, g_explode, 0, 0, 6, 60, 0, 0, 235, 0, 150, 0 );
	CreateCylinder( origin, 850, g_explode, 0, 0, 6, 60, 0, 15, 255, 15, 100, 0 );
}

public relights() lights( "n" );

CreateCylinder( origin[3], addrad, sprite, startfrate, framerate, life, width, amplitude, red, green, blue, brightness, speed )
{
	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( TE_BEAMCYLINDER );
	write_coord( origin[0] );
	write_coord( origin[1] );
	write_coord( origin[2] );
	write_coord( origin[0] );
	write_coord( origin[1] );
	write_coord( origin[2] + addrad );
	write_short( sprite );
	write_byte( startfrate );
	write_byte( framerate );
	write_byte( life );
	write_byte( width );
	write_byte( amplitude );
	write_byte( red );
	write_byte( green );
	write_byte( blue );
	write_byte( brightness );
	write_byte( speed );
	message_end();
}

Thunder( Float:vec1[3], Float:vec2[3] )
{
	new ivec1[3], ivec2[3];
	FVecIVec( vec1, ivec1 ); FVecIVec( vec2, ivec2 );
	
	message_begin( MSG_PVS, SVC_TEMPENTITY ); 
	write_byte( TE_BEAMPOINTS ); 
	write_coord( ivec1[0] ); 
	write_coord( ivec1[1] ); 
	write_coord( ivec1[2] ); 
	write_coord( ivec2[0] ); 
	write_coord( ivec2[1] ); 
	write_coord( ivec2[2] ); 
	write_short( lightning ); 
	write_byte( 1 );
	write_byte( 5 );
	write_byte( 2 );
	write_byte( 20 );
	write_byte( 30 );
	write_byte( 200 ); 
	write_byte( 200 );
	write_byte( 200 );
	write_byte( 200 );
	write_byte( 200 );
	message_end();
	
	message_begin( MSG_PVS, SVC_TEMPENTITY, ivec2 ); 
	write_byte( TE_SPARKS ); 
	write_coord( ivec2[0] ); 
	write_coord( ivec2[1] ); 
	write_coord( ivec2[2] ); 
	message_end();
	
	emit_sound( 0, CHAN_ITEM, "ambience/thunder_clap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
}

/*EmitSound( channel, sample[], Float:vol, Float:att,flags, pitch )
{
	new players[32], index, num, i;
	get_players( players, num, "c" );
	
	for( i = 0; i < num; i++ )
	{
		index = players[ i ];
		if( !is_user_connected( index ) )
			continue;
			
		emit_sound( index, channel, sample, vol, att, flags, pitch );
	}
} */

Fade( index, duration, holdtime, flags, red, green, blue, alpha )
{
	message_begin( MSG_ONE_UNRELIABLE, g_msgscreenfade, { 0, 0, 0 }, index );
	write_short( duration );
	write_short( holdtime );
	write_short( flags );
	write_byte( red );
	write_byte( green );
	write_byte( blue );
	write_byte( alpha );
	message_end();
}

Icon( index, mode=2, const sprite[], red=0, green=255, blue=0 )
{
	message_begin( MSG_ONE, g_msgstatusicon, { 0, 0, 0 }, index );
	write_byte( mode );
	write_string( sprite ); 
	write_byte( red );
	write_byte( green ); 
	write_byte( blue );
	message_end();
}

lights( const light[] ) return engfunc( EngFunc_LightStyle, 0, light );


resurse: https://forums.alliedmods.net/attachmen ... 1224512042

Nume: Headshot Grave
Versiune: 1.0
Autor: anakin_cstrike

Instalare:
1. Fisierul hs_grave.sma il puneti in addons/amxmodx/scripting
2. Fisierul hs_grave.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Code: Select all

hs_grave.amxx
4. Fisierele gravet.mdl si gravect.mdl le puneti in cstrike/models
Cvar-uri:
hsgrave_plugin 1/0 - activeaza/dezactiveaza pluginul (default 1)
hsgrave_explode 1/0 - activeaza/dezactiveaza optiunea de explozie a jucatorului (default 1)
hsgave_thunder 1/0 - activeaza/dezactiveaza traznetul (default 1)
hsgrave_touchkill 1/0 - actieveaza/dezactiveaza optiunea de omorare a jucatorului ce atinge mormantul (default 1)
hsgrave_light 1/0 - activeaza/dezactiveaza optiunea de intunecare harta la atingere-omor mormant (default 1)
hsgrave_lightduration - durata in secunde pentru intuncare harta (default 1)
hsgrave_radius 1/0 - activeaza/dezactiveaza optiunea de scadere viata la apropiere de mormant (default 1)
hsgrave_damage - damage-ul primit la apropiere de mormant (default 5)
hsgrave_interval - intervalul in secunde pentru scadere din viata la apropiere de mormant (default 1)
distanta minima dintre jucator si mormant:

Code: Select all

#define radius	400.0
numele modelelor:

Code: Select all

new const tmodel[] = "models/gravet.mdl";
new const ctmodel[] = "models/gravect.mdl";
Module: Fakemeta

Imagini: multumesc lui mut2nt,Scorpions si Gyuky
ImageImage ImageImage ImageImage ImageImage ImageImage
Last edited by Cosmin on 24 Jul 2015, 13:47, edited 1 time in total.
Reason: sursa adaugata + resurse
RoyalServer 2
Canabys
Membru, skill 0
Membru, skill 0
Posts: 25
Joined: 09 Feb 2009, 02:47
Detinator Steam: Da
CS Status: Iubeesc ;x
Detinator server CS: fun.lowlag.org
SteamID: ptz_dragos
Has thanked: 1 time

11 Feb 2009, 05:11

Lool Perfect pentru zombie Plague.Foarte tare
Image
User avatar
Cazar@s
Membru, skill +1
Membru, skill +1
Posts: 146
Joined: 17 Mar 2009, 13:00
Detinator Steam: Da
CS Status: www.extreamcs.com best site
Has thanked: 2 times
Been thanked: 1 time

18 Apr 2009, 11:51

Frumos plugin il pun si eu acum in addonsul de zombie mod.
Image
Ice Age
Membru, skill +1
Membru, skill +1
Posts: 141
Joined: 27 Jan 2009, 23:18
Detinator Steam: Nu
CS Status: Ma uit pe cer!
Detinator server CS: NO !
Location: Constanta :D
Has thanked: 13 times
Been thanked: 7 times

20 Apr 2009, 22:38

Perfect pentru ZM GJ :)>-

Code: Select all

if  ( i_help_you ("Yes") == 1 )
#define NICK = Ice Age 2
#define Y!M = [email protected]
#define MOD = IceModX
Image
User avatar
burn09
Membru, skill +2
Membru, skill +2
Posts: 549
Joined: 16 Dec 2008, 23:02
Detinator Steam: Da
CS Status: CSDM Project
Detinator server CS: Inchis din 2011.
SteamID: burnnn669
Location: Bucuresti
Has thanked: 27 times
Been thanked: 47 times

22 Apr 2009, 09:14

Ice Age wrote:Perfect pentru ZM GJ :)>-
Dar face lag ? :-S
abc
Membru, skill 0
Membru, skill 0
Posts: 92
Joined: 22 Jul 2008, 17:39
Detinator Steam: Da
CS Status: pro :D
Detinator server CS: nu

22 Apr 2009, 11:06

burn09 wrote:
Ice Age wrote:Perfect pentru ZM GJ :)>-
Dar face lag ? :-S
nu cred, + ca trebuie doar fakementa module.
User avatar
p0k3r
Membru, skill +1
Membru, skill +1
Posts: 335
Joined: 28 Apr 2009, 20:50
Detinator Steam: Da
CS Status: Joc foarte rar.
Detinator server CS: CS.HARD-GAMING.COM
SteamID: nuildau
Reputatie: Ban 3 luni ! (Expirat)
Membru Club eXtreamCS (o luna)
(Ban scos de 1 mai!)
Location: localhost
Been thanked: 15 times
Contact:

28 Apr 2009, 21:01

super tare pluginu .. gj:)
Citeste regulamentul. Data viitoare iei warn.
Post Reply

Return to “Pluginuri eXtream”

  • Information