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

Auto heal on round start


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Venomxtinct
Member
Join Date: Nov 2005
Old 04-10-2007 , 16:55   Auto heal on round start
Reply With Quote #1

I have looked endlessly and found nothing but I think there is one out there. I need something that can heal a team x amount on each round. If someone knows the link to this plugin, or can make one, or can tell me how to do it, that would be greatly appreciated.
Venomxtinct is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-10-2007 , 17:17   Re: Auto heal on round start
Reply With Quote #2

What do you mean? Like a player can type /heal and get 50 life or somthing once every round?

Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

new g_roundHeal;

public plugin_init()
{
	register_plugin("Round Heal","1.0","Styles")
	g_roundHeal = register_cvar("mp_roundheal", "50");
	register_event("ResetHUD", "resetHud", "be");
}

public resetHud(id)
{
	new maxPlayers = get_maxplayers();
	for(new i=0; i<maxPlayers; i++ )
	{
		 set_user_health(i, get_pcvar_num(g_roundHeal));
	}
}
When they spawn you can set there life to whatever mp_roundheal you want..
Styles is offline
Send a message via AIM to Styles
Venomxtinct
Member
Join Date: Nov 2005
Old 04-10-2007 , 22:13   Re: Auto heal on round start
Reply With Quote #3

But what if you only want one team to have the health? would it be @CT <amount>?
Venomxtinct is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-10-2007 , 23:25   Re: Auto heal on round start
Reply With Quote #4

no I didn't set it like that. Let me fix that. Ill add a cvar.

Not tested but try this. if mp_teamheal = 1 then CT else T
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

new g_roundHeal;
new g_teamHeal;

public plugin_init()
{
	register_plugin("Round Heal","1.0","Styles")
	g_roundHeal = register_cvar("mp_roundheal", "50");
	g_teamHeal = register_cvar("mp_teamheal", "1"); // One is CT - Two is T
	
	register_event("ResetHUD", "resetHud", "be");
}

public resetHud(id)
{
	new teamChoice = get_pcvar_num(g_teamHeal);
	new maxPlayers = get_maxplayers();
	for(new i=0; i<maxPlayers; i++ )
	{
		if(is_user_alive(i) && is_user_connected(i))
		{
		
			 if(teamChoice == 1) // CT
			 {
				if(cs_get_user_team(i) == CS_TEAM_CT)
					set_user_health(i, get_pcvar_num(g_roundHeal));
			 }
			 else
			 {
				if(cs_get_user_team(i) == CS_TEAM_T)
					set_user_health(i, get_pcvar_num(g_roundHeal));
			 }
		}
	}
	return PLUGIN_HANDLED
}

Last edited by Styles; 04-11-2007 at 18:46.
Styles is offline
Send a message via AIM to Styles
Venomxtinct
Member
Join Date: Nov 2005
Old 04-11-2007 , 15:33   Re: Auto heal on round start
Reply With Quote #5

It doesnt seem to be healing, i set mp_teamheal 1 and mp_roundheal 300 and its not healing the CTs by 300. Does the mp_roundheal have to be 50 because of the code?

Edit:
Its giving me a bunch of errors:
[FUN] Player out of range

Last edited by Venomxtinct; 04-11-2007 at 16:13.
Venomxtinct is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-11-2007 , 18:46   Re: Auto heal on round start
Reply With Quote #6

sorry stupid me updated the thread
Styles is offline
Send a message via AIM to Styles
Venomxtinct
Member
Join Date: Nov 2005
Old 04-11-2007 , 22:20   Re: Auto heal on round start
Reply With Quote #7

Thanks much, it works perfectly. +karma
Venomxtinct is offline
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 20:50.


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