Quote:
Originally Posted by furry_mougle
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 2+ 6;
setTimer(1);
}
function onTimeout(){
if(this.rent_time <= timevar2){
player.chat = "Rent expired!";
}
setTimer(1);
}