bebo1king Posted July 31, 2016 Share Posted July 31, 2016 as the topic name says , the setElementPosition and dimnesions work 100% , but interior don't work Code : ExitTrainingData = {} local ExitTrainingTable = { {"[Gh|DZ]",-1129,1066.199,1347,2325.61,-1022,1050.2,1,9}, {"X.I.I",-1129,1066.199,1347,2325.61,-1022,1050.2,2,9}, {".:[shNp]:.",-1129,1066.199,1347,2325.61,-1022,1050.2,3,9}, {"DGH",-1129,1066.199,1347,2325.61,-1022,1050.2,4,9}, {"None1",-1129,1066.199,1347,2325.61,-1022,1050.2,5,9}, {"None2",-1129,1066.199,1347,2325.61,-1022,1050.2,6,9} } for i ,v in pairs (ExitTrainingTable) do ExitTraining = createMarker(v[2],v[3],v[4],"arrow",2,0,77,136,150) setElementDimension(ExitTraining,v[8]) setElementInterior(ExitTraining,10) EnterTrainingData[ExitTraining] = {v[1],v[5],v[6],v[7],v[8],v[9]} end addEventHandler("onMarkerHit",resourceRoot, function(player) local Data = ExitTrainingData[source] if ( Data ) then if not isPedInVehicle(player) and getElementData (player,"Group") == Data[1] then setElementDimension(player,Data[5]) setElementPosition(player,Data[2],Data[3],Data[4]) setElementInterior(player,Data[6]) end end end) Link to comment
Wumbaloo Posted July 31, 2016 Share Posted July 31, 2016 You wrote "setElementInterior, 10" Instead of "setElementInterior, v[10] Link to comment
bebo1king Posted July 31, 2016 Author Share Posted July 31, 2016 You wrote "setElementInterior, 10" Instead of "setElementInterior, v[10] count the table right there is 9 argument Link to comment
Wumbaloo Posted July 31, 2016 Share Posted July 31, 2016 So you wrote "setElementInterior, 10", replace it by "setElementInterior, v[9]" Link to comment
Wumbaloo Posted July 31, 2016 Share Posted July 31, 2016 ExitTrainingData = {} local ExitTrainingTable = { {"[Gh|DZ]",-1129,1066.199,1347,2325.61,-1022,1050.2,1,9}, {"X.I.I",-1129,1066.199,1347,2325.61,-1022,1050.2,2,9}, {".:[shNp]:.",-1129,1066.199,1347,2325.61,-1022,1050.2,3,9}, {"DGH",-1129,1066.199,1347,2325.61,-1022,1050.2,4,9}, {"None1",-1129,1066.199,1347,2325.61,-1022,1050.2,5,9}, {"None2",-1129,1066.199,1347,2325.61,-1022,1050.2,6,9} } for i ,v in pairs (ExitTrainingTable) do ExitTraining = createMarker(v[2],v[3],v[4],"arrow",2,0,77,136,150) setElementDimension(ExitTraining,v[8]) setElementInterior(ExitTraining, v[9]) EnterTrainingData[ExitTraining] = {v[1],v[5],v[6],v[7],v[8],v[9]} end addEventHandler("onMarkerHit",resourceRoot, function(player) local Data = ExitTrainingData[source] if ( Data ) then if not isPedInVehicle(player) and getElementData (player,"Group") == Data[1] then setElementDimension(player,Data[5]) setElementPosition(player,Data[2],Data[3],Data[4]) setElementInterior(player,Data[6]) end end end) Link to comment
bebo1king Posted July 31, 2016 Author Share Posted July 31, 2016 ExitTrainingData = {} local ExitTrainingTable = { {"[Gh|DZ]",-1129,1066.199,1347,2325.61,-1022,1050.2,1,9}, {"X.I.I",-1129,1066.199,1347,2325.61,-1022,1050.2,2,9}, {".:[shNp]:.",-1129,1066.199,1347,2325.61,-1022,1050.2,3,9}, {"DGH",-1129,1066.199,1347,2325.61,-1022,1050.2,4,9}, {"None1",-1129,1066.199,1347,2325.61,-1022,1050.2,5,9}, {"None2",-1129,1066.199,1347,2325.61,-1022,1050.2,6,9} } for i ,v in pairs (ExitTrainingTable) do ExitTraining = createMarker(v[2],v[3],v[4],"arrow",2,0,77,136,150) setElementDimension(ExitTraining,v[8]) setElementInterior(ExitTraining, v[9]) EnterTrainingData[ExitTraining] = {v[1],v[5],v[6],v[7],v[8],v[9]} end addEventHandler("onMarkerHit",resourceRoot, function(player) local Data = ExitTrainingData[source] if ( Data ) then if not isPedInVehicle(player) and getElementData (player,"Group") == Data[1] then setElementDimension(player,Data[5]) setElementPosition(player,Data[2],Data[3],Data[4]) setElementInterior(player,Data[6]) end end end) The problem is here addEventHandler("onMarkerHit",resourceRoot, function(player) local Data = ExitTrainingData[source] if ( Data ) then if not isPedInVehicle(player) and getElementData (player,"Group") == Data[1] then setElementDimension(player,Data[5]) setElementPosition(player,Data[2],Data[3],Data[4]) setElementInterior(player,9) setElementData (source,"BaseTraining",false) end end end) That line don't work that's the real problem setElementInterior(player,9) Link to comment
Wumbaloo Posted July 31, 2016 Share Posted July 31, 2016 Look at my code, I said you the solution twice, you forgot the v[ before the number 9 at setElementInterior Link to comment
bebo1king Posted July 31, 2016 Author Share Posted July 31, 2016 Look at my code, I said you the solution twice, you forgot the v[ before the number 9 at setElementInterior i tested your code , the problem not in the marker interior the problem in when player hit marker he still in interior 10 he should go interior 9 Link to comment
Wumbaloo Posted July 31, 2016 Share Posted July 31, 2016 ExitTrainingData = {} local ExitTrainingTable = { {"[Gh|DZ]",-1129,1066.199,1347,2325.61,-1022,1050.2,1,9}, {"X.I.I",-1129,1066.199,1347,2325.61,-1022,1050.2,2,9}, {".:[shNp]:.",-1129,1066.199,1347,2325.61,-1022,1050.2,3,9}, {"DGH",-1129,1066.199,1347,2325.61,-1022,1050.2,4,9}, {"None1",-1129,1066.199,1347,2325.61,-1022,1050.2,5,9}, {"None2",-1129,1066.199,1347,2325.61,-1022,1050.2,6,9} } for i ,v in pairs (ExitTrainingTable) do ExitTraining = createMarker(v[2],v[3],v[4],"arrow",2,0,77,136,150) setElementDimension(ExitTraining,v[8]) setElementInterior(ExitTraining, v[9]) EnterTrainingData[ExitTraining] = {v[1],v[5],v[6],v[7],v[8],v[9]} end addEventHandler("onMarkerHit",resourceRoot, function(player) local Data = ExitTrainingData[source] if ( Data ) then if not isPedInVehicle(player) and getElementData (player,"Group") == Data[1] then setElementDimension(player,Data[8]) setElementPosition(player,Data[5],Data[6],Data[7]) setElementInterior(player,Data[9]) end end end) 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