Xierra Posted April 28, 2010 Share Posted April 28, 2010 Hi guys! I can create a DX text, but I want to know how to make Real time with DX text, and changes the text everytime regarding to time. You guys have any idea how to make it? Link to comment
dzek (varez) Posted April 28, 2010 Share Posted April 28, 2010 (edited) explain it more? textToShow = "" function showTextDx() dxDrawText(textToShow, 0, 70/100*height, width, 0, tocolor(255, 30, 30, 255), 1.5, "default-bold", "center", "top", false, false, false) end addEventHandler("onClientFrame", getRootElement(), showTextDx) setTimer(function() --textToShow = tostring(math.random(1,666)) time = getRealTime() hours = time.hour minutes = time.minute textToShow = hours..':'..minutes end, 500) something like that? this is completly unuseful, just wanted to show you what i mean edit: edited, maybe you actually meant that (thx JustDance) Edited April 28, 2010 by Guest Link to comment
JustDance Posted April 28, 2010 Share Posted April 28, 2010 time = getRealTime() hours = time.hour minutes = time.minute Link to comment
Xierra Posted April 28, 2010 Author Share Posted April 28, 2010 Good that helps me. Now what about vehicle speed? Link to comment
dzek (varez) Posted April 28, 2010 Share Posted April 28, 2010 duuude! the same way. getting vehicle speed every frame, then displaying it. we wont make everything for you.. you can download "speedx" resource to see how to get veh. speed Link to comment
karlis Posted April 28, 2010 Share Posted April 28, 2010 well, i can try to explain... function getspeed(player,mph) unit = mph and 100 or 160.9 --if mph argument set to true then use mph convertion, else use kph vx,vy,vz = getElementVelocity( getPedOccupiedVehicle( player ) or player ) --not sure, will getting speed of player work? return math.floor( ( vx ^ 2 + vy ^ 2 + vz ^ 2 ) ^ 0.5 * unit + 0.5 ) --it could be shorter without rounding end 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