Archz Posted September 21, 2021 Share Posted September 21, 2021 local gate = createObject(16773, 978.79998779297, -1693, 14.699999809265, 0, 0, 0) local marker = createMarker(978.79998779297, -1693, 14.699999809265, "cylinder", 8, 0, 0, 0, 0) function moveGate(thePlayer) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup("pm")) then moveObject(gate, 3000, 978.79998779297, -1693, 8.1999998092651) end end addEventHandler("onMarkerHit", marker, moveGate) function move_back_gate() moveObject(gate, 3000, 978.79998779297, -1693, 14.699999809265) end addEventHandler("onMarkerLeave", marker, move_back_gate) Mensagem no Debug: WARNING lua:5: Bad Argument @ 'getPlayerAccount' [Expected player or console at argument 1, got vehicle WARNING lua:5: Bad Argument @ 'getPlayerAccountName' [Expected account at argument 1, got boolean ERROR: lua:5: attempt to concatenate a boolean value Warning Nesse script de portão por acl quando chego a frente dele a pé funciona normalmente sem nenhum erro, más quando pego um carro e chego no portão aparece isso no debug Link to comment
Spakye Posted September 21, 2021 Share Posted September 21, 2021 (edited) Hello, make sure that to check that the source of the marker hit event is a player, cause vehicles also trigger the event which cause the error you have. function moveGate(thePlayer) if getElementType(thePlayer) == "player" then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup("pm")) then moveObject(gate, 3000, 978.79998779297, -1693, 8.1999998092651) end end end addEventHandler("onMarkerHit", marker, moveGate) Edited September 21, 2021 by Spakye Link to comment
Archz Posted September 21, 2021 Author Share Posted September 21, 2021 @Spakye ah, now i understand how it works, thank you so much man, you helped me a lot. s2 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