TorNix~|nR Posted September 6, 2016 Share Posted September 6, 2016 Hello everyone, I need to make a anti vehicle zone, there is any body can help me please? Link to comment
EstrategiaGTA Posted September 6, 2016 Share Posted September 6, 2016 (edited) You can create a colshape, and use onColShapeHit and destroyElement to destroy the vehicles when they enter the area. Something like this: x, y = 1000, 500 --example; change this to your own. cWidth, cHeight = 30, 20 --width and height for the colshape; change this to your own. myCol = createColRectangle (x, y, cWidth, cHeight) function destroyTheVehicles (player) if getElementType (player) == "player" and isElementInVehicle (player) then destroyElement (getPedOccupiedVehicle (player)) outputChatBox ("Vehicles are not allowed here!", player, 255, 0, 0) end end addEventHandler ("onColShapeHit", myCol, destroyTheVehicles) Edited September 6, 2016 by EstrategiaGTA Link to comment
TAPL Posted September 6, 2016 Share Posted September 6, 2016 isElementInVehicle does not exist, use isPedInVehicle instead. Link to comment
EstrategiaGTA Posted September 6, 2016 Share Posted September 6, 2016 Yes, my bad, thanks @TAPL I'd edit it but I can't Link to comment
Walid Posted September 6, 2016 Share Posted September 6, 2016 I replace it here local myCol = createColRectangle (1000, 500, 30, 20) function destroyTheVehicles (player) if getElementType (player) == "player" and isPedInVehicle (player) then destroyElement (getPedOccupiedVehicle (player)) outputChatBox ("Vehicles are not allowed here!", player, 255, 0, 0) end end addEventHandler ("onColShapeHit", myCol, destroyTheVehicles) 1 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