Jump to content

mariogallardo

Members
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

mariogallardo's Achievements

Vic

Vic (3/54)

0

Reputation

  1. Well, if the script displays (or reach I don't know how to say that in english, sorry) 1:09-1:01 then it's shows 1:9,1:8,1:7,1:6,1:5,1:4,1:3,1:2,1:1 instead of 1:09, 1:08, 1:07 etc... until 1:00 the same as 0:09, 0:08 shows 0:9, 0:8 instead of 0:09, 0:08 until 0:00
  2. I'm trying to convert ms (2 minutes) to minutes and seconds in this format: 2:00 local timer = 120000 local minutes = 2 local seconds = 0 local milliseconds = 0 function convertTime ( ms ) if ( ms and type ( ms ) == "number" ) then local milliseconds = math.floor((ms % 1000) / 100) local seconds = math.floor((ms / 1000) % 60) local minutes = math.floor((ms / (1000 * 60)) % 60) return minutes, seconds, milliseconds end end setTimer ( function ( ) timer = timer - 10 minutes, seconds, milliseconds = convertTime(timer) end ,1000, 1 ) --- added a timer which deduct 1 ms from the 2 minutes timer every seconds If I add milliseconds to the dxDrawText then it's display in this format: 1:599, 1:598, 1:597, 1:596 etc... dxDrawText(minutes..":"..seconds..milliseconds, screenW * 0.8443, screenH * 0.9148, screenW * 0.9740, screenH * 0.9769, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) But if I skip the milliseconds variable then it just display one zero at the start (2:0) and if reaches 1:0 I want to display in this format: 2:00, 1:00 dxDrawText(minutes..":"..seconds, screenW * 0.8443, screenH * 0.9148, screenW * 0.9740, screenH * 0.9769, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false)
  3. Thank you, yes this is working but it's have a little problem, I need to press the u,z buttons 12 times until the spoiler is opens up fully / close fully. I think I need to put a timer somewhere?!
  4. What? This is moves the spoiler on all vehicles... not just the one which I sit in
  5. The spoiler is moving perfectly but just for me because this is client-sided. How can I make to server-side so everyone see when the spoiler moves? function spoiler() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then local sX, sY, sZ = getVehicleComponentPosition(vehicle, "movspoiler_23.5_1800") if spoiler == 1 then if sZ < 1.2 then setVehicleComponentPosition(vehicle, "movspoiler_23.5_1800", sX, sY-0.006, sZ+0.005) end elseif spoiler == 0 then if sZ > 1 then setVehicleComponentPosition(vehicle, "movspoiler_23.5_1800", sX, sY+0.012, sZ-0.01) end end end end addEventHandler("onClientRender", root, spoiler) I know I need to trigger server event, but the setVehicleComponentPosition & getVehicleComponentPosition is client-side functions only.
×
×
  • Create New...