Raised This Month: $ Target: $400
 0% 

code to block round hp.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 12-19-2013 , 10:42   code to block round hp.
Reply With Quote #1

This is the code to do it. the zp 4.3 got bugs. that will make so human "by accident", have 4000 hp, or 350. 650. random. and last human hp will save in the next round. (BAD!)

This is the way i want it.

humans always start round with 250 hp. and last human have 1000 hp. the hp will be 250 in the next round and so on.

and if used an anit-dote. it will be 250 hp. This is the only code i got. thats not working well.

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

#define PLUGIN "No Round Start Heal"
#define VERSION "1.0"
#define AUTHOR "Sho0ter"

new health[33]

public plugin_init()
{
    	register_plugin(PLUGIN, VERSION, AUTHOR)
    	RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
    	register_logevent("round_end", 2, "1=Round_End")
    	register_event("TextMsg", "round_restart", "a", "2&#Game_C", "2&#Game_w")
    	return PLUGIN_CONTINUE
}

public client_putinserver(id)
{
    	health[id] = 250
    	return PLUGIN_CONTINUE
}

public fw_PlayerSpawn_Post(id)
{
    	if(!is_user_connected(id) || !is_user_alive(id) || health[id] <= 250)
    	{
        	return PLUGIN_CONTINUE
    	}
    	set_user_health(id, health[id])
    	health[id] = 250
    	return PLUGIN_CONTINUE
}

public round_end()
{
	for(new id; id <= get_maxplayers(); id++)
    	{
        	if(!is_user_connected(id) || !is_user_alive(id) || get_user_team(id) != 2)
        	{
            		continue
        	}
        	health[id] = get_user_health(id)
    	}
    	return PLUGIN_CONTINUE
}

public round_restart()
{
    	for(new id; id <= get_maxplayers(); id++)
    	{
        	health[id] = 250
    	}
    	return PLUGIN_CONTINUE
}
is it something wrong with it?.
__________________
Contact: Steam
Videos: Youtube
SkumTomteN is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 12-19-2013 , 11:31   Re: code to block round hp.
Reply With Quote #2

PHP Code:
public plugin_init()
{
        
register_plugin(PLUGINVERSIONAUTHOR)
        
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
}

public 
fw_PlayerSpawn_Post(id)
{
        if(!
is_user_connected(id) || !is_user_alive(id))
        {
            return;
        }

        
set_user_health(id250)

Give you 250 hp everytime you spawn
__________________
What are you looking for here?
DavidJr is offline
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 12-20-2013 , 19:58   Re: code to block round hp.
Reply With Quote #3

Quote:
Originally Posted by DavidJr View Post
PHP Code:
public plugin_init()
{
        
register_plugin(PLUGINVERSIONAUTHOR)
        
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
}

public 
fw_PlayerSpawn_Post(id)
{
        if(!
is_user_connected(id) || !is_user_alive(id))
        {
            return;
        }

        
set_user_health(id250)

Give you 250 hp everytime you spawn
Worked perfectly, Thank you so much
__________________
Contact: Steam
Videos: Youtube
SkumTomteN is offline
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 01-26-2014 , 11:42   Re: code to block round hp.
Reply With Quote #4

Quote:
Originally Posted by DavidJr View Post
PHP Code:
public plugin_init()
{
        
register_plugin(PLUGINVERSIONAUTHOR)
        
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
}

public 
fw_PlayerSpawn_Post(id)
{
        if(!
is_user_connected(id) || !is_user_alive(id))
        {
            return;
        }

        
set_user_health(id250)

Give you 250 hp everytime you spawn
2 weeks have past i guess,

This gives zombies 250 hp too...
__________________
Contact: Steam
Videos: Youtube
SkumTomteN is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 01-26-2014 , 12:31   Re: code to block round hp.
Reply With Quote #5

try this:
PHP Code:
public fw_PlayerSpawn_Post(id

        if(!
is_user_connected(id) || !is_user_alive(id)) 
        { 
            return; 
        } 
        if (!
zp_get_user_zombie(id))
        {
        
set_user_health(id250)
        }        

__________________
JusTGo is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-27-2014 , 02:24   Re: code to block round hp.
Reply With Quote #6

Can be simply like this:

PHP Code:
public fw_PlayerSpawn_Post(id)  
{  
        if(!
is_user_connected(id) || !is_user_alive(id) || zp_get_user_zombie(id))  
        {  
            return;  
        }  

        
set_user_health(id250

__________________
What are you looking for here?

Last edited by DavidJr; 01-27-2014 at 02:25.
DavidJr is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 01-27-2014 , 02:48   Re: code to block round hp.
Reply With Quote #7

There is no need to check if the user is connected when you check if he is alive.
__________________
Kia is offline
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 01-31-2014 , 21:02   Re: code to block round hp.
Reply With Quote #8

Quote:
Originally Posted by Kia View Post
There is no need to check if the user is connected when you check if he is alive.
Lol, kia?, do u have servers in cz?
__________________
Contact: Steam
Videos: Youtube
SkumTomteN is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 02-01-2014 , 01:50   Re: code to block round hp.
Reply With Quote #9

Quote:
Originally Posted by SkumTomteN View Post
Lol, kia?, do u have servers in cz?
Nein.
__________________
Kia is offline
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 02-01-2014 , 03:23   Re: code to block round hp.
Reply With Quote #10

Quote:
Originally Posted by Kia View Post
Nein.
Oh, was a dude named kia that copied my clans name and put servers up and stuff-.-
__________________
Contact: Steam
Videos: Youtube
SkumTomteN 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 20:39.


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