Jump to content

Smokahontas

Members
  • Posts

    4
  • Joined

  • Last visited

Smokahontas's Achievements

Vic

Vic (3/54)

1

Reputation

  1. Just type /check function checkVehicleSpeed() local vehicle = getPedOccupiedVehicle(getLocalPlayer()) local accel = getVehicleHandling(vehicle).engineAcceleration local seconds = 100/accel outputChatBox("Your vehicle takes " .. seconds .. " seconds to get from 0 to 100km/h") end addCommandHandler("check", checkVehicleSpeed)
  2. This will make the player fall off vehicle, but u can do whatever you want below the "triggerServerEvent("onPlayerCollideVehicle", root, vehicle)", like make him lose his hp, etc. function checkPlayerCollideVehicle() local vehicle = getPedContactElement(localPlayer) if vehicle and getElementType(vehicle) == "vehicle" then triggerServerEvent("onPlayerCollideVehicle", root, vehicle) jump_backwards() end end addEventHandler("onClientRender", root, checkPlayerCollideVehicle) function jump_backwards() local x, y, z = getElementPosition( getLocalPlayer( ) ) setElementPosition( getLocalPlayer( ), x, y, z + 1 ) setElementPosition( getLocalPlayer( ), x - 2, y, z ) end
  3. local screenWidth, screenHeight = guiGetScreenSize ( ) function getAccelerationTime(vehicle) local acc = 0 local maxVelocity = getVehicleHandling(vehicle).maxVelocity local gearRatio = getVehicleHandling(vehicle).driveType == 'f' and getVehicleHandling(vehicle).engineAcceleration or getVehicleHandling(vehicle).engineAcceleration*getVehicleHandling(vehicle).numberOfGears acc = 100/maxVelocity*gearRatio return acc end function showAccelerationTime() if not isPedInVehicle(localPlayer) then return false end local vehicle = getPedOccupiedVehicle(localPlayer) if not vehicle or getVehicleEngineState(vehicle) == false then return false end local acc = getAccelerationTime(vehicle) dxDrawText(string.format("%0.2f", acc).." sec", 0, 0, screenWidth, screenHeight, tocolor(255, 255, 255), 1, "pricedown", "center", "center") end addEventHandler("onClientRender", root, showAccelerationTime)
×
×
  • Create New...