Post by Abed on Jan 11, 2017 10:20:05 GMT
First you need the sprites which you will use them
you can download them from here Flames
i will show you how to make it with 2 knifes and you can do it with all knifes
you can download them from here Flames
i will show you how to make it with 2 knifes and you can do it with all knifes
#define ID_FBURN1 (taskid - 100)
#define ID_FBURN2 (taskid - 100)
new g_burning1[33],
g_burning2[33],
g_sprite1,
g_sprite2
public plugin_precache()
{
g_sprite1 = precache_model("sprites/1.spr") // you can change the .spr
g_sprite2 = precache_model("sprites/2.spr") // from the link (up)
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if (weapon == CSW_KNIFE && g_knife1[attacker])
{
if(!task_exists(victim + 100))
{
g_burning1[victim] += 5
set_task(0.1, "Burning1", victim + 100, _, _, "b")
}
}
if (weapon == CSW_KNIFE && g_knife2[attacker])
{
if(!task_exists(victim + 100))
{
g_burning2[victim] += 5
set_task(0.1, "Burning2", victim + 100, _, _, "b")
}
}
}
public Burning1(taskid)
{
static origin[3], flags
get_user_origin(ID_FBURN1, origin)
flags = pev(ID_FBURN1, pev_flags)
if ((flags & FL_INWATER) || g_burning1[ID_FBURN1] < 1 || !is_user_alive(ID_FBURN1))
{
remove_task(taskid)
return
}
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_sprite1)
write_byte(2)
write_byte(200)
message_end()
g_burning1[ID_FBURN1]--
}
public Burning2(taskid)
{
static origin[3], flags
get_user_origin(ID_FBURN2, origin)
flags = pev(ID_FBURN2, pev_flags)
if ((flags & FL_INWATER) || g_burning2[ID_FBURN2] < 1 || !is_user_alive(ID_FBURN2))
{
remove_task(taskid)
return
}
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_sprite2)
write_byte(2)
write_byte(200)
message_end()
g_burning2[ID_FBURN2]--
}