Jump to content

if statement help.


seany123

Recommended Posts

okay so basically what i need to do is have a if statement, but the twist is that the value of House_id could be 0 or anything from 1 to 16... this is basically what im wanting but obviously this code wont work.

 

if ($player->house_id == 2 || $player->house_id == 3 || $player->house_id == 4) {

}

 

But also it would go up to 16 instead of 4.

 

can anyone help me do this?

 

(for example: it cant use >9. because it would miss out 7,6,5,4,3,2,1.

 

anyone understand what i mean?

Link to comment
Share on other sites

if($player->house_id > 0 && $player->house_id < 17) //will return true for 1-16

 

 

but what if i didnt want for example 12 to return true?

 

Well your OP said anything from 0-16, so which is it? 0-16 or 0-16 except some random number like 12?

 

0-16 except one random number.

 

 

I tried this :

 

if($player->house_id != 0 && $player->house_id != 1) {

header("location: estateagent.php");

    }

 

but got a unexpected T_VARIABLE error

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.