Monthly Target: $400 Donations: $
 0% 

Hero: Ally Push


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 11-28-2010 , 14:19   Hero: Ally Push
Reply With Quote #1

Ally Push

Description
If you die your teammates will get more HP

shconfig.cfg CVARS
Code:
//Ally Push
ally_level 5     //Level needed for this hero
ally_hptoadd 500     //HP to add to allies when player with this hero dies
Code:
/* Changelog:
* v1.4 - Jelle - 15/7/12
*      - Used another native to add the HP
* v1.3 - Jelle - 18/1/11
*      - Fixed some player index error
* v1.2 - Jelle - 11/30/10
*      - Fixed an error if you put SH_MAXSLOTS to anything but 32
*      - Minor optimization
* v1.1 - Jelle - 11/29/10
*      - Fixed a few errors thanks to fr33m@n!
* v1.0 - Jelle - 11/28/10
*      - Initial release
*/


**SuperHero Mod 1.2.0 & up ONLY**


Credits:
A warcraft 3 custom map called Tech Wars tournament where I get the idea from.
Attached Files
File Type: sma Get Plugin or Get Source (sh_allypush.sma - 141 views - 1.0 KB)
__________________
No idea what to write here...

Last edited by Jelle; 07-14-2012 at 20:41.
Jelle is offline
Send a message via MSN to Jelle
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 11-29-2010 , 10:45   Re: Hero: Ally Push
Reply With Quote #2

the description doesn't correspond to that the hero do.

first the effect only happen if the victim is on ct team, and if the effect happen not teamate but both team will win hp.
Fr33m@n is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 11-30-2010 , 14:37   Re: Hero: Ally Push
Reply With Quote #3

I just thought of something. Maybe it would be an idea to post that it has been updated.

So...

It is now updated!!!!
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 11-30-2010 , 15:37   Re: Hero: Ally Push
Reply With Quote #4

cache the get_pcvar_num before the loop.
don't use SH_MAXSLOTS for players array.
explanation here : http://fs.alliedmods.net/index.php?d...2007&project=7
Fr33m@n is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 11-30-2010 , 15:50   Re: Hero: Ally Push
Reply With Quote #5

Quote:
Originally Posted by Fr33m@n View Post
cache the get_pcvar_num before the loop.
Why? It has an if condition, so it only gets the pcvar num if it actually needs it.

Quote:
Originally Posted by Fr33m@n View Post
don't use SH_MAXSLOTS for players array.
explanation here : http://fs.alliedmods.net/index.php?d...2007&project=7
Crap, forgot about that. Will change it when I get home from school!
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-30-2010 , 16:25   Re: Hero: Ally Push
Reply With Quote #6

Quote:
Originally Posted by Jelle View Post
Why? It has an if condition, so it only gets the pcvar num if it actually needs it.
Fr33m@n is right, caching it will call get_pcvar_num once versus calling it for each teammate.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 11-30-2010 , 17:27   Re: Hero: Ally Push
Reply With Quote #7

New version uploaded.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Vantri
Junior Member
Join Date: Jul 2010
Old 01-17-2011 , 13:04   Re: Hero: Ally Push
Reply With Quote #8

Quote:
L 01/17/2011 - 18:29:56: [CSTRIKE] Player out of range (0)
L 01/17/2011 - 18:29:56: [AMXX] Displaying debug trace (plugin "sh_allypush.amxx")
L 01/17/2011 - 18:29:56: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 01/17/2011 - 18:29:56: [AMXX] [0] sh_allypush.sma::sh_client_death (line 42)
How to fix?
Vantri is offline
Send a message via Skype™ to Vantri
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 01-17-2011 , 17:23   Re: Hero: Ally Push
Reply With Quote #9

Jelle correct this dammit...

PHP Code:
players[i] = player 
player will always be 0...
and you zeroed identification numbers of players you just getting.

PHP Code:
player players[i

Last edited by Fr33m@n; 01-17-2011 at 17:28.
Fr33m@n is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 01-17-2011 , 19:24   Re: Hero: Ally Push
Reply With Quote #10

Oh damn. Well, fixed.
__________________
No idea what to write here...
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 05:22.


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