View Single Post
  #2  
Old 08-30-2011, 04:01 AM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
Quote:
Originally Posted by furry_mougle View Post
i'm writing a renting-system script, however i've come into a problem when comparing rentTime to timevar2. essentially if you do something like this

timevar2 is always incrementing, so there is no real way to compare the var rentTime to timevar because it'll always be greater than 6. (since it always increments). however, if there was a way to freeze the current timevar and THEN compare it to 6 and wait for the incrementing timevar to get over 6, thus leading the rent to expire that would be a much greater solution.

so, is there a way to freeze the current timevar2 or record it somehow?
??

you seem to have answered your own question within the script.

PHP Code:
function onActionRentTime(){
  
this.rent_time timevar 26;
  
setTimer(1);
}

function 
onTimeout(){
  if(
this.rent_time <= timevar2){
    
player.chat "Rent expired!";
  }
  
setTimer(1);

Reply With Quote