kevincouto6 Posted May 17, 2018 Posted May 17, 2018 Help me --Event local Area = createColRectangle ( 95, 1700, 325, 450 ) outputChatBox( "Enabled Event", getRootElement(), 255, 255, 0) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Lead Administrator" ) ) then end addCommandHandler ( "setEventArea", setArea ) function create_vehicle ( player ) if isElementWithinColShape ( player, Area ) then if isElement( getElementData ( player, "tank" ) ) then destroyElement ( getElementData ( player, "tank" ) ) end local x, y, z = getElementPosition ( player ) local tank = createVehicle ( 432, x, y, z + 10 ) warpPedIntoVehicle ( player, tank ) setElementData ( player, "tank", tank ) end end addCommandHandler ( "tank", create_vehicle ) addEventHandler("onVehicleExit", root, function() local destroyTimer = setTimer( function( tank ) if isElement( tank ) then destroyElement( tank ) end end, 5000, 1, source) setElementData(source, "destroyTimer", destroyTimer) end) --hydras-- function create_vehicle ( player ) if isElementWithinColShape ( player, Area ) then if isElement( getElementData ( player, "hydras" ) ) then destroyElement ( getElementData ( player, "hydras" ) ) end local x, y, z = getElementPosition ( player ) local hydras = createVehicle ( 520, x, y, z + 10 ) warpPedIntoVehicle ( player, hydras ) setElementData ( player, "hydras", hydras ) end end addCommandHandler ( "hydras", create_vehicle ) addEventHandler("onVehicleExit", root, function() local destroyTimer = setTimer( function( hydras ) if isElement( hydras ) then destroyElement( hydras ) end end, 5000, 1, source) -- vehicle is not defined here, so i wrote source instead of 'vehicle' setElementData(source, "destroyTimer", destroyTimer) -- same end)
kevincouto6 Posted May 18, 2018 Author Posted May 18, 2018 (edited) Hello, the errors are at the time of add permissions to create the AREA, if anyone can help me pf? Edited May 18, 2018 by kevincouto6
TEDERIs Posted May 18, 2018 Posted May 18, 2018 I can't find a place in the code where add permissions are performed. And I can't find an implementation of the setArea.
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