.:HyPeX:. Posted May 17, 2015 Share Posted May 17, 2015 Hello everyone, today i decided to give a try to the 1.5 new "Light" functions, and they are somewhat odd. I've found out they affect only the ped? Is this a bug or just how it is going to be? Code used: local light = createLight(1, 0,0,0,12,255,0,255,0,0,2,true) addEventHandler('onClientPreRender',root,function() local veh = getPedOccupiedVehicle(localPlayer) local rad = getElementRadius(veh) setLightRadius(light, rad*2) local x,y,z = getElementPosition(veh) local dist = getElementDistanceFromCentreOfMassToBaseOfModel ( veh ) setElementPosition(light, x,y,z-dist) end) Result: http://i.imgur.com/ovZATfD.jpg EDIT: Tried making it from up... local light = createLight(1, 0,0,0,12,255,0,255,0,0,-2,true) addEventHandler('onClientPreRender',root,function() local veh = getPedOccupiedVehicle(localPlayer) local rad = getElementRadius(veh) setLightRadius(light, rad*2) local x,y,z = getElementPosition(veh) local dist = getElementDistanceFromCentreOfMassToBaseOfModel ( veh ) setElementPosition(light, x,y,z+dist*4) end) Result: http://i.imgur.com/j7uJMI3.jpg EDIT2: Adding more lights to "apply the multiplier to everything" only seems to affect elements, but not the "world" local light = createLight(1, 0,0,0,12,255,0,255,0,0,-2,true) local light2 = createLight(1, 0,0,0,12,255,0,255,0,0,-2,true) local light3 = createLight(1, 0,0,0,12,255,0,255,0,0,-2,true) addEventHandler('onClientPreRender',root,function() local veh = getPedOccupiedVehicle(localPlayer) local rad = getElementRadius(veh) setLightRadius(light, rad*2) local x,y,z = getElementPosition(veh) local dist = getElementDistanceFromCentreOfMassToBaseOfModel ( veh ) setElementPosition(light, x+2,y,z+dist*4) setElementPosition(light2, x+2,y,z+dist*4) setElementPosition(light3, x+2,y,z+dist*4) end) http://i.imgur.com/18MuZWN.jpg created objects are not affected aswell http://i.imgur.com/KGwacTK.jpg Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now