Plugin Available new skills

Unpaid Requests, Public Plugins
Post Reply
czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 439
Joined: 1 Year Ago
Has thanked: 17 times
Been thanked: 1 time
Contact:

new skills

#1

Post by czirimbolo » 1 Month Ago

Hey, can someone convert it and make it as EXTRA ITEM for zombies?

Code: Select all

#include <amxmodx>
#include <engine>
#include <fakemeta_util>
#include <dhudmessage>
#include <zombieplague>

#define PLUGIN		"Nemesis Skill"
#define VERSION		"1.0"
#define AUTHOR		"Universe"

#define TASK_FBURN		100
#define ID_FBURN		(taskid - TASK_FBURN)

new bool:g_fRoundEnd, g_burning_duration[33], g_UseSkill[33] = 0, g_UseSkillCooldown[33], bool:g_SkillIsCooldown[33], bool:g_RoundEnd
new g_smoke[33], g_smoke_wait[33], Float:g_smoke_origin[33][3]
new g_flameSpr, g_smokeSpr, g_Sprite, g_Smoke_Skill_Sprite

#define FIRE_DURATION 10								// Длительность способности (Указывается в секундах)
#define FIRE_DAMAGE 5									// Урон в секунду (Целочисленное значение)

#define SKILL_COUNT 2									// Количество допустимых использований способности
#define SKILL_COOLDOWN 10.0								// Перезарядка способности в секундах (Обязательно, должен указываться в дробном числе!)

#define SKILL_SMOKE_TIME 10.0							// Длительность дыма в секундах (Обязательно, должен указываться в дробном числе!);
#define SKILL_SMOKE_COOLDOWN 15.0						// Перезарядка способности в секундах (Обязательно, должен указываться в дробном числе!)
#define SKILL_SMOKE_SIZE 5								// Размер дыма (Не советую ставить больше 5)

#define SKILL_WAVE_RADIUS 250.0							// Радиус волны (Обязательно, должен указываться в дробном числе!)
new const skill_wave_color[3] = {255, 0, 0}				// Если в спрайте есть такой функционал, то можно его настроить (Цвет волны)

new const skill_sprite_wave[] = "sprites/yourname/shockwave.spr"		// Спрайт испускаемой волны
new const skill_sprite_flame[] = "sprites/yourname/flame.spr"		// Спрайт огня
new const skill_sprite_smoke[] = "sprites/yourname/black_smoke3.spr"	// Спрайт дыма, после окончания поджога
new const skill_sprite_smoke_cloud[] = "sprites/yourname/smoke.spr"	// Спрайт дымовой завесы

new const skill_sound_smoke_cloud[][] = { "yourname/smoke.wav" }		// Звук дымовой завесы
new const skill_sound_wave[][] = { "yourname/slash.wav" }			// Звук волны

enum (+= 100)
{
	TASK_SMOKE = 2000,
	TASK_SMOKE_EXP,
	TASK_WAIT_SMOKE,
	TASK_BOT_USE_SKILL
}

#define ID_SMOKE (taskid - TASK_SMOKE)
#define ID_SMOKE_EXP (taskid - TASK_SMOKE_EXP)
#define ID_WAIT_SMOKE (taskid - TASK_WAIT_SMOKE)
#define ID_BOT_USE_SKILL (taskid - TASK_BOT_USE_SKILL)

public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_forward(FM_CmdStart, "fw_CmdStart");
	register_logevent("RoundEnd", 2, "1 = Round_End");
	
	register_event("HLTV", "event_round_start", "a", "1 = 0", "2 = 0");
}

public client_putinserver(iPlayer)
{
	g_UseSkill[iPlayer] = 0;
	g_SkillIsCooldown[iPlayer] = false;
	Reset(iPlayer);
}

public client_disconnect(iPlayer)
{
	g_UseSkill[iPlayer] = 0;
	g_SkillIsCooldown[iPlayer] = false;
	Reset(iPlayer);
}

public zp_user_infected_post(id, infector)
{
	if(zp_get_user_nemesis(id))
	{
		ChatColor(id, "!gFirewave ability, !rPress on [E]");			
		ChatColor(id, "!gSmoke screen capability, !rPress on [R]");
	}
}

public RoundEnd()
{
	g_RoundEnd = true;
	
	for(new i = 1; i <= 32; i++)
	{
		if(zp_get_user_nemesis(i))
		{
			g_UseSkill[i] = 0;
			g_SkillIsCooldown[i] = false;
		}
	}
}

public event_round_start()
	g_RoundEnd = false;

public plugin_precache()
{
	g_Sprite = precache_model(skill_sprite_wave);
	g_flameSpr = precache_model(skill_sprite_flame);
	g_smokeSpr = precache_model(skill_sprite_smoke);
	g_Smoke_Skill_Sprite = precache_model(skill_sprite_smoke_cloud);
	
	static i
	for(i = 0; i < sizeof skill_sound_smoke_cloud; i++)
		precache_sound(skill_sound_smoke_cloud[i]);
		
	for(i = 0; i < sizeof skill_sound_wave; i++)	
		precache_sound(skill_sound_wave[i]);
}

public fw_CmdStart(iPlayer, UcHandle, Seed)
{
	if(!is_user_alive(iPlayer))
		return FMRES_IGNORED;

	if(zp_get_user_nemesis(iPlayer))
	{
		static button, oldbutton;
		button = get_uc(UcHandle, UC_Buttons);
		oldbutton = pev(iPlayer, pev_oldbuttons);
		
		if((button & IN_USE) && !(oldbutton & IN_USE))
		{
			g_UseSkillCooldown[iPlayer] = floatround(SKILL_COOLDOWN);
			
			if(g_UseSkill[iPlayer] < SKILL_COUNT)
			{
				set_task(1.0, "Skill_Cooldown", iPlayer, _, _, "a", g_UseSkillCooldown[iPlayer]);
				
				if(!g_SkillIsCooldown[iPlayer])
				{
					g_SkillIsCooldown[iPlayer] = true;
					use_skill_wave(iPlayer);
					g_UseSkill[iPlayer]++;
					new count = SKILL_COUNT - g_UseSkill[iPlayer];
					emit_sound(iPlayer, CHAN_STREAM,  skill_sound_wave[random_num(0, sizeof skill_sound_wave - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
					set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0, false)             
					show_dhudmessage(iPlayer, "You used the ability! Do you have more  %i uses!", count);
				}
				else
				{
					set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0, false)             
					show_dhudmessage(iPlayer, "The ability is not ready yet!");
				}
			}
			else if(g_UseSkill[iPlayer] + 1 > SKILL_COUNT)
			{
				set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0, false)             
				show_dhudmessage(iPlayer, "You have already used the allowable limit of abilities!");
			}
		}
		else if((button & IN_RELOAD) && !(oldbutton & IN_RELOAD))
		{
			if (g_RoundEnd) 
				return FMRES_IGNORED;
	
			if (zp_get_user_nemesis(iPlayer) && !g_smoke[iPlayer] && !g_smoke_wait[iPlayer])
			{
				g_smoke[iPlayer] = 1
				pev(iPlayer, pev_origin, g_smoke_origin[iPlayer])
				set_task(0.1, "SmokeExplode", iPlayer + TASK_SMOKE_EXP)
				emit_sound(iPlayer, CHAN_STREAM, skill_sound_smoke_cloud[random_num(0, sizeof skill_sound_smoke_cloud - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
				set_task(SKILL_SMOKE_TIME, "RemoveSmoke", iPlayer + TASK_SMOKE)
			}
		}
		
		return FMRES_HANDLED;
	}
	
	return FMRES_HANDLED;
}

public Skill_Cooldown(iPlayer)
{
	if(is_user_alive(iPlayer))
	{
		g_UseSkillCooldown[iPlayer] = g_UseSkillCooldown[iPlayer] - 1;

		if(g_SkillIsCooldown[iPlayer] && (SKILL_COUNT - g_UseSkill[iPlayer] != 0))
		{
			if(g_UseSkillCooldown[iPlayer] <= 0)
			{
				remove_task(iPlayer);

				g_UseSkillCooldown[iPlayer] = 0;
				g_SkillIsCooldown[iPlayer] = false;
				set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0, false)             
				show_dhudmessage(iPlayer, "Ability is ready!");
			}
		}
		else
			remove_task(iPlayer);
	}
}

public use_skill_wave(iPlayer)
{
	static Float:flOrigin[3], iVictim;
	entity_get_vector(iPlayer, EV_VEC_origin, flOrigin);
	
	iVictim = -1;

	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin, 0);
	write_byte(TE_BEAMCYLINDER);
	engfunc(EngFunc_WriteCoord, flOrigin[0]); 
	engfunc(EngFunc_WriteCoord, flOrigin[1]);
	engfunc(EngFunc_WriteCoord, flOrigin[2]); 
	engfunc(EngFunc_WriteCoord, flOrigin[0]); 
	engfunc(EngFunc_WriteCoord, flOrigin[1]); 
	engfunc(EngFunc_WriteCoord, flOrigin[2] + SKILL_WAVE_RADIUS);
	write_short(g_Sprite); 
	write_byte(0); 
	write_byte(0);
	write_byte(10);
	write_byte(25); 
	write_byte(0); 
	write_byte(skill_wave_color[0]); 
	write_byte(skill_wave_color[1]);
	write_byte(skill_wave_color[2]); 
	write_byte(200); 
	write_byte(0); 
	message_end();
	
	while((iVictim = find_ent_in_sphere(iVictim, flOrigin, SKILL_WAVE_RADIUS)) != 0)
	{
		if(is_user_connected(iVictim) && is_user_alive(iVictim) && !zp_get_user_zombie(iVictim))
		{	
			if(!task_exists(iVictim + TASK_FBURN))
			{
				g_burning_duration[iVictim] += FIRE_DURATION * 5;
				set_task(0.1, "BurningFlame", iVictim + TASK_FBURN, _, _, "b");
			}
		}
	}
}

public BurningFlame(taskid)
{
	static origin[3];
	
	get_user_origin(ID_FBURN, origin);
	
	if (g_fRoundEnd ||  g_burning_duration[ID_FBURN] < 1 || zp_get_user_nemesis(ID_FBURN))
	{
		message_begin(MSG_PVS, SVC_TEMPENTITY, origin);
		write_byte(TE_SMOKE);
		write_coord(origin[0]);
		write_coord(origin[1]);
		write_coord(origin[2] - 50);
		write_short(g_smokeSpr);
		write_byte(random_num(15, 20));
		write_byte(random_num(10, 20));
		message_end();

		remove_task(taskid);
		
		return;
	}

	static health;
	health = pev(ID_FBURN, pev_health);

	if(health - FIRE_DAMAGE > 0)
		fm_set_user_health(ID_FBURN, health - FIRE_DAMAGE);
	else if(health - FIRE_DAMAGE <= 0)
		fm_set_user_health(ID_FBURN, 1);
	
	message_begin(MSG_PVS, SVC_TEMPENTITY, origin);
	write_byte(TE_SPRITE);
	write_coord(origin[0] + random_num(-5, 5));
	write_coord(origin[1] + random_num(-5, 5));
	write_coord(origin[2] + random_num(-10, 10));
	write_short(g_flameSpr);
	write_byte(random_num(5, 10));
	write_byte(200);
	message_end();

	g_burning_duration[ID_FBURN]--;
}

public SmokeExplode(taskid)
{
	new id = ID_SMOKE_EXP
	
	if (!g_smoke[id])
	{
		remove_task(id+TASK_SMOKE_EXP)
		return;
	}
	
	new Float:origin[3]
	origin[0] = g_smoke_origin[id][0]
	origin[1] = g_smoke_origin[id][1]
	origin[2] = g_smoke_origin[id][2]
	
	new flags = pev(id, pev_flags)
	if (!((flags & FL_DUCKING) && (flags & FL_ONGROUND)))
		origin[2] -= 36.0
	
	Create_Smoke_Group(origin)
	set_task(1.0, "SmokeExplode", id+TASK_SMOKE_EXP)
	
	return;
}

public RemoveSmoke(taskid)
{
	new id = ID_SMOKE
	
	g_smoke[id] = 0
	g_smoke_wait[id] = 1
	
	set_task(SKILL_SMOKE_COOLDOWN, "RemoveWaitSmoke", id+TASK_WAIT_SMOKE)
}

public RemoveWaitSmoke(taskid)
{
	new id = ID_WAIT_SMOKE
	
	g_smoke_wait[id] = 0
	
	set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0, false)             
	show_dhudmessage(id, "Способность готова!");
}

Create_Smoke_Group(Float:position[3])
{
	new Float:origin[12][3]
	get_spherical_coord(position, 40.0, 0.0, 0.0, origin[0])
	get_spherical_coord(position, 40.0, 90.0, 0.0, origin[1])
	get_spherical_coord(position, 40.0, 180.0, 0.0, origin[2])
	get_spherical_coord(position, 40.0, 270.0, 0.0, origin[3])
	get_spherical_coord(position, 100.0, 0.0, 0.0, origin[4])
	get_spherical_coord(position, 100.0, 45.0, 0.0, origin[5])
	get_spherical_coord(position, 100.0, 90.0, 0.0, origin[6])
	get_spherical_coord(position, 100.0, 135.0, 0.0, origin[7])
	get_spherical_coord(position, 100.0, 180.0, 0.0, origin[8])
	get_spherical_coord(position, 100.0, 225.0, 0.0, origin[9])
	get_spherical_coord(position, 100.0, 270.0, 0.0, origin[10])
	get_spherical_coord(position, 100.0, 315.0, 0.0, origin[11])
	
	for (new i = 0; i < SKILL_SMOKE_SIZE; i++)
		create_Smoke(origin[i], g_Smoke_Skill_Sprite, 100, 0)
}

create_Smoke(const Float:position[3], sprite_index, life, framerate)
{
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
	write_byte(TE_SMOKE)
	engfunc(EngFunc_WriteCoord, position[0])
	engfunc(EngFunc_WriteCoord, position[1])
	engfunc(EngFunc_WriteCoord, position[2])
	write_short(sprite_index)
	write_byte(life)
	write_byte(framerate)
	message_end()
}

get_spherical_coord(const Float:ent_origin[3], Float:redius, Float:level_angle, Float:vertical_angle, Float:origin[3])
{
	new Float:length
	length  = redius * floatcos(vertical_angle, degrees)
	origin[0] = ent_origin[0] + length * floatcos(level_angle, degrees)
	origin[1] = ent_origin[1] + length * floatsin(level_angle, degrees)
	origin[2] = ent_origin[2] + redius * floatsin(vertical_angle, degrees)
}

stock Reset(iPlayer)
{
	g_smoke[iPlayer] = 0;
	g_smoke_wait[iPlayer] = 0;
	
	remove_task(iPlayer + TASK_SMOKE);
	remove_task(iPlayer + TASK_WAIT_SMOKE);
	remove_task(iPlayer + TASK_SMOKE_EXP);
	remove_task(iPlayer + TASK_BOT_USE_SKILL);
}

stock ChatColor(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
    
	replace_all(msg, 190, "!g", "^4") 
	replace_all(msg, 190, "!y", "^1") 
	replace_all(msg, 190, "!r", "^3") 
	replace_all(msg, 190, "!b", "^0")
    
	if (id) players[0] = id; else get_players(players, count, "ch")
	{
		for (new i = 0; i < count; i++)
		{
			if (is_user_connected(players[i]))
			{
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), {0,0,0}, players[i])
				write_byte(players[i]);
				write_string(msg);
				message_end();
			}
		}
	}
}
Image

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 439
Joined: 1 Year Ago
Has thanked: 17 times
Been thanked: 1 time
Contact:

#2

Post by czirimbolo » 1 Month Ago

Jack, can you try ?
Image

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 512
Joined: 1 Year Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 42 times
Age: 18
Contact:

#3

Post by Jack GamePlay » 1 Month Ago

Try:

Code: Select all

#include <zombie_escape>
#include <engine>
#include <fakemeta_util>

#define PLUGIN		"Nemesis Skill"
#define VERSION		"1.0"
#define AUTHOR		"Universe"

#define TASK_FBURN		100
#define ID_FBURN		(taskid - TASK_FBURN)

new bool:g_fRoundEnd, g_burning_duration[33], g_UseSkill[33] = 0, g_UseSkillCooldown[33], bool:g_SkillIsCooldown[33], bool:g_RoundEnd
new g_smoke[33], g_smoke_wait[33], Float:g_smoke_origin[33][3]
new g_flameSpr, g_smokeSpr, g_Sprite, g_Smoke_Skill_Sprite, g_iItemId, bool:g_bHasAbility[33]

#define FIRE_DURATION 10								// Длительность способности (Указывается в секундах)
#define FIRE_DAMAGE 5									// Урон в секунду (Целочисленное значение)

#define SKILL_COUNT 2									// Количество допустимых использований способности
#define SKILL_COOLDOWN 10.0								// Перезарядка способности в секундах (Обязательно, должен указываться в дробном числе!)

#define SKILL_SMOKE_TIME 10.0							// Длительность дыма в секундах (Обязательно, должен указываться в дробном числе!);
#define SKILL_SMOKE_COOLDOWN 15.0						// Перезарядка способности в секундах (Обязательно, должен указываться в дробном числе!)
#define SKILL_SMOKE_SIZE 5								// Размер дыма (Не советую ставить больше 5)

#define SKILL_WAVE_RADIUS 250.0							// Радиус волны (Обязательно, должен указываться в дробном числе!)
new const skill_wave_color[3] = {255, 0, 0}				// Если в спрайте есть такой функционал, то можно его настроить (Цвет волны)

new const skill_sprite_wave[] = "sprites/yourname/shockwave.spr"		// Спрайт испускаемой волны
new const skill_sprite_flame[] = "sprites/yourname/flame.spr"		// Спрайт огня
new const skill_sprite_smoke[] = "sprites/yourname/black_smoke3.spr"	// Спрайт дыма, после окончания поджога
new const skill_sprite_smoke_cloud[] = "sprites/yourname/smoke.spr"	// Спрайт дымовой завесы

new const skill_sound_smoke_cloud[][] = { "yourname/smoke.wav" }		// Звук дымовой завесы
new const skill_sound_wave[][] = { "yourname/slash.wav" }			// Звук волны

enum (+= 100)
{
	TASK_SMOKE = 2000,
	TASK_SMOKE_EXP,
	TASK_WAIT_SMOKE,
	TASK_BOT_USE_SKILL
}

#define ID_SMOKE (taskid - TASK_SMOKE)
#define ID_SMOKE_EXP (taskid - TASK_SMOKE_EXP)
#define ID_WAIT_SMOKE (taskid - TASK_WAIT_SMOKE)
#define ID_BOT_USE_SKILL (taskid - TASK_BOT_USE_SKILL)

public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_forward(FM_CmdStart, "fw_CmdStart");
	register_logevent("RoundEnd", 2, "1 = Round_End");
	
	register_event("HLTV", "event_round_start", "a", "1 = 0", "2 = 0");

	g_iItemId = ze_register_item("Ability", 0, 0)
}

public ze_select_item_pre(id, itemid)
{
	if (itemid != g_iItemId)
		return ZE_ITEM_AVAILABLE

	if (!ze_is_user_zombie(id))
		return ZE_ITEM_DONT_SHOW

	return ZE_ITEM_AVAILABLE
}

public ze_select_item_post(id, itemid)
{
	if (itemid != g_iItemId)
		return

	g_bHasAbility[id] = true
}
public client_putinserver(iPlayer)
{
	g_UseSkill[iPlayer] = 0;
	g_SkillIsCooldown[iPlayer] = false;
	g_bHasAbility[iPlayer] = false
	Reset(iPlayer);
}

public client_disconnected(iPlayer)
{
	g_UseSkill[iPlayer] = 0;
	g_SkillIsCooldown[iPlayer] = false;
	g_bHasAbility[iPlayer] = false
	Reset(iPlayer);
}

public ze_user_infected(id)
{
	if(ze_is_user_zombie(id) && g_bHasAbility[id])
	{
		ChatColor(id, "!gFirewave ability, !rPress on [E]");			
		ChatColor(id, "!gSmoke screen capability, !rPress on [R]");
	}
}

public RoundEnd()
{
	g_RoundEnd = true;
	
	for(new i = 1; i <= 32; i++)
	{
		if(zp_get_user_nemesis(i))
		{
			g_UseSkill[i] = 0;
			g_SkillIsCooldown[i] = false;
			g_bHasAbility[id] = false
		}
	}
}

public event_round_start()
	g_RoundEnd = false;

public plugin_precache()
{
	g_Sprite = precache_model(skill_sprite_wave);
	g_flameSpr = precache_model(skill_sprite_flame);
	g_smokeSpr = precache_model(skill_sprite_smoke);
	g_Smoke_Skill_Sprite = precache_model(skill_sprite_smoke_cloud);
	
	static i
	for(i = 0; i < sizeof skill_sound_smoke_cloud; i++)
		precache_sound(skill_sound_smoke_cloud[i]);
		
	for(i = 0; i < sizeof skill_sound_wave; i++)	
		precache_sound(skill_sound_wave[i]);
}

public fw_CmdStart(iPlayer, UcHandle, Seed)
{
	if(!is_user_alive(iPlayer))
		return FMRES_IGNORED;

	if(ze_is_user_zombie(iPlayer) && g_bHasAbility[iPlayer])
	{
		static button, oldbutton;
		button = get_uc(UcHandle, UC_Buttons);
		oldbutton = pev(iPlayer, pev_oldbuttons);
		
		if((button & IN_USE) && !(oldbutton & IN_USE))
		{
			g_UseSkillCooldown[iPlayer] = floatround(SKILL_COOLDOWN);
			
			if(g_UseSkill[iPlayer] < SKILL_COUNT)
			{
				set_task(1.0, "Skill_Cooldown", iPlayer, _, _, "a", g_UseSkillCooldown[iPlayer]);
				
				if(!g_SkillIsCooldown[iPlayer])
				{
					g_SkillIsCooldown[iPlayer] = true;
					use_skill_wave(iPlayer);
					g_UseSkill[iPlayer]++;
					new count = SKILL_COUNT - g_UseSkill[iPlayer];
					emit_sound(iPlayer, CHAN_STREAM,  skill_sound_wave[random_num(0, sizeof skill_sound_wave - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
					set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0, false)             
					show_dhudmessage(iPlayer, "You used the ability! Do you have more  %i uses!", count);
				}
				else
				{
					set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0, false)             
					show_dhudmessage(iPlayer, "The ability is not ready yet!");
				}
			}
			else if(g_UseSkill[iPlayer] + 1 > SKILL_COUNT)
			{
				set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0, false)             
				show_dhudmessage(iPlayer, "You have already used the allowable limit of abilities!");
			}
		}
		else if((button & IN_RELOAD) && !(oldbutton & IN_RELOAD))
		{
			if (g_RoundEnd) 
				return FMRES_IGNORED;
	
			if (ze_is_user_zombie(iPlayer) && !g_smoke[iPlayer] && !g_smoke_wait[iPlayer])
			{
				g_smoke[iPlayer] = 1
				pev(iPlayer, pev_origin, g_smoke_origin[iPlayer])
				set_task(0.1, "SmokeExplode", iPlayer + TASK_SMOKE_EXP)
				emit_sound(iPlayer, CHAN_STREAM, skill_sound_smoke_cloud[random_num(0, sizeof skill_sound_smoke_cloud - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
				set_task(SKILL_SMOKE_TIME, "RemoveSmoke", iPlayer + TASK_SMOKE)
			}
		}
		
		return FMRES_HANDLED;
	}
	
	return FMRES_HANDLED;
}

public Skill_Cooldown(iPlayer)
{
	if(is_user_alive(iPlayer))
	{
		g_UseSkillCooldown[iPlayer] = g_UseSkillCooldown[iPlayer] - 1;

		if(g_SkillIsCooldown[iPlayer] && (SKILL_COUNT - g_UseSkill[iPlayer] != 0))
		{
			if(g_UseSkillCooldown[iPlayer] <= 0)
			{
				remove_task(iPlayer);

				g_UseSkillCooldown[iPlayer] = 0;
				g_SkillIsCooldown[iPlayer] = false;
				set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0, false)             
				show_dhudmessage(iPlayer, "Ability is ready!");
			}
		}
		else
			remove_task(iPlayer);
	}
}

public use_skill_wave(iPlayer)
{
	static Float:flOrigin[3], iVictim;
	entity_get_vector(iPlayer, EV_VEC_origin, flOrigin);
	
	iVictim = -1;

	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin, 0);
	write_byte(TE_BEAMCYLINDER);
	engfunc(EngFunc_WriteCoord, flOrigin[0]); 
	engfunc(EngFunc_WriteCoord, flOrigin[1]);
	engfunc(EngFunc_WriteCoord, flOrigin[2]); 
	engfunc(EngFunc_WriteCoord, flOrigin[0]); 
	engfunc(EngFunc_WriteCoord, flOrigin[1]); 
	engfunc(EngFunc_WriteCoord, flOrigin[2] + SKILL_WAVE_RADIUS);
	write_short(g_Sprite); 
	write_byte(0); 
	write_byte(0);
	write_byte(10);
	write_byte(25); 
	write_byte(0); 
	write_byte(skill_wave_color[0]); 
	write_byte(skill_wave_color[1]);
	write_byte(skill_wave_color[2]); 
	write_byte(200); 
	write_byte(0); 
	message_end();
	
	while((iVictim = find_ent_in_sphere(iVictim, flOrigin, SKILL_WAVE_RADIUS)) != 0)
	{
		if(is_user_connected(iVictim) && is_user_alive(iVictim) && !zp_get_user_zombie(iVictim))
		{	
			if(!task_exists(iVictim + TASK_FBURN))
			{
				g_burning_duration[iVictim] += FIRE_DURATION * 5;
				set_task(0.1, "BurningFlame", iVictim + TASK_FBURN, _, _, "b");
			}
		}
	}
}

public BurningFlame(taskid)
{
	static origin[3];
	
	get_user_origin(ID_FBURN, origin);
	
	if (g_fRoundEnd ||  g_burning_duration[ID_FBURN] < 1 || zp_get_user_nemesis(ID_FBURN))
	{
		message_begin(MSG_PVS, SVC_TEMPENTITY, origin);
		write_byte(TE_SMOKE);
		write_coord(origin[0]);
		write_coord(origin[1]);
		write_coord(origin[2] - 50);
		write_short(g_smokeSpr);
		write_byte(random_num(15, 20));
		write_byte(random_num(10, 20));
		message_end();

		remove_task(taskid);
		
		return;
	}

	static health;
	health = pev(ID_FBURN, pev_health);

	if(health - FIRE_DAMAGE > 0)
		fm_set_user_health(ID_FBURN, health - FIRE_DAMAGE);
	else if(health - FIRE_DAMAGE <= 0)
		fm_set_user_health(ID_FBURN, 1);
	
	message_begin(MSG_PVS, SVC_TEMPENTITY, origin);
	write_byte(TE_SPRITE);
	write_coord(origin[0] + random_num(-5, 5));
	write_coord(origin[1] + random_num(-5, 5));
	write_coord(origin[2] + random_num(-10, 10));
	write_short(g_flameSpr);
	write_byte(random_num(5, 10));
	write_byte(200);
	message_end();

	g_burning_duration[ID_FBURN]--;
}

public SmokeExplode(taskid)
{
	new id = ID_SMOKE_EXP
	
	if (!g_smoke[id])
	{
		remove_task(id+TASK_SMOKE_EXP)
		return;
	}
	
	new Float:origin[3]
	origin[0] = g_smoke_origin[id][0]
	origin[1] = g_smoke_origin[id][1]
	origin[2] = g_smoke_origin[id][2]
	
	new flags = pev(id, pev_flags)
	if (!((flags & FL_DUCKING) && (flags & FL_ONGROUND)))
		origin[2] -= 36.0
	
	Create_Smoke_Group(origin)
	set_task(1.0, "SmokeExplode", id+TASK_SMOKE_EXP)
	
	return;
}

public RemoveSmoke(taskid)
{
	new id = ID_SMOKE
	
	g_smoke[id] = 0
	g_smoke_wait[id] = 1
	
	set_task(SKILL_SMOKE_COOLDOWN, "RemoveWaitSmoke", id+TASK_WAIT_SMOKE)
}

public RemoveWaitSmoke(taskid)
{
	new id = ID_WAIT_SMOKE
	
	g_smoke_wait[id] = 0
	
	set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0, false)             
	show_dhudmessage(id, "Способность готова!");
}

Create_Smoke_Group(Float:position[3])
{
	new Float:origin[12][3]
	get_spherical_coord(position, 40.0, 0.0, 0.0, origin[0])
	get_spherical_coord(position, 40.0, 90.0, 0.0, origin[1])
	get_spherical_coord(position, 40.0, 180.0, 0.0, origin[2])
	get_spherical_coord(position, 40.0, 270.0, 0.0, origin[3])
	get_spherical_coord(position, 100.0, 0.0, 0.0, origin[4])
	get_spherical_coord(position, 100.0, 45.0, 0.0, origin[5])
	get_spherical_coord(position, 100.0, 90.0, 0.0, origin[6])
	get_spherical_coord(position, 100.0, 135.0, 0.0, origin[7])
	get_spherical_coord(position, 100.0, 180.0, 0.0, origin[8])
	get_spherical_coord(position, 100.0, 225.0, 0.0, origin[9])
	get_spherical_coord(position, 100.0, 270.0, 0.0, origin[10])
	get_spherical_coord(position, 100.0, 315.0, 0.0, origin[11])
	
	for (new i = 0; i < SKILL_SMOKE_SIZE; i++)
		create_Smoke(origin[i], g_Smoke_Skill_Sprite, 100, 0)
}

create_Smoke(const Float:position[3], sprite_index, life, framerate)
{
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
	write_byte(TE_SMOKE)
	engfunc(EngFunc_WriteCoord, position[0])
	engfunc(EngFunc_WriteCoord, position[1])
	engfunc(EngFunc_WriteCoord, position[2])
	write_short(sprite_index)
	write_byte(life)
	write_byte(framerate)
	message_end()
}

get_spherical_coord(const Float:ent_origin[3], Float:redius, Float:level_angle, Float:vertical_angle, Float:origin[3])
{
	new Float:length
	length  = redius * floatcos(vertical_angle, degrees)
	origin[0] = ent_origin[0] + length * floatcos(level_angle, degrees)
	origin[1] = ent_origin[1] + length * floatsin(level_angle, degrees)
	origin[2] = ent_origin[2] + redius * floatsin(vertical_angle, degrees)
}

stock Reset(iPlayer)
{
	g_smoke[iPlayer] = 0;
	g_smoke_wait[iPlayer] = 0;
	
	remove_task(iPlayer + TASK_SMOKE);
	remove_task(iPlayer + TASK_WAIT_SMOKE);
	remove_task(iPlayer + TASK_SMOKE_EXP);
	remove_task(iPlayer + TASK_BOT_USE_SKILL);
}

stock ChatColor(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)
    
	replace_all(msg, 190, "!g", "^4") 
	replace_all(msg, 190, "!y", "^1") 
	replace_all(msg, 190, "!r", "^3") 
	replace_all(msg, 190, "!b", "^0")
    
	if (id) players[0] = id; else get_players(players, count, "ch")
	{
		for (new i = 0; i < count; i++)
		{
			if (is_user_connected(players[i]))
			{
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), {0,0,0}, players[i])
				write_byte(players[i]);
				write_string(msg);
				message_end();
			}
		}
	}
}
Image

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 439
Joined: 1 Year Ago
Has thanked: 17 times
Been thanked: 1 time
Contact:

#4

Post by czirimbolo » 1 Month Ago

// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(1) : error 010: invalid function or declaration
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\include\engine.inc(799) : error 017: undefined symbol "kRenderFxNone"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(59) : error 017: undefined symbol "ze_register_item"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(65) : error 017: undefined symbol "ZE_ITEM_AVAILABLE"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(67) : error 017: undefined symbol "ze_is_user_zombie"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(68) : error 017: undefined symbol "ZE_ITEM_DONT_SHOW"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(70) : error 017: undefined symbol "ZE_ITEM_AVAILABLE"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(98) : error 017: undefined symbol "ze_is_user_zombie"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(111) : error 017: undefined symbol "zp_get_user_nemesis"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(115) : error 017: undefined symbol "id"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(115 -- 116) : warning 215: expression has no effect
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(143) : error 017: undefined symbol "ze_is_user_zombie"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(164) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(169) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(175) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(184) : error 017: undefined symbol "ze_is_user_zombie"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(214) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(253) : error 017: undefined symbol "zp_get_user_zombie"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(270) : error 017: undefined symbol "zp_get_user_nemesis"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(349) : error 088: number of arguments does not match definition
//
// 19 Errors.
// Could not locate output file compiled\nemesis_skill.amx (compile failed).
//
// Compilation Time: 0,44 sec
Image

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 512
Joined: 1 Year Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 42 times
Age: 18
Contact:

#5

Post by Jack GamePlay » 1 Month Ago

czirimbolo wrote:
1 Month Ago
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(1) : error 010: invalid function or declaration
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\include\engine.inc(799) : error 017: undefined symbol "kRenderFxNone"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(59) : error 017: undefined symbol "ze_register_item"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(65) : error 017: undefined symbol "ZE_ITEM_AVAILABLE"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(67) : error 017: undefined symbol "ze_is_user_zombie"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(68) : error 017: undefined symbol "ZE_ITEM_DONT_SHOW"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(70) : error 017: undefined symbol "ZE_ITEM_AVAILABLE"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(98) : error 017: undefined symbol "ze_is_user_zombie"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(111) : error 017: undefined symbol "zp_get_user_nemesis"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(115) : error 017: undefined symbol "id"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(115 -- 116) : warning 215: expression has no effect
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(143) : error 017: undefined symbol "ze_is_user_zombie"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(164) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(169) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(175) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(184) : error 017: undefined symbol "ze_is_user_zombie"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(214) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(253) : error 017: undefined symbol "zp_get_user_zombie"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(270) : error 017: undefined symbol "zp_get_user_nemesis"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(349) : error 088: number of arguments does not match definition
//
// 19 Errors.
// Could not locate output file compiled\nemesis_skill.amx (compile failed).
//
// Compilation Time: 0,44 sec
Replace

Code: Select all

zp_get_user_nemesis
&

Code: Select all

zp_get_user_zombie
with

Code: Select all

ze_is_user_zombie
Image

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 439
Joined: 1 Year Ago
Has thanked: 17 times
Been thanked: 1 time
Contact:

#6

Post by czirimbolo » 1 Month Ago

//// nemesis_skill.sma
//
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(115) : error 017: undefined symbol "id"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(115 -- 116) : warning 215: expression has no effect
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(164) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(169) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(175) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(214) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(349) : error 088: number of arguments does not match definition
//
// 6 Errors.
// Could not locate output file compiled\nemesis_skill.amx (compile failed).
//
// Compilation Time: 1,27 sec
Image

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 512
Joined: 1 Year Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 42 times
Age: 18
Contact:

#7

Post by Jack GamePlay » 1 Month Ago

czirimbolo wrote:
1 Month Ago
//// nemesis_skill.sma
//
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(115) : error 017: undefined symbol "id"
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(115 -- 116) : warning 215: expression has no effect
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(164) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(169) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(175) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(214) : error 088: number of arguments does not match definition
// C:\Users\macie\Documents\Compiler v1.8.3\scripting\nemesis_skill.sma(349) : error 088: number of arguments does not match definition
//
// 6 Errors.
// Could not locate output file compiled\nemesis_skill.amx (compile failed).
//
// Compilation Time: 1,27 sec
Try:
  1. #include <zombie_escape>
  2. #include <engine>
  3. #include <fakemeta_util>
  4.  
  5. #define PLUGIN      "Nemesis Skill"
  6. #define VERSION     "1.0"
  7. #define AUTHOR      "Universe"
  8.  
  9. #define TASK_FBURN      100
  10. #define ID_FBURN        (taskid - TASK_FBURN)
  11.  
  12. new bool:g_fRoundEnd, g_burning_duration[33], g_UseSkill[33] = 0, g_UseSkillCooldown[33], bool:g_SkillIsCooldown[33], bool:g_RoundEnd
  13. new g_smoke[33], g_smoke_wait[33], Float:g_smoke_origin[33][3]
  14. new g_flameSpr, g_smokeSpr, g_Sprite, g_Smoke_Skill_Sprite, g_iItemId, bool:g_bHasAbility[33]
  15.  
  16. #define FIRE_DURATION 10                                // Длительность способности (Указывается в секундах)
  17. #define FIRE_DAMAGE 5                                   // Урон в секунду (Целочисленное значение)
  18.  
  19. #define SKILL_COUNT 2                                   // Количество допустимых использований способности
  20. #define SKILL_COOLDOWN 10.0                             // Перезарядка способности в секундах (Обязательно, должен указываться в дробном числе!)
  21.  
  22. #define SKILL_SMOKE_TIME 10.0                           // Длительность дыма в секундах (Обязательно, должен указываться в дробном числе!);
  23. #define SKILL_SMOKE_COOLDOWN 15.0                       // Перезарядка способности в секундах (Обязательно, должен указываться в дробном числе!)
  24. #define SKILL_SMOKE_SIZE 5                              // Размер дыма (Не советую ставить больше 5)
  25.  
  26. #define SKILL_WAVE_RADIUS 250.0                         // Радиус волны (Обязательно, должен указываться в дробном числе!)
  27. new const skill_wave_color[3] = {255, 0, 0}             // Если в спрайте есть такой функционал, то можно его настроить (Цвет волны)
  28.  
  29. new const skill_sprite_wave[] = "sprites/yourname/shockwave.spr"        // Спрайт испускаемой волны
  30. new const skill_sprite_flame[] = "sprites/yourname/flame.spr"       // Спрайт огня
  31. new const skill_sprite_smoke[] = "sprites/yourname/black_smoke3.spr"    // Спрайт дыма, после окончания поджога
  32. new const skill_sprite_smoke_cloud[] = "sprites/yourname/smoke.spr" // Спрайт дымовой завесы
  33.  
  34. new const skill_sound_smoke_cloud[][] = { "yourname/smoke.wav" }        // Звук дымовой завесы
  35. new const skill_sound_wave[][] = { "yourname/slash.wav" }           // Звук волны
  36.  
  37. enum (+= 100)
  38. {
  39.     TASK_SMOKE = 2000,
  40.     TASK_SMOKE_EXP,
  41.     TASK_WAIT_SMOKE,
  42.     TASK_BOT_USE_SKILL
  43. }
  44.  
  45. #define ID_SMOKE (taskid - TASK_SMOKE)
  46. #define ID_SMOKE_EXP (taskid - TASK_SMOKE_EXP)
  47. #define ID_WAIT_SMOKE (taskid - TASK_WAIT_SMOKE)
  48. #define ID_BOT_USE_SKILL (taskid - TASK_BOT_USE_SKILL)
  49.  
  50. public plugin_init()
  51. {
  52.     register_plugin(PLUGIN, VERSION, AUTHOR);
  53.    
  54.     register_forward(FM_CmdStart, "fw_CmdStart");
  55.     register_logevent("RoundEnd", 2, "1 = Round_End");
  56.    
  57.     register_event("HLTV", "event_round_start", "a", "1 = 0", "2 = 0");
  58.  
  59.     g_iItemId = ze_register_item("Ability", 0, 0)
  60. }
  61.  
  62. public ze_select_item_pre(id, itemid)
  63. {
  64.     if (itemid != g_iItemId)
  65.         return ZE_ITEM_AVAILABLE
  66.  
  67.     if (!ze_is_user_zombie(id))
  68.         return ZE_ITEM_DONT_SHOW
  69.  
  70.     return ZE_ITEM_AVAILABLE
  71. }
  72.  
  73. public ze_select_item_post(id, itemid)
  74. {
  75.     if (itemid != g_iItemId)
  76.         return
  77.  
  78.     g_bHasAbility[id] = true
  79. }
  80. public client_putinserver(iPlayer)
  81. {
  82.     g_UseSkill[iPlayer] = 0;
  83.     g_SkillIsCooldown[iPlayer] = false;
  84.     g_bHasAbility[iPlayer] = false
  85.     Reset(iPlayer);
  86. }
  87.  
  88. public client_disconnected(iPlayer)
  89. {
  90.     g_UseSkill[iPlayer] = 0;
  91.     g_SkillIsCooldown[iPlayer] = false;
  92.     g_bHasAbility[iPlayer] = false
  93.     Reset(iPlayer);
  94. }
  95.  
  96. public ze_user_infected(id)
  97. {
  98.     if(ze_is_user_zombie(id) && g_bHasAbility[id])
  99.     {
  100.         ChatColor(id, "!gFirewave ability, !rPress on [E]");           
  101.         ChatColor(id, "!gSmoke screen capability, !rPress on [R]");
  102.     }
  103. }
  104.  
  105. public RoundEnd()
  106. {
  107.     g_RoundEnd = true;
  108.    
  109.     for(new i = 1; i <= 32; i++)
  110.     {
  111.         if(ze_is_user_zombie(i))
  112.         {
  113.             g_UseSkill[i] = 0;
  114.             g_SkillIsCooldown[i] = false;
  115.             g_bHasAbility[i] = false
  116.         }
  117.     }
  118. }
  119.  
  120. public event_round_start()
  121.     g_RoundEnd = false;
  122.  
  123. public plugin_precache()
  124. {
  125.     g_Sprite = precache_model(skill_sprite_wave);
  126.     g_flameSpr = precache_model(skill_sprite_flame);
  127.     g_smokeSpr = precache_model(skill_sprite_smoke);
  128.     g_Smoke_Skill_Sprite = precache_model(skill_sprite_smoke_cloud);
  129.    
  130.     static i
  131.     for(i = 0; i < sizeof skill_sound_smoke_cloud; i++)
  132.         precache_sound(skill_sound_smoke_cloud[i]);
  133.        
  134.     for(i = 0; i < sizeof skill_sound_wave; i++)   
  135.         precache_sound(skill_sound_wave[i]);
  136. }
  137.  
  138. public fw_CmdStart(iPlayer, UcHandle, Seed)
  139. {
  140.     if(!is_user_alive(iPlayer))
  141.         return FMRES_IGNORED;
  142.  
  143.     if(ze_is_user_zombie(iPlayer) && g_bHasAbility[iPlayer])
  144.     {
  145.         static button, oldbutton;
  146.         button = get_uc(UcHandle, UC_Buttons);
  147.         oldbutton = pev(iPlayer, pev_oldbuttons);
  148.        
  149.         if((button & IN_USE) && !(oldbutton & IN_USE))
  150.         {
  151.             g_UseSkillCooldown[iPlayer] = floatround(SKILL_COOLDOWN);
  152.            
  153.             if(g_UseSkill[iPlayer] < SKILL_COUNT)
  154.             {
  155.                 set_task(1.0, "Skill_Cooldown", iPlayer, _, _, "a", g_UseSkillCooldown[iPlayer]);
  156.                
  157.                 if(!g_SkillIsCooldown[iPlayer])
  158.                 {
  159.                     g_SkillIsCooldown[iPlayer] = true;
  160.                     use_skill_wave(iPlayer);
  161.                     g_UseSkill[iPlayer]++;
  162.                     new count = SKILL_COUNT - g_UseSkill[iPlayer];
  163.                     emit_sound(iPlayer, CHAN_STREAM,  skill_sound_wave[random_num(0, sizeof skill_sound_wave - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
  164.                     set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0)            
  165.                     show_dhudmessage(iPlayer, "You used the ability! Do you have more  %i uses!", count);
  166.                 }
  167.                 else
  168.                 {
  169.                     set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0)            
  170.                     show_dhudmessage(iPlayer, "The ability is not ready yet!");
  171.                 }
  172.             }
  173.             else if(g_UseSkill[iPlayer] + 1 > SKILL_COUNT)
  174.             {
  175.                 set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0)            
  176.                 show_dhudmessage(iPlayer, "You have already used the allowable limit of abilities!");
  177.             }
  178.         }
  179.         else if((button & IN_RELOAD) && !(oldbutton & IN_RELOAD))
  180.         {
  181.             if (g_RoundEnd)
  182.                 return FMRES_IGNORED;
  183.    
  184.             if (ze_is_user_zombie(iPlayer) && !g_smoke[iPlayer] && !g_smoke_wait[iPlayer])
  185.             {
  186.                 g_smoke[iPlayer] = 1
  187.                 pev(iPlayer, pev_origin, g_smoke_origin[iPlayer])
  188.                 set_task(0.1, "SmokeExplode", iPlayer + TASK_SMOKE_EXP)
  189.                 emit_sound(iPlayer, CHAN_STREAM, skill_sound_smoke_cloud[random_num(0, sizeof skill_sound_smoke_cloud - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
  190.                 set_task(SKILL_SMOKE_TIME, "RemoveSmoke", iPlayer + TASK_SMOKE)
  191.             }
  192.         }
  193.        
  194.         return FMRES_HANDLED;
  195.     }
  196.    
  197.     return FMRES_HANDLED;
  198. }
  199.  
  200. public Skill_Cooldown(iPlayer)
  201. {
  202.     if(is_user_alive(iPlayer))
  203.     {
  204.         g_UseSkillCooldown[iPlayer] = g_UseSkillCooldown[iPlayer] - 1;
  205.  
  206.         if(g_SkillIsCooldown[iPlayer] && (SKILL_COUNT - g_UseSkill[iPlayer] != 0))
  207.         {
  208.             if(g_UseSkillCooldown[iPlayer] <= 0)
  209.             {
  210.                 remove_task(iPlayer);
  211.  
  212.                 g_UseSkillCooldown[iPlayer] = 0;
  213.                 g_SkillIsCooldown[iPlayer] = false;
  214.                 set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0)            
  215.                 show_dhudmessage(iPlayer, "Ability is ready!");
  216.             }
  217.         }
  218.         else
  219.             remove_task(iPlayer);
  220.     }
  221. }
  222.  
  223. public use_skill_wave(iPlayer)
  224. {
  225.     static Float:flOrigin[3], iVictim;
  226.     entity_get_vector(iPlayer, EV_VEC_origin, flOrigin);
  227.    
  228.     iVictim = -1;
  229.  
  230.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin, 0);
  231.     write_byte(TE_BEAMCYLINDER);
  232.     engfunc(EngFunc_WriteCoord, flOrigin[0]);
  233.     engfunc(EngFunc_WriteCoord, flOrigin[1]);
  234.     engfunc(EngFunc_WriteCoord, flOrigin[2]);
  235.     engfunc(EngFunc_WriteCoord, flOrigin[0]);
  236.     engfunc(EngFunc_WriteCoord, flOrigin[1]);
  237.     engfunc(EngFunc_WriteCoord, flOrigin[2] + SKILL_WAVE_RADIUS);
  238.     write_short(g_Sprite);
  239.     write_byte(0);
  240.     write_byte(0);
  241.     write_byte(10);
  242.     write_byte(25);
  243.     write_byte(0);
  244.     write_byte(skill_wave_color[0]);
  245.     write_byte(skill_wave_color[1]);
  246.     write_byte(skill_wave_color[2]);
  247.     write_byte(200);
  248.     write_byte(0);
  249.     message_end();
  250.    
  251.     while((iVictim = find_ent_in_sphere(iVictim, flOrigin, SKILL_WAVE_RADIUS)) != 0)
  252.     {
  253.         if(is_user_connected(iVictim) && is_user_alive(iVictim) && !ze_is_user_zombie(iVictim))
  254.         {  
  255.             if(!task_exists(iVictim + TASK_FBURN))
  256.             {
  257.                 g_burning_duration[iVictim] += FIRE_DURATION * 5;
  258.                 set_task(0.1, "BurningFlame", iVictim + TASK_FBURN, _, _, "b");
  259.             }
  260.         }
  261.     }
  262. }
  263.  
  264. public BurningFlame(taskid)
  265. {
  266.     static origin[3];
  267.    
  268.     get_user_origin(ID_FBURN, origin);
  269.    
  270.     if (g_fRoundEnd ||  g_burning_duration[ID_FBURN] < 1 || ze_is_user_zombie(ID_FBURN))
  271.     {
  272.         message_begin(MSG_PVS, SVC_TEMPENTITY, origin);
  273.         write_byte(TE_SMOKE);
  274.         write_coord(origin[0]);
  275.         write_coord(origin[1]);
  276.         write_coord(origin[2] - 50);
  277.         write_short(g_smokeSpr);
  278.         write_byte(random_num(15, 20));
  279.         write_byte(random_num(10, 20));
  280.         message_end();
  281.  
  282.         remove_task(taskid);
  283.        
  284.         return;
  285.     }
  286.  
  287.     static health;
  288.     health = pev(ID_FBURN, pev_health);
  289.  
  290.     if(health - FIRE_DAMAGE > 0)
  291.         fm_set_user_health(ID_FBURN, health - FIRE_DAMAGE);
  292.     else if(health - FIRE_DAMAGE <= 0)
  293.         fm_set_user_health(ID_FBURN, 1);
  294.    
  295.     message_begin(MSG_PVS, SVC_TEMPENTITY, origin);
  296.     write_byte(TE_SPRITE);
  297.     write_coord(origin[0] + random_num(-5, 5));
  298.     write_coord(origin[1] + random_num(-5, 5));
  299.     write_coord(origin[2] + random_num(-10, 10));
  300.     write_short(g_flameSpr);
  301.     write_byte(random_num(5, 10));
  302.     write_byte(200);
  303.     message_end();
  304.  
  305.     g_burning_duration[ID_FBURN]--;
  306. }
  307.  
  308. public SmokeExplode(taskid)
  309. {
  310.     new id = ID_SMOKE_EXP
  311.    
  312.     if (!g_smoke[id])
  313.     {
  314.         remove_task(id+TASK_SMOKE_EXP)
  315.         return;
  316.     }
  317.    
  318.     new Float:origin[3]
  319.     origin[0] = g_smoke_origin[id][0]
  320.     origin[1] = g_smoke_origin[id][1]
  321.     origin[2] = g_smoke_origin[id][2]
  322.    
  323.     new flags = pev(id, pev_flags)
  324.     if (!((flags & FL_DUCKING) && (flags & FL_ONGROUND)))
  325.         origin[2] -= 36.0
  326.    
  327.     Create_Smoke_Group(origin)
  328.     set_task(1.0, "SmokeExplode", id+TASK_SMOKE_EXP)
  329.    
  330.     return;
  331. }
  332.  
  333. public RemoveSmoke(taskid)
  334. {
  335.     new id = ID_SMOKE
  336.    
  337.     g_smoke[id] = 0
  338.     g_smoke_wait[id] = 1
  339.    
  340.     set_task(SKILL_SMOKE_COOLDOWN, "RemoveWaitSmoke", id+TASK_WAIT_SMOKE)
  341. }
  342.  
  343. public RemoveWaitSmoke(taskid)
  344. {
  345.     new id = ID_WAIT_SMOKE
  346.    
  347.     g_smoke_wait[id] = 0
  348.    
  349.     set_dhudmessage(0, 255, 0, -1.0, 0.4, 0, 0.0, 1.0, 1.0, 1.0)            
  350.     show_dhudmessage(id, "Способность готова!");
  351. }
  352.  
  353. Create_Smoke_Group(Float:position[3])
  354. {
  355.     new Float:origin[12][3]
  356.     get_spherical_coord(position, 40.0, 0.0, 0.0, origin[0])
  357.     get_spherical_coord(position, 40.0, 90.0, 0.0, origin[1])
  358.     get_spherical_coord(position, 40.0, 180.0, 0.0, origin[2])
  359.     get_spherical_coord(position, 40.0, 270.0, 0.0, origin[3])
  360.     get_spherical_coord(position, 100.0, 0.0, 0.0, origin[4])
  361.     get_spherical_coord(position, 100.0, 45.0, 0.0, origin[5])
  362.     get_spherical_coord(position, 100.0, 90.0, 0.0, origin[6])
  363.     get_spherical_coord(position, 100.0, 135.0, 0.0, origin[7])
  364.     get_spherical_coord(position, 100.0, 180.0, 0.0, origin[8])
  365.     get_spherical_coord(position, 100.0, 225.0, 0.0, origin[9])
  366.     get_spherical_coord(position, 100.0, 270.0, 0.0, origin[10])
  367.     get_spherical_coord(position, 100.0, 315.0, 0.0, origin[11])
  368.    
  369.     for (new i = 0; i < SKILL_SMOKE_SIZE; i++)
  370.         create_Smoke(origin[i], g_Smoke_Skill_Sprite, 100, 0)
  371. }
  372.  
  373. create_Smoke(const Float:position[3], sprite_index, life, framerate)
  374. {
  375.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  376.     write_byte(TE_SMOKE)
  377.     engfunc(EngFunc_WriteCoord, position[0])
  378.     engfunc(EngFunc_WriteCoord, position[1])
  379.     engfunc(EngFunc_WriteCoord, position[2])
  380.     write_short(sprite_index)
  381.     write_byte(life)
  382.     write_byte(framerate)
  383.     message_end()
  384. }
  385.  
  386. get_spherical_coord(const Float:ent_origin[3], Float:redius, Float:level_angle, Float:vertical_angle, Float:origin[3])
  387. {
  388.     new Float:length
  389.     length  = redius * floatcos(vertical_angle, degrees)
  390.     origin[0] = ent_origin[0] + length * floatcos(level_angle, degrees)
  391.     origin[1] = ent_origin[1] + length * floatsin(level_angle, degrees)
  392.     origin[2] = ent_origin[2] + redius * floatsin(vertical_angle, degrees)
  393. }
  394.  
  395. stock Reset(iPlayer)
  396. {
  397.     g_smoke[iPlayer] = 0;
  398.     g_smoke_wait[iPlayer] = 0;
  399.    
  400.     remove_task(iPlayer + TASK_SMOKE);
  401.     remove_task(iPlayer + TASK_WAIT_SMOKE);
  402.     remove_task(iPlayer + TASK_SMOKE_EXP);
  403.     remove_task(iPlayer + TASK_BOT_USE_SKILL);
  404. }
  405.  
  406. stock ChatColor(const id, const input[], any:...)
  407. {
  408.     new count = 1, players[32]
  409.     static msg[191]
  410.     vformat(msg, 190, input, 3)
  411.    
  412.     replace_all(msg, 190, "!g", "^4")
  413.     replace_all(msg, 190, "!y", "^1")
  414.     replace_all(msg, 190, "!r", "^3")
  415.     replace_all(msg, 190, "!b", "^0")
  416.    
  417.     if (id) players[0] = id; else get_players(players, count, "ch")
  418.     {
  419.         for (new i = 0; i < count; i++)
  420.         {
  421.             if (is_user_connected(players[i]))
  422.             {
  423.                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), {0,0,0}, players[i])
  424.                 write_byte(players[i]);
  425.                 write_string(msg);
  426.                 message_end();
  427.             }
  428.         }
  429.     }
  430. }
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest