gustavorn Posted May 30, 2013 Share Posted May 30, 2013 Hello, I would be grateful if someone could help me add date and actual year in this script. I am very out of time and can not, lose much time. if someone really help me. I know that is not long for this type of resource. local rootElement = getRootElement() local sw,sh = guiGetScreenSize() local windowW = 280 local windowH = 160 local windowTitle = "" local windowTitleHeight = 40 local windowTitleColor = tocolor(0,0,0,255) local windowTitleBGColor = tocolor(0,0,0,255) local windowBGColor = tocolor(0,0,0,0) local windowX = sw - 350 - windowW local windowY = sh / 1.08 - windowH / 2 local localPlayer = getLocalPlayer ( ) function dx (thePlayer) local ping = getPlayerPing(getLocalPlayer()) local time = getRealTime() local hours = time.hour local minutes = time.minute local seconds = time.second local day = time.monthday local weekday = time.weekday local month = time.month local year = time.year local playerName = getPlayerName ( getLocalPlayer() ) local money = getPlayerMoney(thePlayer) local playerX, playerY, playerZ = getElementPosition( getLocalPlayer()) local playerZoneName = getZoneName( playerX, playerY, playerZ ) local health = getElementHealth(getLocalPlayer()) dxDrawText(""..hours..": "..minutes..": "..seconds.." ",sw/60.203, sh/1.500, sw,sh,tocolor(255,255,255,255),1.5,"default","left","top",false,false,false) dxDrawColorText(""..hours.."#FF00CC: #ffffff"..minutes.."#FF00CC: #ffffff"..seconds.." ",sw/60.200, sh/1.505, sw,sh,tocolor(255,255,255,255),1.5,"default","left","top",false,false,false) local x = windowX local y = windowY + windowTitleHeight local h = windowH - windowTitleHeight dxDrawRectangle(x,y,windowW,h,windowBGColor) local veh = getPedOccupiedVehicle(localPlayer) if veh then local vehicle = getVehicleName(veh,thePlayer) else end end function HandleTheRendering () addEventHandler("onClientRender",rootElement, dx) end addEventHandler("onClientResourceStart",rootElement, HandleTheRendering) Very Thanks, Gustavo. Link to comment
gustavorn Posted May 30, 2013 Author Share Posted May 30, 2013 What line put? desculpe qual linha eu coloco isso, estou sem tempo.? Link to comment
gustavorn Posted May 30, 2013 Author Share Posted May 30, 2013 Ok that did not work; Continues, the team already inserted the syntax where he was and also did the deviation as months and years. Link to comment
gustavorn Posted May 30, 2013 Author Share Posted May 30, 2013 No, stranger. not there is some error. Any suggestions for me of? need much. Link to comment
DNL291 Posted May 30, 2013 Share Posted May 30, 2013 Try this: local rootElement = getRootElement() local sw,sh = guiGetScreenSize() local windowW = 280 local windowH = 160 local windowTitle = "" local windowTitleHeight = 40 local windowTitleColor = tocolor(0,0,0,255) local windowTitleBGColor = tocolor(0,0,0,255) local windowBGColor = tocolor(0,0,0,0) local windowX = sw - 350 - windowW local windowY = sh / 1.08 - windowH / 2 local localPlayer = getLocalPlayer ( ) function dx (thePlayer) local ping = getPlayerPing(getLocalPlayer()) local time = getRealTime() local hours = time.hour local minutes = time.minute local seconds = time.second local day = time.monthday local weekday = time.weekday local month = time.month+1 local year = time.year+1900 local playerName = getPlayerName ( getLocalPlayer() ) local money = getPlayerMoney(thePlayer) local playerX, playerY, playerZ = getElementPosition( getLocalPlayer()) local playerZoneName = getZoneName( playerX, playerY, playerZ ) local health = getElementHealth(getLocalPlayer()) dxDrawText(day.."/ "..month.."/ "..year.." ",sw/60.203, sh/1.500, sw,sh,tocolor(0,0,0,255),1.3,"default","left","top",false,false,false) dxDrawText(day.."#FF00CC/ #ffffff"..month.."#FF00CC/ #ffffff"..year.." ",sw/60.200, sh/1.505, sw,sh,tocolor(255,255,255,255),1.3,"default","left","top",false,false,false,true) dxDrawText(hours..": "..minutes..": "..seconds.." ",sw/60.203, sh/1.600, sw,sh,tocolor(0,0,0,255),1.5,"default","left","top",false,false,false) dxDrawText(hours.."#FF00CC: #ffffff"..minutes.."#FF00CC: #ffffff"..seconds.." ",sw/60.200, sh/1.605, sw,sh,tocolor(255,255,255,255),1.5,"default","left","top",false,false,false,true) local x = windowX local y = windowY + windowTitleHeight local h = windowH - windowTitleHeight dxDrawRectangle(x,y,windowW,h,windowBGColor) local veh = getPedOccupiedVehicle(localPlayer) if veh then local vehicle = getVehicleName(veh,thePlayer) else end end function HandleTheRendering () addEventHandler("onClientRender",rootElement, dx) end addEventHandler("onClientResourceStart",rootElement, HandleTheRendering) Link to comment
gustavorn Posted May 31, 2013 Author Share Posted May 31, 2013 DNL, thank you very much for your help, I really must thank. I think it is no longer needed anything below 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