Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local carAlpha = 1
- local alphaMultiplikator = 3.55
- addEventHandler("onClientRender", root, function()
- if(carAlpha == 0) then return end
- local myVeh = getPedOccupiedVehicle(me)
- if not(myVeh) then return end
- local mx, my, mz = getElementPosition(myVeh)
- for i,fahrzeug in ipairs (getElementsByType("vehicle")) do
- local f1, f2, f3 = getElementPosition(fahrzeug)
- local distanz = getDistanceBetweenPoints3D (mx, my, mz, f1, f2, f3 )
- if (distanz < 50) then
- setElementAlpha(fahrzeug, distanz*alphaMultiplikator+20)
- else
- setElementAlpha(fahrzeug, 255)
- end
- if(fahrzeug == getPedOccupiedVehicle(me)) then
- setElementAlpha(fahrzeug, 255)
- end
- end
- end)
- bindKey("F6", "down", function()
- if(carAlpha == 1) then
- carAlpha = 0
- outputChatBox("#FFFFFF|INFO| #00FF00Car-Alpha wurde ausgeschaltet.", 255, 255, 255, true)
- for i,fahrzeug in ipairs (getElementsByType("vehicle")) do
- setElementAlpha(fahrzeug, 255)
- end
- else
- carAlpha = 1
- outputChatBox("#FFFFFF|INFO| #00FF00Car-Alpha wurde angeschaltet.", 255, 255, 255, true)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment