Raised This Month: $ Target: $400
 0% 

Damage Event with TS


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fred Dawes
Junior Member
Join Date: May 2006
Old 12-31-2006 , 00:05   Damage Event with TS
Reply With Quote #1

I wish to multiply the damage given with Kung Fu by X amount. Here is my code.
Code:
#include <amxmodx> #include <amxmisc> #include <tsfun> #include <engine> #include <fun> #include <tsxaddon> register_event("Damage", "Damage", "b", "2!0") //..... new KungFuMultiplier = 1.4 //..... public Damage() {       new victim = read_data(0) // Victim ID     new damage = read_data(2) // Damage     new weapon, bodypart, attacker = get_user_attacker(victim, weapon, bodypart)     client_print(attacker,print_chat,"Damage Event Recognized")     if (weapon == TSW_KUNG_FU ) {         client_print(attacker,print_chat,"Kung Fu Damage Event Recognized")         // Do extra damage         new newDamage = floatround(damage * (g_fightskills[attacker] / 100) + damage)         if (get_user_health(victim) <= newDamage)         {             set_user_health(victim, 1)             client_print(attacker,print_chat,"Your opponent now has 1 HP!")             client_print(victim,print_chat,"You are at 1 HP!")         }else{             set_user_health(victim,(get_user_health(victim) - newDamage))             client_print(attacker, print_chat,"%i damage done",newDamage)         }     } }

My error: It compiles fine, but it doesn't work. The debug messages don't even show up. Does the Damage event not work with The Specialists?
__________________
SteamID STEAM_0:0458033
Fred Dawes is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-31-2006 , 00:27   Re: Damage Event with TS
Reply With Quote #2

No, TS doesn't use the Damage event. There might be a TSDamage event, if not you'll have to stick with TSHealth.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 12-31-2006 , 04:14   Re: Damage Event with TS
Reply With Quote #3

Code:
register_event("PTakeDam", "PTakeDam_function", "a") register_message(50, "damage_function")

PTakeDam provides the amount of damage dealt.
50 (it has no name) is called directly after PTakeDam, and provides the id's of the victim(2) and killer(3)

I'm still not certain, though, when to use register_event() and when to use register_message()


EDIT: I checked again, and I'd go with TSHealth instead of PTakeDam.

Last edited by stupok; 12-31-2006 at 04:23.
stupok is offline
Minimum
Senior Member
Join Date: Jun 2006
Old 12-31-2006 , 04:46   Re: Damage Event with TS
Reply With Quote #4

I talked with him over XFire. I helped him get it working.

I just had him use client_damage.
Minimum is offline
Send a message via AIM to Minimum Send a message via MSN to Minimum
spider853
Senior Member
Join Date: Jul 2006
Old 12-31-2006 , 09:21   Re: Damage Event with TS
Reply With Quote #5

I Think You Dont Use'it Right...
For Exampler Sombody Make Damage To Other Player
100 HP - 50 HP
DAMAGE=50 HP
IF You Multiply This With 1.5 This Will Be DAMAGE (FROM CS) - Multiply Damge (FROM SCRIPT) 50 - 75 = 1 (SCRIPT<0)

If You Want To Multiply DMG With 1.4 Then You Need To Set KungFuMultiplier = 0.4

Or To Substract 1.... (KungFuMultiplier - 1)
spider853 is offline
Send a message via ICQ to spider853
Old 12-31-2006, 10:15
|POW|Da_ghost
This message has been deleted by |POW|Da_ghost. Reason: i phail
Reply


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


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