AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Nvm, Solved] Get_user_health (https://forums.alliedmods.net/showthread.php?t=156292)

louistds 05-04-2011 03:43

[Nvm, Solved] Get_user_health
 
Anyone knows how do i check if user health is >2500 but <3500 ?

Edit: Found out how to

PHP Code:

if (get_user_health(id) >2500 && get_user_health(id) <3500


jc980 05-04-2011 03:47

Re: [Questions] Get_user_health
 
i dont get the point.

louistds 05-04-2011 03:51

Re: [Nvm, Solved] Get_user_health
 
Nvm , found out how to.

ConnorMcLeod 05-04-2011 11:26

Re: [Nvm, Solved] Get_user_health
 
It's better to cache get_user_health value so you only call the native once :

Code:
new iHealth = get_user_health(id) if ( iHealth > 2500 && iHealth < 3500 )

Or you can do like this :
Code:
if ( 2500 < get_user_health(id) < 3500 )

JoKeR LauGh 12-21-2011 13:10

Re: [Nvm, Solved] Get_user_health
 
Sorry for reviving but I see the rules say ( I see video about posting ) it says that instead of making a new thread better use the old one . So I have 1 question.

@Connor
can I do like this if I want to detect the player health is above 2000 but below 3000 like this
Code:
if ( 2000 > get_user_health(id) < 3000 )

hleV 12-21-2011 13:28

Re: [Nvm, Solved] Get_user_health
 
Code:
2000 >
->
Code:
2000 <

JoKeR LauGh 12-21-2011 16:32

Re: [Nvm, Solved] Get_user_health
 
the ">" symbol doesn't have any function?

hleV 12-22-2011 08:13

Re: [Nvm, Solved] Get_user_health
 
You want health to be above 2000, so
Code:
2000 < get_user_health(id)
does that.

JoKeR LauGh 12-22-2011 10:29

Re: [Nvm, Solved] Get_user_health
 
If below?

Erox902 12-22-2011 11:57

Re: [Nvm, Solved] Get_user_health
 
@JoKeR
It means:
PHP Code:

if ( 2000 [is less thanget_user_health() ) 



All times are GMT -4. The time now is 04:22.

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