Raised This Month: $ Target: $400
 0% 

Health problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FoX Rider
Member
Join Date: Feb 2005
Location: AK
Old 03-09-2005 , 20:22   Health problem
Reply With Quote #1

How would I make set_user_health, be anything above 0 and less that 101
__________________
Ride for fox..Die for fox.
FoX Rider is offline
Sp4rt4n
Senior Member
Join Date: Dec 2004
Old 03-09-2005 , 20:27  
Reply With Quote #2

This might work, but im a noob scripter and you might wanna wait for another answer...

Code:
if (( set_user_health < 0) || (set_user_health > 101)) {     return PLUGIN_HANDLED }
Sp4rt4n is offline
Send a message via MSN to Sp4rt4n
KCE
Senior Member
Join Date: Jan 2005
Location: Los Angeles, CA
Old 03-09-2005 , 20:29   Re: Health problem
Reply With Quote #3

Quote:
Originally Posted by FoX Rider
How would I make set_user_health, be anything above 0 and less that 101
Do something like this:
Code:
//i is the health to set it to if ( (i > 0) && (i < 101) ) { //check if i is between 0 and 101 set_user_health(id,i) //set user health to i value }
KCE is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 03-10-2005 , 09:43  
Reply With Quote #4

From core.inc:
Code:
native clamp(value, min=cellmin, max=cellmax);

Example:
Code:
new TempHealth = 123 set_user_health( id, clamp(TempHealth, 1, 100) )

That would set the users HP to 100...
xeroblood is offline
Send a message via MSN to xeroblood
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 14:07.


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