Raised This Month: $32 Target: $400
 8% 

Hero: Head Shooter (Jelle/Timian)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 07-15-2010 , 11:53   Hero: Head Shooter (Jelle/Timian)
Reply With Quote #1

Head Shooter

Description
When you get a headshot it restores your max health

Cvars:
Code:
//Head Shooter
hshooter_level 5 //Level for this hero
Credits:
Timian for coming up with the idea

I put Timian as auther too, as he tried to make this hero, but failed.

Updates:
1.0 Initial release
1.1 Fixed the way it gets the max health.
1.2 Minor optimization used sh_get_max_hp instead of get_user_hp, should work better.
1.3 Used SH_MAXSLOTS in array.
Attached Files
File Type: sma Get Plugin or Get Source (sh_hshooter.sma - 1142 views - 1.0 KB)
__________________
No idea what to write here...

Last edited by Jelle; 08-22-2010 at 10:06.
Jelle is offline
Send a message via MSN to Jelle
D.P!
Junior Member
Join Date: Jul 2010
Old 07-15-2010 , 15:49   Re: Hero: Head Shooter (Jelle/Timian)
Reply With Quote #2

very nice very very very GOOD
D.P! is offline
gevo
Senior Member
Join Date: Jun 2007
Old 08-19-2010 , 21:33   Re: Hero: Head Shooter (Jelle/Timian)
Reply With Quote #3

Well, I tested this hero, and when I got a headshot, instead of giving me my max health/AP(750/500) it just set it to 100hp/0ap.
Anyway to do it so it gives the maximum amount of health you have?
gevo is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 08-19-2010 , 21:39   Re: Hero: Head Shooter (Jelle/Timian)
Reply With Quote #4

PHP Code:
public sh_client_death(victimattackerheadshot)
{
    if ( 
gHasHeadPower[attacker] && headshot == )
    {
        
set_user_health(attackergStartHealth[attacker])
    }

It doesn't do anything at all with the armor, so I don't get how that can be it. That has to be another hero.

However, I think I can come up with a better way to get the clients max HP. I do not know by now when I get the time to update it.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 08-19-2010 , 21:46   Re: Hero: Head Shooter (Jelle/Timian)
Reply With Quote #5

Quote:
Originally Posted by Jelle View Post
However, I think I can come up with a better way to get the clients max HP.
PHP Code:
/**
 * Gets the client's max Health based on heroes client has.
 *
 * @param id        The index of the client.
 * @return        The max hero HP of the client.
 */
native sh_get_max_hp(id); 
__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 08-20-2010 , 08:03   Re: Hero: Head Shooter (Jelle/Timian)
Reply With Quote #6

Yes, I believe I saw that native a few days back. But thank you. I will update when I get the time for it.

EDIT: Updated to 1.2
__________________
No idea what to write here...

Last edited by Jelle; 08-20-2010 at 19:43.
Jelle is offline
Send a message via MSN to Jelle
gevo
Senior Member
Join Date: Jun 2007
Old 08-21-2010 , 22:52   Re: Hero: Head Shooter (Jelle/Timian)
Reply With Quote #7

Thank you, tested and it works.
gevo is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 08-22-2010 , 06:47   Re: Hero: Head Shooter (Jelle/Timian)
Reply With Quote #8

PHP Code:
new gStartHealth[33
-->
PHP Code:
new gStartHealth[SH_MAXSLOTS+1
It's quick optimization you can do in case if player want to change the value of SH_MAXSLOTS correspondin to the number of slot of his server.
Fr33m@n is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 08-22-2010 , 10:05   Re: Hero: Head Shooter (Jelle/Timian)
Reply With Quote #9

Quote:
Originally Posted by Fr33m@n View Post
PHP Code:
new gStartHealth[33
-->
PHP Code:
new gStartHealth[SH_MAXSLOTS+1
It's quick optimization you can do in case if player want to change the value of SH_MAXSLOTS correspondin to the number of slot of his server.
Forgot about that, I'll change it right away, thanks!

Quote:
Originally Posted by gevo View Post
Thank you, tested and it works.
Thanks for the update.
__________________
No idea what to write here...

Last edited by Jelle; 08-22-2010 at 10:07.
Jelle is offline
Send a message via MSN to Jelle
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 19:36.


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