Created
August 9, 2017 19:54
-
-
Save ikt32/f8e50bda02b1edfbef3f857971e3f8b0 to your computer and use it in GitHub Desktop.
extra natives tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function drawTxt(x,y ,width,height,scale, text) | |
SetTextFont(0) | |
SetTextProportional(0) | |
SetTextScale(scale, scale) | |
SetTextColour(255, 255, 255, 255) | |
SetTextDropShadow(0, 0, 0, 0,255) | |
SetTextEdge(1, 0, 0, 0, 255) | |
SetTextDropShadow() | |
SetTextOutline() | |
SetTextEntry("STRING") | |
AddTextComponentString(text) | |
DrawText(x - width/2, y - height/2 + 0.005) | |
end | |
Citizen.CreateThread(function() | |
while true do | |
Citizen.Wait(0) | |
local veh = GetVehiclePedIsUsing(GetPlayerPed(-1)) | |
if DoesEntityExist(veh) and not IsEntityDead(veh) then | |
currGear = GetVehicleCurrentGear(veh) | |
drawTxt(0.75, 0.050, 0.25, 0.03, 0.40,"currGear: " .. currGear) | |
nextGear = GetVehicleNextGear(veh) | |
drawTxt(0.75, 0.075, 0.25, 0.03, 0.40,"nextGear: " .. nextGear) | |
engTemp = GetVehicleEngineTemperature(veh) | |
drawTxt(0.75, 0.100, 0.25, 0.03, 0.40,"Eng. Temp: " .. engTemp) | |
clutch = GetVehicleClutch(veh) | |
drawTxt(0.75, 0.125, 0.25, 0.03, 0.40,"Clutch: " .. clutch) | |
turbo = GetVehicleTurboPressure(veh) | |
drawTxt(0.75, 0.150, 0.25, 0.03, 0.40,"Turbo: " .. turbo) | |
nWheels = GetVehicleNumberOfWheels(veh) | |
drawTxt(0.75, 0.175, 0.25, 0.03, 0.40,"nWheels: " .. nWheels) | |
ebrk = GetVehicleHandbrake(veh) | |
drawTxt(0.75, 0.200, 0.25, 0.03, 0.40,"ebrk: " .. tostring(ebrk)) | |
blinkL = IsVehicleLeftBlinkerActive(veh) | |
drawTxt(0.75, 0.225, 0.25, 0.03, 0.40,"blinkL: " .. tostring(blinkL)) | |
blinkR = IsVehicleRightBlinkerActive(veh) | |
drawTxt(0.75, 0.250, 0.25, 0.03, 0.40,"blinkR: " .. tostring(blinkR)) | |
dashSpeed = GetVehicleDashboardSpeed(veh) | |
drawTxt(0.75, 0.275, 0.25, 0.03, 0.40,"dashSpeed: " .. tostring(dashSpeed)) | |
for wheelIndex = 0, nWheels-1, 1 do | |
local wheelSpeed = GetVehicleWheelSpeed(veh, wheelIndex) | |
drawTxt(0.75, 0.300 + wheelIndex * 0.025, 0.25, 0.03, 0.40,"wheel" .. tostring(wheelIndex) .. ": " .. tostring(wheelSpeed)) | |
end | |
end | |
end | |
end) | |
Citizen.CreateThread(function() | |
while true do | |
Citizen.Wait(0) | |
local veh = GetVehiclePedIsUsing(GetPlayerPed(-1)) | |
if DoesEntityExist(veh) and not IsEntityDead(veh) then | |
if IsControlPressed(0, 189) then | |
SetVehicleClutch(veh, 0.0) | |
drawTxt(0.5, 0.5, 1.0, 1.0, 1.0, "Clutch") | |
end | |
if IsControlPressed(0, 190) then | |
SetVehicleEngineTemperature(veh, 32.0) | |
drawTxt(0.5, 0.5, 1.0, 1.0, 1.0, "Hot") | |
end | |
end | |
end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment