Raised This Month: $12 Target: $400
 3% 

TESS-One


Post New Thread Reply   
 
Thread Tools Display Modes
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 03-10-2009 , 15:24   Re: Hero: TESS-One
Reply With Quote #11

Code:
client_print(id, print_chat, "[SH] TESS-One: Absorbing bullets for %d seconds", g_TessTimer[id])
Hint (since it is sh 1.20 code): sh_chat_message would be good to use for this instead.

Code:
public tess_TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits) {     if ( damagebits & DMG_BULLET && g_HasTessOne[this] && g_IsImmune[this] ) return HAM_SUPERCEDE         return HAM_IGNORED }
In this case I think you should use HAM_HANDLED instead of HAM_SUPERCEDE since you are just blocking the call without the need to return a value.

Last edited by vittu; 03-10-2009 at 16:18.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
Xel0z
Senior Member
Join Date: Apr 2006
Location: Netherlands
Old 03-10-2009 , 15:36   Re: Hero: TESS-One
Reply With Quote #12

Quote:
Originally Posted by vittu View Post
Code:
client_print(id, print_chat, "[SH] TESS-One: Absorbing bullets for %d seconds", g_TessTimer[id])
Hint: sh_chat_message would be good to use for this instead.
Didnt see that superheromod had his own native for this :p
Quote:
Originally Posted by vittu View Post
In this case I think you should use HAM_HANDLED instead of HAM_SUPERCEDE since you are just blocking the call without the need to return a value.
Ill change that in a moment.

EDIT: So this would be the correct usage of sh_chat_message?
PHP Code:
sh_chat_message(idg_HeroID"Absorbing bullets for %d seconds"g_TessTimer[id]) 
__________________
Heroes: TESS-One Working on: Grit (Fixing bugs)

Last edited by Xel0z; 03-10-2009 at 15:40.
Xel0z is offline
Send a message via MSN to Xel0z
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 03-10-2009 , 16:21   Re: Hero: TESS-One
Reply With Quote #13

Quote:
Originally Posted by Xel0z View Post
EDIT: So this would be the correct usage of sh_chat_message?
PHP Code:
sh_chat_message(idg_HeroID"Absorbing bullets for %d seconds"g_TessTimer[id]) 
Yes, that would be correct.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 03-16-2009 , 02:01   Re: Hero: TESS-One
Reply With Quote #14

Why did you do it the wrong after you asked if the example you posted above was correct?


The parameter is a hero id (int) not a hero name (string).
g_HeroName is wrong:
Code:
        sh_chat_message(id, g_HeroName, "Absorbing bullets for %d seconds", g_TessTimer[id])
Correct usage would be as you posted above.

---------------
Also, sorry but I was wrong. HAM_SUPERCEDE is correct for how you used it. I did not realize HAM_HANDLED does not actually block the call, though it would probably be better to SetHamParamFloat(4, 0.0) then return HAM_HANDLED.

Last edited by vittu; 03-16-2009 at 03:46.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
Xel0z
Senior Member
Join Date: Apr 2006
Location: Netherlands
Old 03-16-2009 , 05:47   Re: Hero: TESS-One
Reply With Quote #15

Quote:
Originally Posted by vittu View Post
Why did you do it the wrong after you asked if the example you posted above was correct?
Sry for that, but Im not sure how I could have done that wrong :s. Guess I was thinking of something else while writing. (didnt copy the line from the example.)
__________________
Heroes: TESS-One Working on: Grit (Fixing bugs)
Xel0z is offline
Send a message via MSN to Xel0z
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 09-04-2010 , 13:45   Re: TESS-One
Reply With Quote #16

Does this prevent knifedamage aswell?
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 09-04-2010 , 13:59   Re: TESS-One
Reply With Quote #17

no, he exclude the knife. but you can easyly change it.
Fr33m@n is offline
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 12-18-2010 , 16:35   Re: TESS-One
Reply With Quote #18

If it is easily changed, how would I change it to block only the knife?

PHP Code:
public tess_TakeDamage(thisidinflictoridattackerFloat:damagedamagebits)
{
    if ( 
damagebits DMG_BULLET && g_HasTessOne[this] && g_IsImmune[this] && get_user_weapon(idattacker) != CSW_KNIFE ) {
        
SetHamParamFloat(40.0)
        return 
HAM_SUPERCEDE
    
}
    
    return 
HAM_IGNORED

Would removing the ! in != CSW_KNIFE ) be sufficient? It would make sense, but everything is so damn complicated so I doubt it is that simple.
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 12-18-2010 , 17:07   Re: TESS-One
Reply With Quote #19

Quote:
Originally Posted by Exploited View Post
If it is easily changed, how would I change it to block only the knife?

PHP Code:
public tess_TakeDamage(thisidinflictoridattackerFloat:damagedamagebits)
{
    if ( 
damagebits DMG_BULLET && g_HasTessOne[this] && g_IsImmune[this] && get_user_weapon(idattacker) != CSW_KNIFE ) {
        
SetHamParamFloat(40.0)
        return 
HAM_SUPERCEDE
    
}
    
    return 
HAM_IGNORED

Would removing the ! in != CSW_KNIFE ) be sufficient? It would make sense, but everything is so damn complicated so I doubt it is that simple.

Change to this:
Code:
 && get_user_weapon(idattacker) == CSW_KNIFE
Then remove the bit check, no need.

EDIT: Or actually, if I recall correctly, knife is still DMG_BULLET. Best to keep it to avoid picking up HEs, as well. You could otherwise add an inflictor check.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
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 08:32.


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