Raised This Month: $ Target: $400
 0% 

[Help] with easy condition


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 05-08-2011 , 00:29   [Help] with easy condition
Reply With Quote #1

Hi, here is cheap_suit regeneration Health function
I add armour. but it has a bug.
when your hp / ap = 200 and enemy hits you. your hp and ap immediately goes to 200. ( should be 10 each 2 secs )


Code:
public Task_HealthRegen(id) 
{  
	if(!is_user_alive(id) || !is_user_connected(id) || !g_HPRegen[id] || !g_HPRegen[id]) 
	{
		if(task_exists(id)) {
			remove_task(id)
		}
		return PLUGIN_CONTINUE
	}
	
	new iHealth = get_user_health(id)
           new iArmor = get_user_armor(id)
	if(iHealth < 200 || iArmor < 200)  // dont know may be && ?
       
	{
		message_begin(MSG_ONE, get_user_msgid("ScreenFade"), { 0, 0, 0 }, id)
		write_short(1<<10) 
		write_short(1<<10)
		write_short(1<<12) 
		write_byte(0) 
		write_byte(0)
		write_byte(255)
		write_byte(50)
		message_end()
		client_cmd(id,"speak shopmenu3/wearoff.wav")
		iHealth += RegenPoints
                       iArmor += RegenPoints
		set_user_health(id, iHealth) 
                set_user_armor(id, iArmor)
// here		if(get_user_health(id) > 200 || get_user_armor(id) > 200) {
		set_user_health(id, 200)
                        set_user_armor(id, 200)
		}           

	}
	return PLUGIN_CONTINUE
}
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
 



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 04:21.


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