Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Fix for #7951 bug (client)
- -- https://bugs.multitheftauto.com/view.php?id=7951
- addEventHandler("onClientElementStreamIn", root,
- function()
- if getElementType(source) == "vehicle" then
- fixMonster(source)
- end
- end
- )
- function fixMonster(veh)
- if getElementModel(veh) == 557 and getVehicleOccupant(veh) == false then
- local x, y, z = getElementPosition(veh)
- --[[local hit, _, _, _, hitElement, _, _, _, _, lighting = processLineOfSight(x, y, z-1, x, y, z+5, true, true, false)
- if hit and getElementType(hitElement) == "vehicle" then
- outputChatBox("Monster light before fix: " .. tostring(lighting))
- outputChatBox(tostring(getElementModel(hitElement)))
- end
- addEventHandler("onClientRender", root,
- function()
- dxDrawLine3D(x, y, z-1, x, y, z+5, tocolor(0, 255, 0), 2)
- end
- )--]]
- local ped = createPed(0, x, y, z+1)
- setElementAlpha(ped, 0)
- setTimer(
- function()
- destroyElement(ped)
- --[[local hit, _, _, _, hitElement, _, _, _, _, lighting = processLineOfSight(x, y, z-1, x, y, z+5, true, true, false)
- if hit and getElementType(hitElement) == "vehicle" then
- outputChatBox("Monster light after fix: " .. tostring(lighting))
- end]]--
- end, 50, 1)
- end
- end
- addCommandHandler("monster",
- function()
- for k, v in pairs(getElementsByType("vehicle")) do
- fixMonster(v)
- end
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment