Plugin Available Grenade Explode in Grenade Smoke

Unpaid Requests, Public Plugins
Post Reply
User avatar
lizoumapper
Senior Member
Senior Member
Morocco
Posts: 127
Joined: 7 Months Ago
Location: Morocco
Has thanked: 3 times
Been thanked: 7 times
Age: 17
Contact:

Grenade Explode in Grenade Smoke

#1

Post by lizoumapper » 1 Month Ago

I think why don't add grenade flare explode i mean grenade explode in grenade smoke
color trail is white + color explode is white + damage grenade
that is better idea
I Love Learn Languages Programmations

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1958
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#2

Post by Raheem » 1 Month Ago

flare light grenade?
You don't know? Learn and you will know.

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 192
Joined: 2 Years Ago
Has thanked: 14 times
Been thanked: 7 times
Age: 20
Contact:

#3

Post by sPe3doN » 1 Month Ago

Raheem wrote:
1 Month Ago
flare light grenade?
I think He mean to be like this
https://m.youtube.com/watch?v=vi1867RqC ... continue=1

[ Post made via Android ]

User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 358
Joined: 11 Months Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

#4

Post by Muhammet20 » 1 Month Ago

sPe3doN wrote:
1 Month Ago
Raheem wrote:
1 Month Ago
flare light grenade?
I think He mean to be like this
https://m.youtube.com/watch?v=vi1867RqC ... continue=1
yeah me too i think he man this
.::Kaya Gaming || Never Give Up || Zombie Escape::.
https://kaya-gaming.ga/index.php

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 192
Joined: 2 Years Ago
Has thanked: 14 times
Been thanked: 7 times
Age: 20
Contact:

#5

Post by sPe3doN » 1 Month Ago

try

Code: Select all

#include <zombie_escape>


// Settings file

new const ZE_SETTING_RESOURCES[] = "zombie_escape.ini"



// Default sounds

new const sound_grenade_flare_explode[][] = { "items/nvg_on.wav" }

 

#define MODEL_MAX_LENGTH 64

#define SOUND_MAX_LENGTH 64

#define SPRITE_MAX_LENGTH 64

 

// Models

new g_v_szModelFlareGrenade[MODEL_MAX_LENGTH] = "models/zombie_escape/v_grenade_explode.mdl"
new g_p_szModelFlareGrenade[MODEL_MAX_LENGTH] = "models/zombie_escape/p_grenade_explode.mdl"

// Sprites

new g_sprite_grenade_trail[SPRITE_MAX_LENGTH] = "sprites/laserbeam.spr"
new g_sprite_grenade_ring[SPRITE_MAX_LENGTH] = "sprites/shockwave.spr"
new g_sprite_grenade_explode[SPRITE_MAX_LENGTH] = "sprites/zerogxplode.spr"
new Array:g_sound_grenade_flare_explode

// HACK: pev_ field used to store custom nade types and their values



const PEV_NADE_TYPE = pev_flTimeStepSound
const NADE_TYPE_FLARE = 4444

 
new g_trailSpr, Expl, gSpriteCircle



public plugin_init()

{
	register_plugin("[ZE] Explode Nade", ZE_VERSION, AUTHORS)

	 

	register_forward(FM_SetModel, "fw_SetModel")

	RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade")

}

public plugin_precache()

{ 

	// Initialize arrays

	g_sound_grenade_flare_explode = ArrayCreate(SOUND_MAX_LENGTH, 1)

 

	// Load from external file

	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Sounds", "GRENADE FLARE", g_sound_grenade_flare_explode)

 

	// If we couldn't load custom sounds from file, use and save default ones

	

	new index

	if (ArraySize(g_sound_grenade_flare_explode) == 0)

	{

		for (index = 0; index < sizeof sound_grenade_flare_explode; index++)

		ArrayPushString(g_sound_grenade_flare_explode, sound_grenade_flare_explode[index])

 

		// Save to external file

		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Sounds", "GRENADE FLARE", g_sound_grenade_flare_explode)

	}

	

	// Load from external file, save if not found
	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_v_szModelFlareGrenade, charsmax(g_v_szModelFlareGrenade)))
		amx_save_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_v_szModelFlareGrenade)
	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_p_szModelFlareGrenade, charsmax(g_p_szModelFlareGrenade)))
		amx_save_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_p_szModelFlareGrenade)


	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "TRAIL", g_sprite_grenade_trail, charsmax(g_sprite_grenade_trail)))

		amx_save_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "TRAIL", g_sprite_grenade_trail)

		

	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "RING", g_sprite_grenade_ring, charsmax(g_sprite_grenade_ring)))

		amx_save_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "RING", g_sprite_grenade_ring)

		

	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "EXPLODE", g_sprite_grenade_explode, charsmax(g_sprite_grenade_explode)))

		amx_save_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "EXPLODE", g_sprite_grenade_explode)

 

 	new sound[SOUND_MAX_LENGTH]

	for (index = 0; index < ArraySize(g_sound_grenade_flare_explode); index++)

	{

		ArrayGetString(g_sound_grenade_flare_explode, index, sound, charsmax(sound))

		precache_sound(sound)

	}

	
	// Precache models
	precache_model(g_v_szModelFlareGrenade)
	precache_model(g_p_szModelFlareGrenade)



	g_trailSpr = precache_model(g_sprite_grenade_trail)

	Expl = precache_model("sprites/zerogxplode.spr")

	gSpriteCircle = precache_model("sprites/shockwave.spr")

	

}



public ze_fw_core_cure_post(id, attacker)

{

	// Set custom grenade model

	cs_set_player_view_model(id, CSW_SMOKEGRENADE, g_v_szModelFlareGrenade)
	cs_set_player_weap_model(id, CSW_SMOKEGRENADE, g_p_szModelFlareGrenade)
}

 

public ze_fw_core_infect(id, attacker)

{

	// Remove custom grenade model

	cs_reset_player_view_model(id, CSW_SMOKEGRENADE)

}

 

// Forward Set Model

public fw_SetModel(entity, const model[])

{

	// We don't care

	if (strlen(model) < 8)

		return;

 

	// Narrow down our matches a bit

	if (model[7] != 'w' || model[8] != '_')

		return;

 

	// Get damage time of grenade

	static Float:dmgtime

	pev(entity, pev_dmgtime, dmgtime)

 

	// Grenade not yet thrown

	if (dmgtime == 0.0)

		return;

 

	// Grenade's owner is zombie?

	if (ze_is_user_zombie(pev(entity, pev_owner)))

		return;

 

	// Smoke Grenade

	if (model[9] == 's' && model[10] == 'm')

	{



		// Give it a glow

		fm_set_rendering(entity, kRenderFxGlowShell, 200, 200, 200, kRenderNormal, 16);

 

		// And a colored trail

		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)

		write_byte(TE_BEAMFOLLOW) // TE id

		write_short(entity) // entity

		write_short(g_trailSpr) // sprite

		write_byte(10) // life

		write_byte(7) // width

		write_byte(200) // r

		write_byte(200) // g

		write_byte(200) // b

		write_byte(200) // brightness

		message_end()

		 

		// Set grenade type on the thrown grenade entity

		set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_FLARE)

		 

	}

}

 

// Ham Grenade Think Forward

public fw_ThinkGrenade(entity)

{

	// Invalid entity

	if (!pev_valid(entity)) return HAM_IGNORED;

 

	// Get damage time of grenade

	static Float:dmgtime

	pev(entity, pev_dmgtime, dmgtime)

	 

	new Float:current_time = get_gametime()

	 

	// Check if it's time to go off

	if (dmgtime > current_time)

		return HAM_IGNORED;

 

	// Check if it's one of our custom nades

	if (pev(entity, PEV_NADE_TYPE) != NADE_TYPE_FLARE)

		return HAM_IGNORED;

	

	

	flare_explode(entity)

	

	// Get rid of the grenade

	engfunc(EngFunc_RemoveEntity, entity)

	return HAM_SUPERCEDE;



}



public flare_explode(entity)

{

	static Float:origin[3] // 

	pev(entity, pev_origin, origin)

	

	create_blast2(origin)

	 

	explode(entity, origin)

	 

	static attacker;

	attacker = pev(entity, pev_owner)

	 

	static victim

	victim = -1

	 

	while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, origin, Float:260.0)) != 0)

	{

		// Only effect alive humans

		if (!is_user_alive(victim) || !ze_is_user_zombie(victim))

			continue;

 

		static Float:orig[3], Float:dmg

		pev(victim, pev_origin, orig)

		dmg = 1267.0 - get_distance_f(origin, orig)

		 

		ExecuteHamB(Ham_TakeDamage, victim, entity, attacker, dmg, (1<<24))

		static name[32]; get_user_name(victim, name, charsmax(name))


	}

 

}

 

public explode(entiy, Float:origin[3])

{

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)

	write_byte(TE_EXPLOSION)

	engfunc(EngFunc_WriteCoord, origin[0])

	engfunc(EngFunc_WriteCoord, origin[1])

	engfunc(EngFunc_WriteCoord, origin[2])

	write_short(Expl)

	write_byte(60)

	write_byte(15)

	write_byte(0)

	message_end()

}



// Fire Grenade: Fire Blast



create_blast2(const Float:origin[3])

{

	// Smallest ring

	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)

	write_byte(TE_BEAMCYLINDER) // TE id

	engfunc(EngFunc_WriteCoord, origin[0]) // x

	engfunc(EngFunc_WriteCoord, origin[1]) // y

	engfunc(EngFunc_WriteCoord, origin[2]) // z

	engfunc(EngFunc_WriteCoord, origin[0]) // x axis

	engfunc(EngFunc_WriteCoord, origin[1]) // y axis

	engfunc(EngFunc_WriteCoord, origin[2]+385.0) // z axis

	write_short(gSpriteCircle) // sprite

	write_byte(0) // startframe

	write_byte(0) // framerate

	write_byte(4) // life

	write_byte(60) // width

	write_byte(0) // noise

	write_byte(200) // red

	write_byte(200) // green

	write_byte(200) // blue

	write_byte(200) // brightness

	write_byte(1) // speed

	message_end()

	

	// Medium ring

	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)

	write_byte(TE_BEAMCYLINDER) // TE id

	engfunc(EngFunc_WriteCoord, origin[0]) // x

	engfunc(EngFunc_WriteCoord, origin[1]) // y

	engfunc(EngFunc_WriteCoord, origin[2]) // z

	engfunc(EngFunc_WriteCoord, origin[0]) // x axis

	engfunc(EngFunc_WriteCoord, origin[1]) // y axis

	engfunc(EngFunc_WriteCoord, origin[2]+470.0) // z axis

	write_short(gSpriteCircle) // sprite

	write_byte(0) // startframe

	write_byte(0) // framerate

	write_byte(4) // life

	write_byte(60) // width

	write_byte(0) // noise

	write_byte(200) // red

	write_byte(200) // green

	write_byte(200) // blue

	write_byte(200) // brightness

	write_byte(1) // speed

	message_end()

	

	// Largest ring

	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)

	write_byte(TE_BEAMCYLINDER) // TE id

	engfunc(EngFunc_WriteCoord, origin[0]) // x

	engfunc(EngFunc_WriteCoord, origin[1]) // y

	engfunc(EngFunc_WriteCoord, origin[2]) // z

	engfunc(EngFunc_WriteCoord, origin[0]) // x axis

	engfunc(EngFunc_WriteCoord, origin[1]) // y axis

	engfunc(EngFunc_WriteCoord, origin[2]+555.0) // z axis

	write_short(gSpriteCircle) // sprite

	write_byte(0) // startframe

	write_byte(0) // framerate

	write_byte(4) // life

	write_byte(60) // width

	write_byte(0) // noise

	write_byte(200) // red

	write_byte(200) // green

	write_byte(200) // blue

	write_byte(200) // brightness

	write_byte(1) // speed

	message_end()

}

  

// Set entity's rendering type (from fakemeta_util)

stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)

{

	static Float:color[3]

	color[0] = float(r)

	color[1] = float(g)

	color[2] = float(b)

	 

	set_pev(entity, pev_renderfx, fx)

	set_pev(entity, pev_rendercolor, color)

	set_pev(entity, pev_rendermode, render)

	set_pev(entity, pev_renderamt, float(amount))

}

 

// Get entity's speed (from fakemeta_util)

stock fm_get_speed(entity)

{

	static Float:velocity[3]

	pev(entity, pev_velocity, velocity)

	 

	return floatround(vector_length(velocity));

}
Last edited by sPe3doN on 15 Jul 2019, 23:47, edited 1 time in total.
These users thanked the author sPe3doN for the post:
Mohamed Alaa (1 Month Ago)

User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 358
Joined: 11 Months Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

#6

Post by Muhammet20 » 1 Month Ago

sPe3doN wrote:
1 Month Ago
try

Code: Select all

#include <zombie_escape>


// Settings file

new const ZE_SETTING_RESOURCES[] = "zombie_escape.ini"



// Default sounds

new const sound_grenade_flare_explode[][] = { "items/nvg_on.wav" }

 

#define MODEL_MAX_LENGTH 64

#define SOUND_MAX_LENGTH 64

#define SPRITE_MAX_LENGTH 64

 

// Models

new g_v_szModelFlareGrenade[MODEL_MAX_LENGTH] = "models/zombie_escape/v_grenade_explode.mdl"
new g_p_szModelFlareGrenade[MODEL_MAX_LENGTH] = "models/zombie_escape/p_grenade_explode.mdl"

// Sprites

new g_sprite_grenade_trail[SPRITE_MAX_LENGTH] = "sprites/laserbeam.spr"
new g_sprite_grenade_ring[SPRITE_MAX_LENGTH] = "sprites/shockwave.spr"
new g_sprite_grenade_explode[SPRITE_MAX_LENGTH] = "sprites/zerogxplode.spr"
new Array:g_sound_grenade_flare_explode

// HACK: pev_ field used to store custom nade types and their values



const PEV_NADE_TYPE = pev_flTimeStepSound
const NADE_TYPE_FLARE = 4444

 
new g_trailSpr, Expl, gSpriteCircle



public plugin_init()

{
	register_plugin("[ZE] Frost Nade", ZE_VERSION, AUTHORS)

	 

	register_forward(FM_SetModel, "fw_SetModel")

	RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade")

}

public plugin_precache()

{ 

	// Initialize arrays

	g_sound_grenade_flare_explode = ArrayCreate(SOUND_MAX_LENGTH, 1)

 

	// Load from external file

	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Sounds", "GRENADE FLARE", g_sound_grenade_flare_explode)

 

	// If we couldn't load custom sounds from file, use and save default ones

	

	new index

	if (ArraySize(g_sound_grenade_flare_explode) == 0)

	{

		for (index = 0; index < sizeof sound_grenade_flare_explode; index++)

		ArrayPushString(g_sound_grenade_flare_explode, sound_grenade_flare_explode[index])

 

		// Save to external file

		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Sounds", "GRENADE FLARE", g_sound_grenade_flare_explode)

	}

	

	// Load from external file, save if not found
	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_v_szModelFlareGrenade, charsmax(g_v_szModelFlareGrenade)))
		amx_save_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_v_szModelFlareGrenade)
	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_p_szModelFlareGrenade, charsmax(g_p_szModelFlareGrenade)))
		amx_save_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_p_szModelFlareGrenade)


	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "TRAIL", g_sprite_grenade_trail, charsmax(g_sprite_grenade_trail)))

		amx_save_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "TRAIL", g_sprite_grenade_trail)

		

	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "RING", g_sprite_grenade_ring, charsmax(g_sprite_grenade_ring)))

		amx_save_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "RING", g_sprite_grenade_ring)

		

	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "EXPLODE", g_sprite_grenade_explode, charsmax(g_sprite_grenade_explode)))

		amx_save_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "EXPLODE", g_sprite_grenade_explode)

 

 	new sound[SOUND_MAX_LENGTH]

	for (index = 0; index < ArraySize(g_sound_grenade_flare_explode); index++)

	{

		ArrayGetString(g_sound_grenade_flare_explode, index, sound, charsmax(sound))

		precache_sound(sound)

	}

	
	// Precache models
	precache_model(g_v_szModelFlareGrenade)
	precache_model(g_p_szModelFlareGrenade)



	g_trailSpr = precache_model(g_sprite_grenade_trail)

	Expl = precache_model("sprites/zerogxplode.spr")

	gSpriteCircle = precache_model("sprites/shockwave.spr")

	

}



public ze_fw_core_cure_post(id, attacker)

{

	// Set custom grenade model

	cs_set_player_view_model(id, CSW_SMOKEGRENADE, g_v_szModelFlareGrenade)
	cs_set_player_weap_model(id, CSW_SMOKEGRENADE, g_p_szModelFlareGrenade)
}

 

public ze_fw_core_infect(id, attacker)

{

	// Remove custom grenade model

	cs_reset_player_view_model(id, CSW_SMOKEGRENADE)

}

 

// Forward Set Model

public fw_SetModel(entity, const model[])

{

	// We don't care

	if (strlen(model) < 8)

		return;

 

	// Narrow down our matches a bit

	if (model[7] != 'w' || model[8] != '_')

		return;

 

	// Get damage time of grenade

	static Float:dmgtime

	pev(entity, pev_dmgtime, dmgtime)

 

	// Grenade not yet thrown

	if (dmgtime == 0.0)

		return;

 

	// Grenade's owner is zombie?

	if (ze_is_user_zombie(pev(entity, pev_owner)))

		return;

 

	// Smoke Grenade

	if (model[9] == 's' && model[10] == 'm')

	{



		// Give it a glow

		fm_set_rendering(entity, kRenderFxGlowShell, 200, 200, 200, kRenderNormal, 16);

 

		// And a colored trail

		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)

		write_byte(TE_BEAMFOLLOW) // TE id

		write_short(entity) // entity

		write_short(g_trailSpr) // sprite

		write_byte(10) // life

		write_byte(7) // width

		write_byte(200) // r

		write_byte(200) // g

		write_byte(200) // b

		write_byte(200) // brightness

		message_end()

		 

		// Set grenade type on the thrown grenade entity

		set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_FLARE)

		 

	}

}

 

// Ham Grenade Think Forward

public fw_ThinkGrenade(entity)

{

	// Invalid entity

	if (!pev_valid(entity)) return HAM_IGNORED;

 

	// Get damage time of grenade

	static Float:dmgtime

	pev(entity, pev_dmgtime, dmgtime)

	 

	new Float:current_time = get_gametime()

	 

	// Check if it's time to go off

	if (dmgtime > current_time)

		return HAM_IGNORED;

 

	// Check if it's one of our custom nades

	if (pev(entity, PEV_NADE_TYPE) != NADE_TYPE_FLARE)

		return HAM_IGNORED;

	

	

	flare_explode(entity)

	

	// Get rid of the grenade

	engfunc(EngFunc_RemoveEntity, entity)

	return HAM_SUPERCEDE;



}



public flare_explode(entity)

{

	static Float:origin[3] // 

	pev(entity, pev_origin, origin)

	

	create_blast2(origin)

	 

	explode(entity, origin)

	 

	static attacker;

	attacker = pev(entity, pev_owner)

	 

	static victim

	victim = -1

	 

	while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, origin, Float:260.0)) != 0)

	{

		// Only effect alive humans

		if (!is_user_alive(victim) || !ze_is_user_zombie(victim))

			continue;

 

		static Float:orig[3], Float:dmg

		pev(victim, pev_origin, orig)

		dmg = 1267.0 - get_distance_f(origin, orig)

		 

		ExecuteHamB(Ham_TakeDamage, victim, entity, attacker, dmg, (1<<24))

		static name[32]; get_user_name(victim, name, charsmax(name))


	}

 

}

 

public explode(entiy, Float:origin[3])

{

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)

	write_byte(TE_EXPLOSION)

	engfunc(EngFunc_WriteCoord, origin[0])

	engfunc(EngFunc_WriteCoord, origin[1])

	engfunc(EngFunc_WriteCoord, origin[2])

	write_short(Expl)

	write_byte(60)

	write_byte(15)

	write_byte(0)

	message_end()

}



// Fire Grenade: Fire Blast



create_blast2(const Float:origin[3])

{

	// Smallest ring

	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)

	write_byte(TE_BEAMCYLINDER) // TE id

	engfunc(EngFunc_WriteCoord, origin[0]) // x

	engfunc(EngFunc_WriteCoord, origin[1]) // y

	engfunc(EngFunc_WriteCoord, origin[2]) // z

	engfunc(EngFunc_WriteCoord, origin[0]) // x axis

	engfunc(EngFunc_WriteCoord, origin[1]) // y axis

	engfunc(EngFunc_WriteCoord, origin[2]+385.0) // z axis

	write_short(gSpriteCircle) // sprite

	write_byte(0) // startframe

	write_byte(0) // framerate

	write_byte(4) // life

	write_byte(60) // width

	write_byte(0) // noise

	write_byte(200) // red

	write_byte(200) // green

	write_byte(200) // blue

	write_byte(200) // brightness

	write_byte(1) // speed

	message_end()

	

	// Medium ring

	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)

	write_byte(TE_BEAMCYLINDER) // TE id

	engfunc(EngFunc_WriteCoord, origin[0]) // x

	engfunc(EngFunc_WriteCoord, origin[1]) // y

	engfunc(EngFunc_WriteCoord, origin[2]) // z

	engfunc(EngFunc_WriteCoord, origin[0]) // x axis

	engfunc(EngFunc_WriteCoord, origin[1]) // y axis

	engfunc(EngFunc_WriteCoord, origin[2]+470.0) // z axis

	write_short(gSpriteCircle) // sprite

	write_byte(0) // startframe

	write_byte(0) // framerate

	write_byte(4) // life

	write_byte(60) // width

	write_byte(0) // noise

	write_byte(200) // red

	write_byte(200) // green

	write_byte(200) // blue

	write_byte(200) // brightness

	write_byte(1) // speed

	message_end()

	

	// Largest ring

	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)

	write_byte(TE_BEAMCYLINDER) // TE id

	engfunc(EngFunc_WriteCoord, origin[0]) // x

	engfunc(EngFunc_WriteCoord, origin[1]) // y

	engfunc(EngFunc_WriteCoord, origin[2]) // z

	engfunc(EngFunc_WriteCoord, origin[0]) // x axis

	engfunc(EngFunc_WriteCoord, origin[1]) // y axis

	engfunc(EngFunc_WriteCoord, origin[2]+555.0) // z axis

	write_short(gSpriteCircle) // sprite

	write_byte(0) // startframe

	write_byte(0) // framerate

	write_byte(4) // life

	write_byte(60) // width

	write_byte(0) // noise

	write_byte(200) // red

	write_byte(200) // green

	write_byte(200) // blue

	write_byte(200) // brightness

	write_byte(1) // speed

	message_end()

}

  

// Set entity's rendering type (from fakemeta_util)

stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)

{

	static Float:color[3]

	color[0] = float(r)

	color[1] = float(g)

	color[2] = float(b)

	 

	set_pev(entity, pev_renderfx, fx)

	set_pev(entity, pev_rendercolor, color)

	set_pev(entity, pev_rendermode, render)

	set_pev(entity, pev_renderamt, float(amount))

}

 

// Get entity's speed (from fakemeta_util)

stock fm_get_speed(entity)

{

	static Float:velocity[3]

	pev(entity, pev_velocity, velocity)

	 

	return floatround(vector_length(velocity));

}
models ? sounds ? sprites ?
.::Kaya Gaming || Never Give Up || Zombie Escape::.
https://kaya-gaming.ga/index.php

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 192
Joined: 2 Years Ago
Has thanked: 14 times
Been thanked: 7 times
Age: 20
Contact:

#7

Post by sPe3doN » 1 Month Ago

Muhammet20 wrote:
1 Month Ago
sPe3doN wrote:
1 Month Ago
try

Code: Select all

#include <zombie_escape>


// Settings file

new const ZE_SETTING_RESOURCES[] = "zombie_escape.ini"



// Default sounds

new const sound_grenade_flare_explode[][] = { "items/nvg_on.wav" }

 

#define MODEL_MAX_LENGTH 64

#define SOUND_MAX_LENGTH 64

#define SPRITE_MAX_LENGTH 64

 

// Models

new g_v_szModelFlareGrenade[MODEL_MAX_LENGTH] = "models/zombie_escape/v_grenade_explode.mdl"
new g_p_szModelFlareGrenade[MODEL_MAX_LENGTH] = "models/zombie_escape/p_grenade_explode.mdl"

// Sprites

new g_sprite_grenade_trail[SPRITE_MAX_LENGTH] = "sprites/laserbeam.spr"
new g_sprite_grenade_ring[SPRITE_MAX_LENGTH] = "sprites/shockwave.spr"
new g_sprite_grenade_explode[SPRITE_MAX_LENGTH] = "sprites/zerogxplode.spr"
new Array:g_sound_grenade_flare_explode

// HACK: pev_ field used to store custom nade types and their values



const PEV_NADE_TYPE = pev_flTimeStepSound
const NADE_TYPE_FLARE = 4444

 
new g_trailSpr, Expl, gSpriteCircle



public plugin_init()

{
	register_plugin("[ZE] Frost Nade", ZE_VERSION, AUTHORS)

	 

	register_forward(FM_SetModel, "fw_SetModel")

	RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade")

}

public plugin_precache()

{ 

	// Initialize arrays

	g_sound_grenade_flare_explode = ArrayCreate(SOUND_MAX_LENGTH, 1)

 

	// Load from external file

	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Sounds", "GRENADE FLARE", g_sound_grenade_flare_explode)

 

	// If we couldn't load custom sounds from file, use and save default ones

	

	new index

	if (ArraySize(g_sound_grenade_flare_explode) == 0)

	{

		for (index = 0; index < sizeof sound_grenade_flare_explode; index++)

		ArrayPushString(g_sound_grenade_flare_explode, sound_grenade_flare_explode[index])

 

		// Save to external file

		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Sounds", "GRENADE FLARE", g_sound_grenade_flare_explode)

	}

	

	// Load from external file, save if not found
	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_v_szModelFlareGrenade, charsmax(g_v_szModelFlareGrenade)))
		amx_save_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_v_szModelFlareGrenade)
	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_p_szModelFlareGrenade, charsmax(g_p_szModelFlareGrenade)))
		amx_save_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_p_szModelFlareGrenade)


	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "TRAIL", g_sprite_grenade_trail, charsmax(g_sprite_grenade_trail)))

		amx_save_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "TRAIL", g_sprite_grenade_trail)

		

	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "RING", g_sprite_grenade_ring, charsmax(g_sprite_grenade_ring)))

		amx_save_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "RING", g_sprite_grenade_ring)

		

	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "EXPLODE", g_sprite_grenade_explode, charsmax(g_sprite_grenade_explode)))

		amx_save_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "EXPLODE", g_sprite_grenade_explode)

 

 	new sound[SOUND_MAX_LENGTH]

	for (index = 0; index < ArraySize(g_sound_grenade_flare_explode); index++)

	{

		ArrayGetString(g_sound_grenade_flare_explode, index, sound, charsmax(sound))

		precache_sound(sound)

	}

	
	// Precache models
	precache_model(g_v_szModelFlareGrenade)
	precache_model(g_p_szModelFlareGrenade)



	g_trailSpr = precache_model(g_sprite_grenade_trail)

	Expl = precache_model("sprites/zerogxplode.spr")

	gSpriteCircle = precache_model("sprites/shockwave.spr")

	

}



public ze_fw_core_cure_post(id, attacker)

{

	// Set custom grenade model

	cs_set_player_view_model(id, CSW_SMOKEGRENADE, g_v_szModelFlareGrenade)
	cs_set_player_weap_model(id, CSW_SMOKEGRENADE, g_p_szModelFlareGrenade)
}

 

public ze_fw_core_infect(id, attacker)

{

	// Remove custom grenade model

	cs_reset_player_view_model(id, CSW_SMOKEGRENADE)

}

 

// Forward Set Model

public fw_SetModel(entity, const model[])

{

	// We don't care

	if (strlen(model) < 8)

		return;

 

	// Narrow down our matches a bit

	if (model[7] != 'w' || model[8] != '_')

		return;

 

	// Get damage time of grenade

	static Float:dmgtime

	pev(entity, pev_dmgtime, dmgtime)

 

	// Grenade not yet thrown

	if (dmgtime == 0.0)

		return;

 

	// Grenade's owner is zombie?

	if (ze_is_user_zombie(pev(entity, pev_owner)))

		return;

 

	// Smoke Grenade

	if (model[9] == 's' && model[10] == 'm')

	{



		// Give it a glow

		fm_set_rendering(entity, kRenderFxGlowShell, 200, 200, 200, kRenderNormal, 16);

 

		// And a colored trail

		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)

		write_byte(TE_BEAMFOLLOW) // TE id

		write_short(entity) // entity

		write_short(g_trailSpr) // sprite

		write_byte(10) // life

		write_byte(7) // width

		write_byte(200) // r

		write_byte(200) // g

		write_byte(200) // b

		write_byte(200) // brightness

		message_end()

		 

		// Set grenade type on the thrown grenade entity

		set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_FLARE)

		 

	}

}

 

// Ham Grenade Think Forward

public fw_ThinkGrenade(entity)

{

	// Invalid entity

	if (!pev_valid(entity)) return HAM_IGNORED;

 

	// Get damage time of grenade

	static Float:dmgtime

	pev(entity, pev_dmgtime, dmgtime)

	 

	new Float:current_time = get_gametime()

	 

	// Check if it's time to go off

	if (dmgtime > current_time)

		return HAM_IGNORED;

 

	// Check if it's one of our custom nades

	if (pev(entity, PEV_NADE_TYPE) != NADE_TYPE_FLARE)

		return HAM_IGNORED;

	

	

	flare_explode(entity)

	

	// Get rid of the grenade

	engfunc(EngFunc_RemoveEntity, entity)

	return HAM_SUPERCEDE;



}



public flare_explode(entity)

{

	static Float:origin[3] // 

	pev(entity, pev_origin, origin)

	

	create_blast2(origin)

	 

	explode(entity, origin)

	 

	static attacker;

	attacker = pev(entity, pev_owner)

	 

	static victim

	victim = -1

	 

	while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, origin, Float:260.0)) != 0)

	{

		// Only effect alive humans

		if (!is_user_alive(victim) || !ze_is_user_zombie(victim))

			continue;

 

		static Float:orig[3], Float:dmg

		pev(victim, pev_origin, orig)

		dmg = 1267.0 - get_distance_f(origin, orig)

		 

		ExecuteHamB(Ham_TakeDamage, victim, entity, attacker, dmg, (1<<24))

		static name[32]; get_user_name(victim, name, charsmax(name))


	}

 

}

 

public explode(entiy, Float:origin[3])

{

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)

	write_byte(TE_EXPLOSION)

	engfunc(EngFunc_WriteCoord, origin[0])

	engfunc(EngFunc_WriteCoord, origin[1])

	engfunc(EngFunc_WriteCoord, origin[2])

	write_short(Expl)

	write_byte(60)

	write_byte(15)

	write_byte(0)

	message_end()

}



// Fire Grenade: Fire Blast



create_blast2(const Float:origin[3])

{

	// Smallest ring

	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)

	write_byte(TE_BEAMCYLINDER) // TE id

	engfunc(EngFunc_WriteCoord, origin[0]) // x

	engfunc(EngFunc_WriteCoord, origin[1]) // y

	engfunc(EngFunc_WriteCoord, origin[2]) // z

	engfunc(EngFunc_WriteCoord, origin[0]) // x axis

	engfunc(EngFunc_WriteCoord, origin[1]) // y axis

	engfunc(EngFunc_WriteCoord, origin[2]+385.0) // z axis

	write_short(gSpriteCircle) // sprite

	write_byte(0) // startframe

	write_byte(0) // framerate

	write_byte(4) // life

	write_byte(60) // width

	write_byte(0) // noise

	write_byte(200) // red

	write_byte(200) // green

	write_byte(200) // blue

	write_byte(200) // brightness

	write_byte(1) // speed

	message_end()

	

	// Medium ring

	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)

	write_byte(TE_BEAMCYLINDER) // TE id

	engfunc(EngFunc_WriteCoord, origin[0]) // x

	engfunc(EngFunc_WriteCoord, origin[1]) // y

	engfunc(EngFunc_WriteCoord, origin[2]) // z

	engfunc(EngFunc_WriteCoord, origin[0]) // x axis

	engfunc(EngFunc_WriteCoord, origin[1]) // y axis

	engfunc(EngFunc_WriteCoord, origin[2]+470.0) // z axis

	write_short(gSpriteCircle) // sprite

	write_byte(0) // startframe

	write_byte(0) // framerate

	write_byte(4) // life

	write_byte(60) // width

	write_byte(0) // noise

	write_byte(200) // red

	write_byte(200) // green

	write_byte(200) // blue

	write_byte(200) // brightness

	write_byte(1) // speed

	message_end()

	

	// Largest ring

	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)

	write_byte(TE_BEAMCYLINDER) // TE id

	engfunc(EngFunc_WriteCoord, origin[0]) // x

	engfunc(EngFunc_WriteCoord, origin[1]) // y

	engfunc(EngFunc_WriteCoord, origin[2]) // z

	engfunc(EngFunc_WriteCoord, origin[0]) // x axis

	engfunc(EngFunc_WriteCoord, origin[1]) // y axis

	engfunc(EngFunc_WriteCoord, origin[2]+555.0) // z axis

	write_short(gSpriteCircle) // sprite

	write_byte(0) // startframe

	write_byte(0) // framerate

	write_byte(4) // life

	write_byte(60) // width

	write_byte(0) // noise

	write_byte(200) // red

	write_byte(200) // green

	write_byte(200) // blue

	write_byte(200) // brightness

	write_byte(1) // speed

	message_end()

}

  

// Set entity's rendering type (from fakemeta_util)

stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)

{

	static Float:color[3]

	color[0] = float(r)

	color[1] = float(g)

	color[2] = float(b)

	 

	set_pev(entity, pev_renderfx, fx)

	set_pev(entity, pev_rendercolor, color)

	set_pev(entity, pev_rendermode, render)

	set_pev(entity, pev_renderamt, float(amount))

}

 

// Get entity's speed (from fakemeta_util)

stock fm_get_speed(entity)

{

	static Float:velocity[3]

	pev(entity, pev_velocity, velocity)

	 

	return floatround(vector_length(velocity));

}
models ? sounds ? sprites ?
Sprits are already on orginal cs sprits file (so you dont need to download them again)
Sounds it's using normal HE sounds (you can change it)
Model (use any model you want you can change it also)

[ Post made via Android ]

User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 358
Joined: 11 Months Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

#8

Post by Muhammet20 » 1 Month Ago

sPe3doN wrote:
1 Month Ago
Muhammet20 wrote:
1 Month Ago
sPe3doN wrote:
1 Month Ago
try

Code: Select all

#include <zombie_escape>


// Settings file

new const ZE_SETTING_RESOURCES[] = "zombie_escape.ini"



// Default sounds

new const sound_grenade_flare_explode[][] = { "items/nvg_on.wav" }

 

#define MODEL_MAX_LENGTH 64

#define SOUND_MAX_LENGTH 64

#define SPRITE_MAX_LENGTH 64

 

// Models

new g_v_szModelFlareGrenade[MODEL_MAX_LENGTH] = "models/zombie_escape/v_grenade_explode.mdl"
new g_p_szModelFlareGrenade[MODEL_MAX_LENGTH] = "models/zombie_escape/p_grenade_explode.mdl"

// Sprites

new g_sprite_grenade_trail[SPRITE_MAX_LENGTH] = "sprites/laserbeam.spr"
new g_sprite_grenade_ring[SPRITE_MAX_LENGTH] = "sprites/shockwave.spr"
new g_sprite_grenade_explode[SPRITE_MAX_LENGTH] = "sprites/zerogxplode.spr"
new Array:g_sound_grenade_flare_explode

// HACK: pev_ field used to store custom nade types and their values



const PEV_NADE_TYPE = pev_flTimeStepSound
const NADE_TYPE_FLARE = 4444

 
new g_trailSpr, Expl, gSpriteCircle



public plugin_init()

{
	register_plugin("[ZE] Frost Nade", ZE_VERSION, AUTHORS)

	 

	register_forward(FM_SetModel, "fw_SetModel")

	RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade")

}

public plugin_precache()

{ 

	// Initialize arrays

	g_sound_grenade_flare_explode = ArrayCreate(SOUND_MAX_LENGTH, 1)

 

	// Load from external file

	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Sounds", "GRENADE FLARE", g_sound_grenade_flare_explode)

 

	// If we couldn't load custom sounds from file, use and save default ones

	

	new index

	if (ArraySize(g_sound_grenade_flare_explode) == 0)

	{

		for (index = 0; index < sizeof sound_grenade_flare_explode; index++)

		ArrayPushString(g_sound_grenade_flare_explode, sound_grenade_flare_explode[index])

 

		// Save to external file

		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Sounds", "GRENADE FLARE", g_sound_grenade_flare_explode)

	}

	

	// Load from external file, save if not found
	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_v_szModelFlareGrenade, charsmax(g_v_szModelFlareGrenade)))
		amx_save_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_v_szModelFlareGrenade)
	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_p_szModelFlareGrenade, charsmax(g_p_szModelFlareGrenade)))
		amx_save_setting_string(ZE_SETTING_RESOURCES, "Weapon Models", "GRENADE FLARE", g_p_szModelFlareGrenade)


	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "TRAIL", g_sprite_grenade_trail, charsmax(g_sprite_grenade_trail)))

		amx_save_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "TRAIL", g_sprite_grenade_trail)

		

	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "RING", g_sprite_grenade_ring, charsmax(g_sprite_grenade_ring)))

		amx_save_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "RING", g_sprite_grenade_ring)

		

	if (!amx_load_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "EXPLODE", g_sprite_grenade_explode, charsmax(g_sprite_grenade_explode)))

		amx_save_setting_string(ZE_SETTING_RESOURCES, "Grenade Sprites", "EXPLODE", g_sprite_grenade_explode)

 

 	new sound[SOUND_MAX_LENGTH]

	for (index = 0; index < ArraySize(g_sound_grenade_flare_explode); index++)

	{

		ArrayGetString(g_sound_grenade_flare_explode, index, sound, charsmax(sound))

		precache_sound(sound)

	}

	
	// Precache models
	precache_model(g_v_szModelFlareGrenade)
	precache_model(g_p_szModelFlareGrenade)



	g_trailSpr = precache_model(g_sprite_grenade_trail)

	Expl = precache_model("sprites/zerogxplode.spr")

	gSpriteCircle = precache_model("sprites/shockwave.spr")

	

}



public ze_fw_core_cure_post(id, attacker)

{

	// Set custom grenade model

	cs_set_player_view_model(id, CSW_SMOKEGRENADE, g_v_szModelFlareGrenade)
	cs_set_player_weap_model(id, CSW_SMOKEGRENADE, g_p_szModelFlareGrenade)
}

 

public ze_fw_core_infect(id, attacker)

{

	// Remove custom grenade model

	cs_reset_player_view_model(id, CSW_SMOKEGRENADE)

}

 

// Forward Set Model

public fw_SetModel(entity, const model[])

{

	// We don't care

	if (strlen(model) < 8)

		return;

 

	// Narrow down our matches a bit

	if (model[7] != 'w' || model[8] != '_')

		return;

 

	// Get damage time of grenade

	static Float:dmgtime

	pev(entity, pev_dmgtime, dmgtime)

 

	// Grenade not yet thrown

	if (dmgtime == 0.0)

		return;

 

	// Grenade's owner is zombie?

	if (ze_is_user_zombie(pev(entity, pev_owner)))

		return;

 

	// Smoke Grenade

	if (model[9] == 's' && model[10] == 'm')

	{



		// Give it a glow

		fm_set_rendering(entity, kRenderFxGlowShell, 200, 200, 200, kRenderNormal, 16);

 

		// And a colored trail

		message_begin(MSG_BROADCAST, SVC_TEMPENTITY)

		write_byte(TE_BEAMFOLLOW) // TE id

		write_short(entity) // entity

		write_short(g_trailSpr) // sprite

		write_byte(10) // life

		write_byte(7) // width

		write_byte(200) // r

		write_byte(200) // g

		write_byte(200) // b

		write_byte(200) // brightness

		message_end()

		 

		// Set grenade type on the thrown grenade entity

		set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_FLARE)

		 

	}

}

 

// Ham Grenade Think Forward

public fw_ThinkGrenade(entity)

{

	// Invalid entity

	if (!pev_valid(entity)) return HAM_IGNORED;

 

	// Get damage time of grenade

	static Float:dmgtime

	pev(entity, pev_dmgtime, dmgtime)

	 

	new Float:current_time = get_gametime()

	 

	// Check if it's time to go off

	if (dmgtime > current_time)

		return HAM_IGNORED;

 

	// Check if it's one of our custom nades

	if (pev(entity, PEV_NADE_TYPE) != NADE_TYPE_FLARE)

		return HAM_IGNORED;

	

	

	flare_explode(entity)

	

	// Get rid of the grenade

	engfunc(EngFunc_RemoveEntity, entity)

	return HAM_SUPERCEDE;



}



public flare_explode(entity)

{

	static Float:origin[3] // 

	pev(entity, pev_origin, origin)

	

	create_blast2(origin)

	 

	explode(entity, origin)

	 

	static attacker;

	attacker = pev(entity, pev_owner)

	 

	static victim

	victim = -1

	 

	while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, origin, Float:260.0)) != 0)

	{

		// Only effect alive humans

		if (!is_user_alive(victim) || !ze_is_user_zombie(victim))

			continue;

 

		static Float:orig[3], Float:dmg

		pev(victim, pev_origin, orig)

		dmg = 1267.0 - get_distance_f(origin, orig)

		 

		ExecuteHamB(Ham_TakeDamage, victim, entity, attacker, dmg, (1<<24))

		static name[32]; get_user_name(victim, name, charsmax(name))


	}

 

}

 

public explode(entiy, Float:origin[3])

{

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)

	write_byte(TE_EXPLOSION)

	engfunc(EngFunc_WriteCoord, origin[0])

	engfunc(EngFunc_WriteCoord, origin[1])

	engfunc(EngFunc_WriteCoord, origin[2])

	write_short(Expl)

	write_byte(60)

	write_byte(15)

	write_byte(0)

	message_end()

}



// Fire Grenade: Fire Blast



create_blast2(const Float:origin[3])

{

	// Smallest ring

	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)

	write_byte(TE_BEAMCYLINDER) // TE id

	engfunc(EngFunc_WriteCoord, origin[0]) // x

	engfunc(EngFunc_WriteCoord, origin[1]) // y

	engfunc(EngFunc_WriteCoord, origin[2]) // z

	engfunc(EngFunc_WriteCoord, origin[0]) // x axis

	engfunc(EngFunc_WriteCoord, origin[1]) // y axis

	engfunc(EngFunc_WriteCoord, origin[2]+385.0) // z axis

	write_short(gSpriteCircle) // sprite

	write_byte(0) // startframe

	write_byte(0) // framerate

	write_byte(4) // life

	write_byte(60) // width

	write_byte(0) // noise

	write_byte(200) // red

	write_byte(200) // green

	write_byte(200) // blue

	write_byte(200) // brightness

	write_byte(1) // speed

	message_end()

	

	// Medium ring

	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)

	write_byte(TE_BEAMCYLINDER) // TE id

	engfunc(EngFunc_WriteCoord, origin[0]) // x

	engfunc(EngFunc_WriteCoord, origin[1]) // y

	engfunc(EngFunc_WriteCoord, origin[2]) // z

	engfunc(EngFunc_WriteCoord, origin[0]) // x axis

	engfunc(EngFunc_WriteCoord, origin[1]) // y axis

	engfunc(EngFunc_WriteCoord, origin[2]+470.0) // z axis

	write_short(gSpriteCircle) // sprite

	write_byte(0) // startframe

	write_byte(0) // framerate

	write_byte(4) // life

	write_byte(60) // width

	write_byte(0) // noise

	write_byte(200) // red

	write_byte(200) // green

	write_byte(200) // blue

	write_byte(200) // brightness

	write_byte(1) // speed

	message_end()

	

	// Largest ring

	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)

	write_byte(TE_BEAMCYLINDER) // TE id

	engfunc(EngFunc_WriteCoord, origin[0]) // x

	engfunc(EngFunc_WriteCoord, origin[1]) // y

	engfunc(EngFunc_WriteCoord, origin[2]) // z

	engfunc(EngFunc_WriteCoord, origin[0]) // x axis

	engfunc(EngFunc_WriteCoord, origin[1]) // y axis

	engfunc(EngFunc_WriteCoord, origin[2]+555.0) // z axis

	write_short(gSpriteCircle) // sprite

	write_byte(0) // startframe

	write_byte(0) // framerate

	write_byte(4) // life

	write_byte(60) // width

	write_byte(0) // noise

	write_byte(200) // red

	write_byte(200) // green

	write_byte(200) // blue

	write_byte(200) // brightness

	write_byte(1) // speed

	message_end()

}

  

// Set entity's rendering type (from fakemeta_util)

stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)

{

	static Float:color[3]

	color[0] = float(r)

	color[1] = float(g)

	color[2] = float(b)

	 

	set_pev(entity, pev_renderfx, fx)

	set_pev(entity, pev_rendercolor, color)

	set_pev(entity, pev_rendermode, render)

	set_pev(entity, pev_renderamt, float(amount))

}

 

// Get entity's speed (from fakemeta_util)

stock fm_get_speed(entity)

{

	static Float:velocity[3]

	pev(entity, pev_velocity, velocity)

	 

	return floatround(vector_length(velocity));

}
models ? sounds ? sprites ?
Sprits are already on orginal cs sprits file (so you dont need to download them again)
Sounds it's using normal HE sounds (you can change it)
Model (use any model you want you can change it also)
okay thanks bro
.::Kaya Gaming || Never Give Up || Zombie Escape::.
https://kaya-gaming.ga/index.php

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest