Raised This Month: $ Target: $400
 0% 

Ghost Touch to damage event HELP


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
dstopgunner
Senior Member
Join Date: Oct 2007
Old 05-13-2009 , 07:13   Re: Ghost Touch to damage event HELP
Reply With Quote #8

PHP Code:
#include <amxmodx>
#include <fakemeta_util>
#include <cstrike>
#include <engine>
#include <hamsandwich>
public plugin_init(){
register_plugin("Ghost","1.0","DS_ToP_GunNeR")
register_forward(FM_Touch"fwd_touch")
RegisterHam(Ham_Spawn,"player","spawned")
 
}
new 
bool:ghost[33]
new 
bool:ghost_killing[33]
new 
bool:victim_dying[33]
new 
ghost_pounces[33] = 0
 
public spawned(id)
{
ghost_killing[id] = false
victim_dying
[id] = false
ghost_pounces
[id] = 0
 
set_task
(5.0 "showhealth")
 
if(
ghost[id])
{
fm_strip_user_weapons(id)
fm_give_item(id"weapon_knife")
}
}
 
public 
showhealth(id)
{
if(!
is_user_alive(id))
{
return 
PLUGIN_HANDLED
}
else

set_hudmessage(25525500.010.9006.012.0)
show_hudmessage(id"Health: %i Armor: %i",get_user_health(id), get_user_armor(id))
 
set_task(1.0"showhealth"id)
}
return 
PLUGIN_HANDLED
}
public 
fwd_touch(victimid)
{
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(idEV_INT_gaitsequence1)
entity_set_int(victimEV_INT_gaitsequence98)
 
if(
hp 5)
{
fm_set_user_health(victimhp 5)
fm_set_user_frags(idscore 1)
ghost_pounces[id] ++
new 
Name[32]
get_user_name(victimName31)
client_print(idprint_center"You pounced %s %s times!",Name,ghost_pounces)
}
else if (
hp <)
{
set_msg_block(get_user_msgid("DeathMsg"),BLOCK_ONCE)
message_begin(MSG_ALLget_user_msgid("DeathMsg"), {000}, 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)
}
}

dstopgunner is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode