Edikosh998 Posted May 7, 2012 Posted May 7, 2012 So, I decided to make a label with the real time. However, I don't know what's better...with "onClientRender", or with a timer of 60000 ms delay ? WRS( World Racing Server) [server] = 8%
Kenix Posted May 7, 2012 Posted May 7, 2012 Client side local nX, nY = guiGetScreenSize( ) addEventHandler( 'onClientRender', root, function( ) dxDrawText( string.format( '%s %s', getRealTime( ).hour, getRealTime( ).minute ), 0.9 * nX, 0.1 * nY ) end ) ? Updated. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Edikosh998 Posted May 7, 2012 Author Posted May 7, 2012 I know how to make it...What I want to know is which way will be better ( better = optimized) for checking the time. PD : I'm using label. tiempoRealLabel = guiCreateLabel(0.8525,0.0430,0.1152,0.0559,"Tiempo",true) guiSetFont(tiempoRealLabel,arialBoldFont) function enCalcularTiempoPayDay() local tiempoTabla = getRealTime() local minutos = tiempoTabla.minute local horas = tiempoTabla.hour guiSetText(tiempoRealLabel,tostring(horas).." : "..tostring(minutos)) if minutos == 0 then triggerServerEvent("onPayDay",localPlayer,minutos,horas) outputClient("PAY DAY",0,200,50) end end addEventHandler("onClientRender",root,enCalcularTiempoPayDay) WRS( World Racing Server) [server] = 8%
Kenix Posted May 7, 2012 Posted May 7, 2012 Use setTimer http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Edikosh998 Posted May 7, 2012 Author Posted May 7, 2012 Yea, my bad...can't use trigger for a render Event. tiempoRealLabel = guiCreateLabel(0.8525,0.0430,0.1152,0.0559,"Tiempo",true) guiSetFont(tiempoRealLabel,arialBoldFont) setTimer( function() local tiempoTabla = getRealTime() local minutos = tiempoTabla.minute local horas = tiempoTabla.hour guiSetText(tiempoRealLabel,tostring(horas).." : "..tostring(minutos)) if minutos == 0 then triggerServerEvent("onPayDay",localPlayer,minutos,horas) outputClient("PAY DAY",0,200,50) end end ,5000,0) -- How much seconds of delay?, I switch to five but perhaps can be more WRS( World Racing Server) [server] = 8%
abu5lf Posted May 7, 2012 Posted May 7, 2012 https://wiki.multitheftauto.com/wiki/Sta ... Font_Names tiempoRealLabel = guiCreateLabel(0.8525,0.0430,0.1152,0.0559,"Tiempo",true) guiSetFont ( tiempoRealLabel, "default-bold-small" ) setTimer( function( ) local tiempoTabla = getRealTime(getLoclPlayer) local minutos = tiempoTabla.minute local horas = tiempoTabla.hour guiSetText(tiempoRealLabel, tostring(horas).." : "..tostring(minutos)) if minutos == 0 then triggerServerEvent("onPayDay", getLoclPlayer, minutos, horas ) outputClient("PAY DAY", 0, 200, 50 ) end end, 50, 0 ) ╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗ ║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║ ║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║ ║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║ ╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝ «سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك» M7mdAl7arthy : لتواصل سكايب
iFoReX Posted May 8, 2012 Posted May 8, 2012 what is outputClient ? °_° elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Jaysds1 Posted May 8, 2012 Posted May 8, 2012 (edited) https://wiki.multitheftauto.com/wiki/Standard_GUI_Font_Names tiempoRealLabel = guiCreateLabel(0.8525,0.0430,0.1152,0.0559,"Tiempo",true) guiSetFont ( tiempoRealLabel, "default-bold-small" ) setTimer( function( ) local tiempoTabla = getRealTime(getLoclPlayer) local minutos = tiempoTabla.minute local horas = tiempoTabla.hour guiSetText(tiempoRealLabel, tostring(horas).." : "..tostring(minutos)) if minutos == 0 then triggerServerEvent("onPayDay", getLoclPlayer, minutos, horas ) outputClient("PAY DAY", 0, 200, 50 ) end end, 50, 0 ) what is outputClient ? °_° It's outputChatBox("PAY DAY", 0, 200, 50 ) another one local tiempoTabla = getRealTime(localPlayer) Edited May 8, 2012 by Guest My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
abu5lf Posted May 8, 2012 Posted May 8, 2012 https://wiki.multitheftauto.com/wiki/Standard_GUI_Font_Names tiempoRealLabel = guiCreateLabel(0.8525,0.0430,0.1152,0.0559,"Tiempo",true) guiSetFont ( tiempoRealLabel, "default-bold-small" ) setTimer( function( ) local tiempoTabla = getRealTime(getLoclPlayer) local minutos = tiempoTabla.minute local horas = tiempoTabla.hour guiSetText(tiempoRealLabel, tostring(horas).." : "..tostring(minutos)) if minutos == 0 then triggerServerEvent("onPayDay", getLoclPlayer, minutos, horas ) outputClient("PAY DAY", 0, 200, 50 ) end end, 50, 0 ) what is outputClient ? °_° It's outputChatBox("PAY DAY", 0, 200, 50 ) I do not know But I agree with you that this error ╔═╦╦╦╗╔╦═╦═╦═╦═╦╦╦╦╦╦╦═╦╦╦╦╗ ║║║║║╠╝║║╚╣║║║║║║║║║║║║║║║║║ ║║║║║╚╦╦═╦╦╦╦╣║║║║║║║║║║║║║║ ║║║║╠═╣╠╝╔══╝║║║║║╟╢║║║║║╟╢║ ╚╩══╩══╩═╩═══╩╩══╩╩═╩╩╩═╩╩═╝ «سبحانك اللهم وبحمدك أشهد أن لا إله إلا أنت أستغفرك وأتوب إليك» M7mdAl7arthy : لتواصل سكايب
Jaysds1 Posted May 8, 2012 Posted May 8, 2012 ok, try this: tiempoRealLabel = guiCreateLabel(0.8525,0.0430,0.1152,0.0559,"Tiempo",true) guiSetFont(tiempoRealLabel,arialBoldFont) setTimer(function() local tiempoTabla = getRealTime() local minutos = tiempoTabla.minute local horas = tiempoTabla.hour guiSetText(tiempoRealLabel,tostring(horas).." : "..tostring(minutos)) if minutos == 00 then triggerServerEvent("onPayDay",localPlayer,minutos,horas) outputChatBox("PAY DAY",0,200,50) end end,5000,0) -- How much seconds of delay?, I switch to five but perhaps can be more My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Edikosh998 Posted May 8, 2012 Author Posted May 8, 2012 a) Is a exported Font.. ARIALBOLD.TFF b) outputClient is the GUI Messages's resource... Is working good, I was just asking if there is better to put the timer with less or more delay... viewtopic.php?f=108&t=42340 WRS( World Racing Server) [server] = 8%
Jaysds1 Posted May 8, 2012 Posted May 8, 2012 oh, ok, Since you have trigger server event then you have to use setTimer. My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Edikosh998 Posted May 8, 2012 Author Posted May 8, 2012 oh, ok,Since you have trigger server event then you have to use setTimer. Yea, i've realised of that...Is like triggering an event 100 times WRS( World Racing Server) [server] = 8%
Jaysds1 Posted May 8, 2012 Posted May 8, 2012 true, so, you've got your question solved am I right? My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Edikosh998 Posted May 8, 2012 Author Posted May 8, 2012 Problem Solved WRS( World Racing Server) [server] = 8%
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