Raised This Month: $ Target: $400
 0% 

check from X to X help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Smokey485
Senior Member
Join Date: Dec 2004
Location: Newt 'Ellin
Old 01-18-2005 , 16:30   check from X to X help
Reply With Quote #1

I read the amxx guide thing and whatever I cant find it.

How do I check a users hp from like... 120 to 160...
cause im unsure if this would work

Code:
hp = get_user_health(id) if(hp > 120)
That would work, but not from 120 to 160, and since I have like checking for 100 & up then wouldnt it cause problems with the plugins messing it up and doing 2 things?
Smokey485 is offline
Send a message via AIM to Smokey485 Send a message via MSN to Smokey485
Ced
Member
Join Date: Oct 2004
Old 01-18-2005 , 16:45  
Reply With Quote #2

Code:
hp = get_user_health(id) if(hp >= 120 &&  hp <= 160){
Ced is offline
Smokey485
Senior Member
Join Date: Dec 2004
Location: Newt 'Ellin
Old 01-18-2005 , 17:12  
Reply With Quote #3

Thanks so much! Well, back to coding this damn 900 lined thing.
Smokey485 is offline
Send a message via AIM to Smokey485 Send a message via MSN to Smokey485
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 01-18-2005 , 20:35  
Reply With Quote #4

Well sorry to be a Troll but one small thing wrong with your plugin , and a optional change. :
Code:
   new hp = get_user_health(id)    if(hp > 119 || hp < 161)    {       // code    }
*EDIT* Fixed , but I'd sugguest using > 119 and < 161 because you wanted the exact number.
Peli is offline
Send a message via MSN to Peli
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-18-2005 , 22:52  
Reply With Quote #5

a) Wow, I didn't know Small had segmented OR statements, if only they had this for PHP.

b) He wants to check if it is more than 120 and smaller than 160. I'm assuming yours would check if it is more than 120 or 160, but I've never used an if like that, so I can't say for sure.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 01-18-2005 , 22:53  
Reply With Quote #6

Avalanche , don't go mad on me , I made a mistake sorry.
Peli is offline
Send a message via MSN to Peli
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 01-19-2005 , 09:16  
Reply With Quote #7

Peli's code would always execute the command, because x > 120 || x < 160 is always true. Or is there a number that is smaller or equal to 120 AND bigger or equal to 160 at the same time?
__________________
hello, i am pm
PM is offline
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 01-19-2005 , 15:00  
Reply With Quote #8

wow.... lets look at operators please .. && are "and" while || are "or"... lol
__________________
Anything that is done can only be done better by urself - since life is a opinion make it the way urs feel its best

~live by it
Da Bishop is offline
Send a message via MSN to Da Bishop
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 01-19-2005 , 15:33  
Reply With Quote #9

&& is Logical AND
|| is Logical OR
& is Bitwise AND
| is Bitwise OR
^ is Bitwise XOR
I don't think there is ^^ ; ^^
Oh yes, ~ is complement.
And ! is Logical NOT
__________________
hello, i am pm
PM is offline
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 01-19-2005 , 15:53  
Reply With Quote #10

Quote:
Originally Posted by PM
&& is Logical AND
|| is Logical OR
& is Bitwise AND
| is Bitwise OR
^ is Bitwise XOR
I don't think there is ^^ ; ^^
Oh yes, ~ is complement.
And ! is Logical NOT
didn't think needed to explain them all.. sense only two are neccessary in his case... but yeah... thats good... plus if they don't know this maybe they should go find a tutorial... BTW pm...

<<
>>

OP

__________________
Anything that is done can only be done better by urself - since life is a opinion make it the way urs feel its best

~live by it
Da Bishop is offline
Send a message via MSN to Da Bishop
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 19:18.


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