Raised This Month: $ Target: $400
 0% 

trigger_hurt heal detection


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 06-09-2009 , 10:55   Re: trigger_hurt heal detection
Reply With Quote #8

Quote:
Originally Posted by kielor View Post
i made the detection of hurt\door, but it doesn't show damage inflicted (
help mee..
What are you using this for?

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define ACCESS_ADMIN ADMIN_LEVEL_A /* hp_indicator */ #define HP_DEFAULT 0 #define HUD_CHANNEL 4 new hp_taken[33] public plugin_init() {     register_plugin("KZ hp detection", "1.46", "p3tsin")     register_event("Damage", "damage_event", "b", "2!0")     register_cvar("amx_hpshow", "1")     register_cvar("amx_hpkick", "%d", HP_DEFAULT) } public damage_event() {     new id = read_data(0)     new health = get_user_health(id)     new dmg = read_data(2)     if(health > 255) {         new hpstring[24], null[1], rest[24]         format(hpstring,23, "%f", float(health) / 256.0)         strtok(hpstring, null,0, rest,23, '.', 1)         if(str_to_num(rest) == 0) set_user_health(id, health-1)     }     new hpkick = get_cvar_num("amx_hpkick")     if(get_cvar_num("amx_hpshow") && hpkick && dmg < 0) {         new hudmsg[256]         health = get_user_health(id)         format(hudmsg,255, "Damage inflicted: %d^nCurrent hp: %d", dmg, health)         set_hudmessage(255, 255, 255, 0.7, 0.8, 0, 0.0, 3.1, 0.1, 0.5, HUD_CHANNEL)         show_hudmessage(id, hudmsg)         hp_taken[id]++         if(hp_taken[id] >= hpkick)             server_cmd("kick #%d ^"Cant u read? Already got %dk hp^"", get_user_userid(id), health / 1000)         else {             if(task_exists(id)) remove_task(id)             set_task(10.0, "clear_hptakes", id)         }     } } public clear_hptakes(id) {     hp_taken[id] = 0     return PLUGIN_HANDLED }

p3tsin used that code in his kz server. It shows the damage inflicted.
__________________
[X]-RayCat is offline
 


Thread Tools
Display Modes

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 23:37.


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