Jump to content

Locked time


Feche1320

Recommended Posts

gMe = getLocalPlayer() 
  
function stoptime () 
  
setTimer (Timer, 2000, 0) 
  
     
    setTime (12, 15) 
    setWeather (17) 
end 
  
function Timer() 
    setTime (12, 15) 
    setWeather (17) 
end 
  
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), stoptime ) 

Link to comment

client code:

  
local __TimeLock 
function setTimeLocked(bool, hour, minute) 
    if bool then 
       hour = tonumber(hour) 
       if (not hour) or hour<0 or hour>23 then 
           hour = getTime() 
       end 
       if (not tonumber(minute)) or minute<0 or minute>59 then 
           _, minute = getTime() 
       end 
       __TimeLock = setTimer(setTime, 100, 0, hour, minute) 
    else 
        if isTimer(__TimeLock) then killTimer(__TimeLock) end 
    end 
end 

untested

setTimeLocked(true) locks time with current time

setTimeLocked(true, 12, 0) locks time at 12 oclock

setTimeLocked(false) unlocks time

Link to comment
without a timer ?
  
addEventHandler("onClientRender",root,function() 
setTime(12,00) 
end ) 
  

its funny how someone who is a complete n00b has a signature proving another person to be a noob.

What you just gave him was a waste of processing AND a waste of perfectly good utility code.

Edit: Or:

setMinuteDuration(133333333333333333333337) 

Link to comment
without a timer ?
  
addEventHandler("onClientRender",root,function() 
setTime(12,00) 
end ) 
  

its funny how someone who is a complete n00b has a signature proving another person to be a noob.

What you just gave him was a waste of processing AND a waste of perfectly good utility code.

Edit: Or:

setMinuteDuration(133333333333333333333337) 

he said that he don't want to use a timer , so i gave him that ! , and don't say noob to someone you don't really know :roll:

Link to comment
he said that he don't want to use a timer , so i gave him that ! , and don't say noob to someone you don't really know :roll:

nah al3grab,you are still a noob

then what are you ? :P

An awesome scripter who has gone through many situations within Multi Theft Auto since 2010 winter, who is also a veteran on this forum and infamous.

Problem?

Link to comment
No, you are a script thief who is on the run from his bad history.

But al3grab is still a noob.

Also - best solution is to set the time to the same time every render.

a) cant complain, but i 'was' once, not anymore (lets not talk about that shit in this topic now)

b) if you set it every render is that kind of redundant, the time doesnt change every frame

Link to comment

Are you sure you don't want to talk about it? I'm sure nothing BAD would come up, I mean it's not like you stole from 2 major servers on MTA, got called out for it, and changed your name to avoid the consequences. That would be PREPOSTEROUS.

Setting the time every render is the easy solution - it's guaranteed to be accurate (because nobody can setMinuteDuration low enough, while with a timer they could) and there won't be much overhead (while with a high-frequency timer, there would be).

Link to comment

then what are you ? :P

An awesome scripter who has gone through many situations within Multi Theft Auto since 2010 winter, who is also a veteran on this forum and infamous.

Problem?

it looks that you are a thief :lol:

No, you are a script thief who is on the run from his bad history.

But al3grab is still a noob.

Also - best solution is to set the time to the same time every render.

and why i am a noob :|

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...