AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Damage help. (https://forums.alliedmods.net/showthread.php?t=183700)

kramesa 04-25-2012 12:34

Damage help.
 
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?

<VeCo> 04-25-2012 13:09

Re: Damage help.
 
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))); 


Exolent[jNr] 04-25-2012 13:43

Re: Damage help.
 
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)));

kramesa 04-25-2012 15:21

Re: Damage help.
 
Quote:

Originally Posted by Exolent[jNr] (Post 1696296)
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.


All times are GMT -4. The time now is 07:42.

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