iam2noob4u Posted January 4, 2008 Share Posted January 4, 2008 Is it possible to get the computer time with LUA (I want to set the time of the game to the real time)? Link to comment
rjcnz333 Posted January 4, 2008 Share Posted January 4, 2008 Use getRealTime function showtime () local time = getRealTime() local hours = time.hour local minutes = time.minute outputChatBox ( "Local Time: "..hours..":"..minutes ) end Link to comment
iam2noob4u Posted January 4, 2008 Author Share Posted January 4, 2008 thanks Another question (sorry): How do you set the plate text of a vehicle? I can find getVehiclePlateText in the function list, but not setVehiclePlateText. (This isn't really important so I won't be posting 100s of topics.) Link to comment
jbeta Posted January 4, 2008 Share Posted January 4, 2008 For now, you can only set it while creating the vehicle, not after it is created, so there is no set function. Link to comment
MitchPS Posted January 5, 2008 Share Posted January 5, 2008 How do I get these Real Time at the place where the ingame time stand? Link to comment
ChrML Posted January 6, 2008 Share Posted January 6, 2008 How do I get these Real Time at the place where the ingame time stand? You mean setting the ingame time to the same time as the real time? Use setTime, see wiki for details. If you want it to run at the same speed like the real time does, you probably need a clientside script that inside the onClientRender event forces the game time to equal the real time. function onRender () local time = getRealTime() local hours = time.hour local minutes = time.minute setTime ( time.hour, time.minute ) end addEventHandler ( "onClientRender", getRootElement (), onRender ) This will set the GTA time to the real time every frame so it can't go any faster. Not sure if it'll create some flickering though on weather or the clock display. Link to comment
rockstarrem Posted January 8, 2008 Share Posted January 8, 2008 ChrML, the sky flickers with that script, objects so as well. There is no lag, the time doesn't flicker, it stays normally (which is very cool), but the sky and objects flicker like crazy. Is there anyway to stop this? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now