Jump to content

TheMaysTRo

Members
  • Posts

    60
  • Joined

  • Last visited

Everything posted by TheMaysTRo

  1. whats wrong ? function getElementSpeed(element,unit) if (unit == nil) then unit = 0 end if (isElement(element)) then local x,y,z = getElementVelocity(element) if (unit=="mph" or unit==1 or unit =='1') then return (x^2 + y^2 + z^2) ^ 0.5 * 100 else return (x^2 + y^2 + z^2) ^ 0.5 * 1.8 * 100 end else outputDebugString("Not an element. Can't get speed") return false end end function speed(element, unit, speed) if (unit == nil) then unit = 0 end if (speed == nil) then speed = 0 end speed = tonumber(speed) local acSpeed = getElementSpeed(element, unit) if (acSpeed~=false) then local diff = speed/acSpeed local x,y,z = getElementVelocity(element) setElementVelocity(element,x*diff,y*diff,z*diff) guiProgressBarSetProgress(progressBar,tonumber(guiProgressBarGetProgress(progressBar))+1) outputChatBox ( "Red #FFFFFFWhite", getRootElement(), 255, 0, 0, true ) return true end return false end addEventHandler( "onClientVehicleEnter", getRootElement(), getElementSpeed ) addEventHandler( "onClientVehicleEnter", getRootElement(), speed ) setTimer ( speed, 1000, 100) help please
  2. function move (player, seat, jacked ) local vehicle = getPedOccupiedVehicle( localPlayer ) if vehicle == 531 then if vehicle and getVehicleOccupant( vehicle, 0 ) == localPlayer and getVehicleEngineState( vehicle ) == true and getElementSpeed( vehicle ) > 1 then guiProgressBarSetProgress(progressBar , +1) end end end ) addEventHandler( "onClientVehicleEnter", getRootElement(), move ) this is not working.
  3. This thing is perfect go for it i Can't do it (i tried)
  4. i didn't get any error its on client side .
  5. it worked , but i want to increase the value of progress bar when the car move only
  6. i tried it . my script is farmer job and the progress bar appear when you get in the tractor so its says the "progress bar not found" all what i want to do is that the progress bar increases when the tractor move . (and im not seeing the progress bar increasing in game)
  7. hello. I made a progress bar using guiCreateProgressBar and its 0% my problem is how to make it move ._. Thanks. progressBar = guiCreateProgressBar( 0.75, 0.3, 0.3, 0.01, true, nil )
×
×
  • Create New...