devildead622 Posted March 18, 2013 Share Posted March 18, 2013 how can I do so that anyone can not pass a given location? for example, do not want anyone approaching this position: 1588.1999511719, -1638.5, 15.10000038147 Link to comment
Castillo Posted March 18, 2013 Share Posted March 18, 2013 You can create a colshape, and when they enter, you can kill them, or teleport them somewhere around. Link to comment
devildead622 Posted March 18, 2013 Author Share Posted March 18, 2013 I would have to use this(https://wiki.multitheftauto.com/wiki/CreateColSphere) correct? can give me a help? I'm all confused looking at WIKI ^^ Link to comment
devildead622 Posted March 18, 2013 Author Share Posted March 18, 2013 function shapeHit ( thePlayer ) setElementPosition ( thePlayer, 1569, -1690, 6 ) end function setZone ( playerSource ) local zone = createColSphere ( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) -- create a col addEventHandler ( "onColShapeHit", zone, shapeHit ) -- add a handler for the onColShapeHit event end addEventHandler ( "onResourceStart", setZone ) I suppose this all wrong ... kk so this is I do? Link to comment
PaiN^ Posted March 18, 2013 Share Posted March 18, 2013 zone = createColSphere ( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) function shapeHit ( ) setElementPosition ( thePlayer, 1569, -1690, 6 ) end addEventHandler ( 'onColShapeHit', zone, shapeHit ) Link to comment
DNL291 Posted March 18, 2013 Share Posted March 18, 2013 local zone = createColSphere( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) function shapeHit(hitPlayer, matchingDimension) if getElementType(hitPlayer) == "player" then setElementPosition( hitPlayer, 1569, -1690, 6 ) end end addEventHandler( 'onColShapeHit', zone, shapeHit ) Link to comment
iPrestege Posted March 18, 2013 Share Posted March 18, 2013 (edited) zone = createColSphere ( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) function shapeHit ( ) setElementPosition ( thePlayer, 1569, -1690, 6 ) end addEventHandler ( 'onColShapeHit', zone, shapeHit ) thePlayer = ?? not defined! You should to check the hitter is player or not! And use "local" . Edited March 18, 2013 by Guest Link to comment
PaiN^ Posted March 18, 2013 Share Posted March 18, 2013 zone = createColSphere ( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) function shapeHit ( ) setElementPosition ( thePlayer, 1569, -1690, 6 ) end addEventHandler ( 'onColShapeHit', zone, shapeHit ) thePlayer = ?? not defined! Sorry, I've done it in a rush, But DNL291 fixed it .. Link to comment
devildead622 Posted March 18, 2013 Author Share Posted March 18, 2013 how can I make an "if" for if the player is in a vehicle? and how can I set this vehicle as "ve" Link to comment
Renkon Posted March 18, 2013 Share Posted March 18, 2013 local v = getPedOccupiedVehicle(pVar) if (v) then -- He is inside a car -- v = the car else -- He is NOT inside a car end Link to comment
devildead622 Posted March 18, 2013 Author Share Posted March 18, 2013 what function to: remove player of vehicle? and teleport the vehicle? Link to comment
iPrestege Posted March 18, 2013 Share Posted March 18, 2013 what function to:remove player of vehicle? and teleport the vehicle? setElementPosition Link to comment
Renkon Posted March 18, 2013 Share Posted March 18, 2013 removePedFromVehicle setElementPosition Link to comment
devildead622 Posted March 18, 2013 Author Share Posted March 18, 2013 local zone = createColSphere( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) function shapeHit(hitPlayer, matchingDimension) if getElementType(hitPlayer) == "player" then local v = getPedOccupiedVehicle(pVar) if (v) then removePedFromVehicle ( hitPlayer ) setElementPosition ( v, 1569, -1690, 6 ) warpPedIntoVehicle ( hitPlayer, v ) else setElementPosition( hitPlayer, 1569, -1690, 6 ) end end end addEventHandler( 'onColShapeHit', zone, shapeHit ) Work? Link to comment
iPrestege Posted March 18, 2013 Share Posted March 18, 2013 local zone = createColSphere( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) function shapeHit(hitPlayer, matchingDimension) if getElementType(hitPlayer) == "player" then local v = getPedOccupiedVehicle(pVar) if (v) then removePedFromVehicle ( hitPlayer ) setElementPosition ( v, 1569, -1690, 6 ) warpPedIntoVehicle ( hitPlayer, v ) else setElementPosition( hitPlayer, 1569, -1690, 6 ) end end end addEventHandler( 'onColShapeHit', zone, shapeHit ) Work? Try this : local zone = createColSphere( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) function shapeHit(hitPlayer, matchingDimension) if getElementType(hitPlayer) == "player" then local v = getPedOccupiedVehicle(hitPlayer) if (v) then removePedFromVehicle ( hitPlayer ) setElementPosition ( v, 1569, -1690, 6 ) warpPedIntoVehicle ( hitPlayer, v ) else setElementPosition( hitPlayer, 1569, -1690, 6 ) end end end addEventHandler( 'onColShapeHit', zone, shapeHit ) Link to comment
devildead622 Posted March 18, 2013 Author Share Posted March 18, 2013 ok! thanks! =D i go try... Link to comment
iPrestege Posted March 18, 2013 Share Posted March 18, 2013 No Problem Am Waiting ( = Take You're Time . 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