Raised This Month: $ Target: $400
 0% 

DeathMsg and damage problems


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-07-2007 , 15:39   Re: DeathMsg and damage problems
Reply With Quote #2

Both of the events should work. Maybe this is why:

Code:
public event_Damage(victim) { new victim get_user_attacker(victim) new damage = read_data(2) new Float:extra_damage = damage / 100 * get_cvar_num("hidden_damage") if(is_hidden[victim]) {     fm_fakedamage(victim, "", extra_damage, DMG_ACID) }

1. Don't declare a new "victim" variable, it already exists (it's passed in the function header).
2. Why do you call get_user_attacker, if you don't use it?
3. Since extra_damage is a float, all variables involved in its calculations need to be a float. So it would become:

Code:
new Float:extra_damage = float(damage) / 100.0 * get_cvar_float("hidden_damage")

As for DeathMsg, it needs to be registered with the "a" flag instead of the "b" flag.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 00:42.


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