Raised This Month: $ Target: $400
 0% 

Damage help.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 04-25-2012 , 12:34   Damage help.
Reply With Quote #1

Hi! I have this script:

Code:
public FwdPlayerDamagePost(victim, inflictor, attacker, Float:damage, damageBits) {     if(1 <= attacker <= MaxPlayers && victim != attacker) {         PlayerData[attacker][_Data_TotalDamage] += floatround(entity_get_float(victim, EV_FL_dmg_take));     } }

But, how I can set to 100 if damage is more to 100?
__________________
kramesa is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 04-25-2012 , 13:09   Re: Damage help.
Reply With Quote #2

If you want to limit FL_dmg_take, this is the codе:

PHP Code:
PlayerData[attacker][_Data_TotalDamage] += floatround(min(100.0,entity_get_float(victimEV_FL_dmg_take))); 
__________________
<VeCo> is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-25-2012 , 13:43   Re: Damage help.
Reply With Quote #3

That will give a tag mismatch.

Should either do:
Code:
min(100, floatround(entity_get_float(victim, EV_FL_dmg_take)));
or
Code:
floatround(floatmin(100.0, entity_get_float(victim, EV_FL_dmg_take)));
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 04-25-2012 , 15:21   Re: Damage help.
Reply With Quote #4

Quote:
Originally Posted by Exolent[jNr] View Post
That will give a tag mismatch.

Should either do:
Code:
min(100, floatround(entity_get_float(victim, EV_FL_dmg_take)));
or
Code:
floatround(floatmin(100.0, entity_get_float(victim, EV_FL_dmg_take)));
I will try. Thanks for all.
__________________
kramesa is offline
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 07:42.


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