Alright I need to pick this topic up again since I've got another problem...
When the player dies during the map the gravity is normal again on respawn. I want the gravity to be the same as the one in the last colsphere so I did this:
actioncol10 = createColSphere (-51.339508056641,331.89874267578,204.09896850586, 26 )
function col10i (kaka, matchingDimensions )
if kaka == getLocalPlayer() then
theVehicle = getPedOccupiedVehicle(kaka)
setVehicleGravity(theVehicle,0,0,-1)
x,y,z = getVehicleGravity(theVehicle) -- gets the gravity so I can use it below
end
end
addEventHandler("onClientColShapeHit",actioncol10,col10i)
function backup (dplayer)
if dplayer == getLocalPlayer() then
theVehicle = getPedOccupiedVehicle(dplayer)
setVehicleGravity(theVehicle,x,y,z) -- this is where the gravity of the last colsphere is supposed to go when player spawns
end
end
addEventHandler("onClientPlayerSpawn",getRootElement(),backup)
This just doesn't work...no errors, no anything. Guess it's because of what Aiboforcen meant with updating theVehicle variable...well how could I do that? (without colspheres or markers or anything)