Thread: MouseDown NPC
View Single Post
  #7  
Old 08-30-2011, 11:30 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Emera View Post
Just so I can understand this and use it myself in future...
PHP Code:
if (mousex in |this.x+.5,this.x+2.5| && mousey in |this.y,this.y+3|) { 
This is detecting if the mouse in inside the specified coordinates yes?
Yes, it is.

|start, end| defines a range between the two given values.

So,

PHP Code:
function onCreated() {
  
temp.test 3;
  if (
temp.test in |1,5|) {
    
printf("%i is in the range"temp.test);
  }

Since 3 is between 1 and 5, the condition statement will evaluate to true.
Reply With Quote