NyiTz Posted March 6, 2019 Share Posted March 6, 2019 Well, i create a automatic gates for ACL group. When i work on dimension 0 ( normal ) everything is fine but now i tried change an object to another dimension but the object stays invisible. What i want is that my object stay visible. Help me please ^^ for i = 1, 40 do Gate3 = createObject ( 5020, -2660.8000488281, 1424.8000488281, 921.20001220703, 0, 0, 270 ) setElementDimension( Gate3, i ) x,y,z = getElementPosition (Gate3) Zona = createColCircle ( x,y, 3, 3 ) function Portao7(thePlayer) for _, group in ipairs ({"Console"}) do if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then moveObject (Gate3, 3000, -2660.8000488281, 1424.8000488281, 923 ) end end end addEventHandler ( "onColShapeHit", Zona, Portao5 ) function Portao8(thePlayer) for _, group in ipairs ({"Console"}) do if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then moveObject (Gate3, 3000, -2660.8000488281, 1424.8000488281, 921.20001220703 ) end end end addEventHandler ( "onColShapeLeave", Zona, Portao6 ) end Link to comment
Moderators IIYAMA Posted March 7, 2019 Moderators Share Posted March 7, 2019 If you use Globals, you will be overwriting the variables. for i = 1, 40 do local Gate3 = createObject ( 5020, -2660.8000488281, 1424.8000488281, 921.20001220703, 0, 0, 270 ) setElementDimension( Gate3, i ) local x,y,z = getElementPosition (Gate3) local Zona = createColCircle ( x,y, 3, 3 ) local function Portao7(thePlayer) for _, group in ipairs ({"Console"}) do if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then moveObject (Gate3, 3000, -2660.8000488281, 1424.8000488281, 923 ) end end end addEventHandler ( "onColShapeHit", Zona, Portao7 ) -- not> Portao5 local function Portao8(thePlayer) for _, group in ipairs ({"Console"}) do if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then moveObject (Gate3, 3000, -2660.8000488281, 1424.8000488281, 921.20001220703 ) end end end addEventHandler ( "onColShapeLeave", Zona, Portao8 ) -- not> Portao6 end Link to comment
NyiTz Posted March 8, 2019 Author Share Posted March 8, 2019 On 07/03/2019 at 12:40, IIYAMA said: If you use Globals, you will be overwriting the variables. for i = 1, 40 do local Gate3 = createObject ( 5020, -2660.8000488281, 1424.8000488281, 921.20001220703, 0, 0, 270 ) setElementDimension( Gate3, i ) local x,y,z = getElementPosition (Gate3) local Zona = createColCircle ( x,y, 3, 3 ) local function Portao7(thePlayer) for _, group in ipairs ({"Console"}) do if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then moveObject (Gate3, 3000, -2660.8000488281, 1424.8000488281, 923 ) end end end addEventHandler ( "onColShapeHit", Zona, Portao7 ) -- not> Portao5 local function Portao8(thePlayer) for _, group in ipairs ({"Console"}) do if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then moveObject (Gate3, 3000, -2660.8000488281, 1424.8000488281, 921.20001220703 ) end end end addEventHandler ( "onColShapeLeave", Zona, Portao8 ) -- not> Portao6 end Unfortunately didn't work 100%, now i can feel that have something there, the gates open too but the object stay invisible. Link to comment
Moderators IIYAMA Posted March 8, 2019 Moderators Share Posted March 8, 2019 1 hour ago, NyiTz said: Unfortunately didn't work 100%, now i can feel that have something there, the gates open too but the object stay invisible. Is the gate used in an interior? If yes, then you also have to change that: https://wiki.multitheftauto.com/wiki/SetElementInterior 1 Link to comment
NyiTz Posted March 8, 2019 Author Share Posted March 8, 2019 2 hours ago, IIYAMA said: Is the gate used in an interior? If yes, then you also have to change that: https://wiki.multitheftauto.com/wiki/SetElementInterior Problem solved defining interior. Thank you so much 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