Raised This Month: $ Target: $400
 0% 

Help with scripting. im new...this will be first hero i make


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xdc.MrMarijuana
New Member
Join Date: Sep 2005
Old 09-14-2005 , 02:04   Help with scripting. im new...this will be first hero i make
Reply With Quote #1

hey . friend is helpin me on this but he offline and im stumped!!! now what i need is to get code that will lower the damage after you have been ressurected. ex: you die, get ressurected (chucky power) your damage is lowered by half. im not sure how to make it so it will lower the damage once you have been revived. if you could help me out that would be sweet!!


i was thinking about just copying and pasting script to the hero part and just place it in somewhere but then that wont work since i need to define the variable im editing a chucky.sma btw
__________________
- : Xdc : - Mr.Marijuana
Xdc.MrMarijuana is offline
Send a message via AIM to Xdc.MrMarijuana
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 09-14-2005 , 17:32  
Reply With Quote #2

There is no real way to change the damage ammount. You can only do a hackish way of like say for example adding back hp, problem is if they die you can't add any back.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
Xdc.MrMarijuana
New Member
Join Date: Sep 2005
Old 09-14-2005 , 20:35  
Reply With Quote #3

hmm so there is no way to add a dmg mult in there then. well since ur the famous vittu of all great knowledge of SHM then i cant argue (im not trying to be sarcastic. i've read many things you've posted and DAMN you know your stuff) well if you do come across anything lemme know!
__________________
- : Xdc : - Mr.Marijuana
Xdc.MrMarijuana is offline
Send a message via AIM to Xdc.MrMarijuana
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 09-14-2005 , 21:10  
Reply With Quote #4

well maybe I'm not following...

This is what I thought you meant you wanted to do:
Player gets revived, everytime the revived player causes damage to someone that damage is only half what it should be.

How to do it:
You can do it in a hackish way by getting the damage amount and getting the users health. then adding half the damage caused to the users health... Though it's hackish cause you can't add hp to a dead user nor can you get their health points. Changing the actual damage caused is not really possible. (the other thing too though is if the revived person has some hero that causes extra-damage thru SH, there is no real way to stop it from being caused or get the amount done to be able to add it back).


And I'm not famous or great, I don't even consider myself a scripter. But thanks for the ego boost.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
notorious-sk8er
Senior Member
Join Date: Jun 2005
Old 09-17-2005 , 16:52  
Reply With Quote #5

vittu i think u can do it this way

like
ex.
Code:
example_m4multi -1.0   if ( gHasExamplePower[attacker] && weapon == CSW_M4A1 && is_user_alive(id) ) {         new extraDamage = floatround(damage * get_cvar_float("example_m4mutli") - damage)     if (extraDamage > 0) shExtraDamage( id, attacker, extraDamage, "m4a1", headshot )
or would that work?
(im trying to help)
notorious-sk8er is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 09-17-2005 , 17:11  
Reply With Quote #6

No, that wouldn't do anything
even if you removed "if (extraDamage > 0)" from the code you posted, it wouldnt work.


It would do the same thing I stated anyway, but just using the extradamage function to do it which isn't a good idea (and wouldn't work anyway).
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
notorious-sk8er
Senior Member
Join Date: Jun 2005
Old 09-17-2005 , 17:45  
Reply With Quote #7

o i thought it would
notorious-sk8er is offline
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 14:50.


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