2013martin1212 Posted June 26, 2015 Posted June 26, 2015 Hello all i have a question if its posible to make a non colision zone on the map to the player can be spawn there or afk etc ?
Dealman Posted June 26, 2015 Posted June 26, 2015 setElementCollisionsEnabled If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
2013martin1212 Posted June 26, 2015 Author Posted June 26, 2015 function disableVehicleCollisionsNearPlayer(thePlayer, maxDistance) local playerX, playerY, playerZ = getElementPosition(thePlayer) local vehicles = getElementsByType("vehicle") for k,v in ipairs(vehicles) do local vehicleX, vehicleY, vehicleZ = getElementPosition(v) -- get the distance between the player and the vehicle: local distance = getDistanceBetweenPoints3D(vehicleX, vehicleY, vehicleZ, playerX, playerY, playerZ) if (distance <= maxDistance) then -- disable collisions for the vehicle setElementCollisionsEnabled(v, false) end end end And how to make this for a player spawn protect version ?
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