Hello all!
Im making a ghost plugin. Very basic idea , ghost pounce on humans and kills them =]
1 ghost on t rest ct.
When a ghost touches an enemy he will pounce on them with animation

from model seqences. Then the enemy will -5 health per "pounce" which is continuous like every 3 seconds ( I dont know how to make the 3 seconds delay yet) . The ghost will + frags when it pounce on them.
But from this plugin I tested , it seems that the plugin hasnt even reached to the "public ghost_is_killing(id)" , its not touched it all. No frags are added or anyones dying. Help!! Thanks!!
PHP Code:
new bool:ghost[33]
new bool:ghost_killing[33]
new bool:victim_dying[33]
public fwd_touch(victim, id)
{
if(!ghost[id])
{
return PLUGIN_HANDLED
}
if(ghost[id] && get_user_team(id) != get_user_team(victim) && is_user_alive(id) && is_user_alive(victim) && !victim_dying[victim])
{
ghost_killing[id] = true
victim_dying[victim] = true
set_task(0.1, "ghost_is_killing", id)
}
return PLUGIN_CONTINUE
}
public ghost_is_killing(id)
{
new victim = fake_touch(id , victim)
if(ghost_killing[id] && is_user_alive(id) && is_user_alive(victim))
{
new hp = get_user_health(victim)
new score = get_user_frags(id)
new deaths = cs_get_user_deaths(victim)
entity_set_int(id, EV_INT_gaitsequence, 1)
entity_set_int(victim, EV_INT_gaitsequence, 98)
if(hp > 5)
{
fm_set_user_health(victim, hp - 5)
fm_set_user_frags(id, score + 1)
ghost_pounces[id] ++
new Name[32]
get_user_name(victim, Name, 31)
client_print(id, print_center, "You pounced %s %s times!",Name,ghost_pounces)
}
else if (hp <6 )
{
set_msg_block(get_user_msgid("DeathMsg"),BLOCK_ONCE)
message_begin(MSG_ALL, get_user_msgid("DeathMsg"), {0, 0, 0}, 0)
write_byte(id)
write_byte(victim)
write_byte(0)
write_string("death")
message_end()
fm_set_user_frags(id , score + 3)
cs_set_user_deaths(id , deaths + 1)
ghost_killing[id] = false
victim_dying[victim] = false
ghost_pounces[id] = 0
user_silentkill(victim)
}
}
}