Raised This Month: $ Target: $400
 0% 

Damage stacking


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gilmon
Senior Member
Join Date: Feb 2011
Location: China
Old 09-28-2015 , 11:47   Damage stacking
Reply With Quote #1

Hello there i need some help about writing a damage stacking system.

Current goal is everytime player attack a player the damage will be more and more higher, for example first time is 1, 2nd time will be 2, 3rd time will be 3(...), but if target change this will clear to basic damage 1.
The question is how to check target change? and how to count damage stacking? don't know the right way to get damage done and how many time attacker attack the target.

P.S: i know sdktools have a function can get everytime damage done, but don't know how to stacking it.

PHP Code:
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype
{
//...
damage damage;
PrintToChat(client"%.0f"damage);


Last edited by gilmon; 09-28-2015 at 11:47.
gilmon is offline
Send a message via MSN to gilmon
lingzhidiyu
Senior Member
Join Date: Mar 2014
Old 09-28-2015 , 12:03   Re: Damage stacking
Reply With Quote #2

PHP Code:
int target[MAXPLAYERS+1] = {-1, ...};
float targetdamage[MAXPLAYERS+1] = {1.0, ...};

public 
Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype
{
    if (
victim == target[attacker])
    {
        
damage *= targetdamage[attacker];
                
targetdamage[attacker] + 0.1;
    }
    else
    {
        
target[attacker] = victim;
        
targetdamage[attacker] = 1.0;
    }


Last edited by lingzhidiyu; 09-28-2015 at 12:04.
lingzhidiyu is offline
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 09-28-2015 , 22:32   Re: Damage stacking
Reply With Quote #3

Remember to return Plugin_Changed if your modifying damage.
__________________
Chaosxk is offline
lingzhidiyu
Senior Member
Join Date: Mar 2014
Old 09-29-2015 , 06:44   Re: Damage stacking
Reply With Quote #4

Quote:
Originally Posted by Chaosxk View Post
Remember to return Plugin_Changed if your modifying damage.
Sorry, i forgot.
lingzhidiyu is offline
gilmon
Senior Member
Join Date: Feb 2011
Location: China
Old 09-30-2015 , 01:20   Re: Damage stacking
Reply With Quote #5

thanks, will check it later.
gilmon is offline
Send a message via MSN to gilmon
Reply



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 17:56.


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