Jump to content

[Help] SetelementInterior doesn't work


Recommended Posts

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
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
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
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...