Jump to content

Interior problem


Dimos7

Recommended Posts

local marker = createMarker (1555.5 , -1675.6 , 16.9, "arrow", 1.5, 0, 150, 255, 255) 
state = 0 
  
function interior() 
        if state == 0 then 
           setElementInterior(source, 6 ,246.7, 63.3, 1003.6) 
           marker2 = createMarker (246.8, 62.2, 1004.6 , "arrow", 1.5, 0, 150, 255, 255) 
           outputChatBox("You've entering Los Santos Police Derpartment (ID:6) Owner:State",getRootElement(), 0 , 255, 150)   
          state = 1 
        else 
            setElementInterior(source, 0, 1553.7, -1675.5, 16.1) 
            state = 0 
        end 
end 
addEventHandler("onMarkerHit", marker, interior) 
addEventHandler("onMarkerHit", marker2, interior)        

No put the interior only aprears the message help

Link to comment

---serverside

local marker = createMarker (1555.5 , -1675.6 , 16.9, "arrow", 1.5, 0, 150, 255, 255) 
local marker2 = createMarker (246.8, 62.2, 1004.6 , "arrow", 1.5, 0, 150, 255, 255) 
state = 0 
  
addEventHandler("onMarkerHit",marker, 
function ( player ) 
 if (getElementType (player) == 'player'  and state == 0 ) then 
 setElementInterior(player, 6 ,246.7, 63.3, 1003.6) 
 outputChatBox("You've enterd Los Santos Police Derpartment (ID:6) Owner:State",player, 0 , 255, 150) 
 state = 1 
  end 
end 
) 
  
addEventHandler("onMarkerHit",marker2, 
function ( player ) 
    if (getElementType (player) == 'player'  and state == 1 ) then 
    setElementInterior(player, 0, 1553.7, -1675.5, 16.1) 
            state = 0 
  end 
end 
) 

/debugscript 3 to see if there is any errors ..

Link to comment

<meta> 
    <info author="Dimos_Rosso" type="gamemode" name="rp 2.0" description="My first MTA server"/> 
    <map src="rp.map"/> 
    <script src="rp.lua" /> 
    <script src="object.lua"/> 
    <script src="test.lua"/> 
</meta> 

Well the state i put it to move object and worked WARNING: rp\test.lua:3: Bad argument @ 'addEventHandler' [Expected function at argument 3, got nil]

WARNING: rp\test.lua:16: Bad argument @ 'addEventHandler' [Expected element at argument 2, got nil]

Link to comment
<meta> 
    <info author="Dimos_Rosso" type="gamemode" name="rp 2.0" description="My first MTA server"/> 
    <map src="rp.map"/> 
    <script src="rp.lua" /> 
    <script src="object.lua"/> 
    <script src="test.lua"/> 
</meta> 

Well the state i put it to move object and worked WARNING: rp\test.lua:3: Bad argument @ 'addEventHandler' [Expected function at argument 3, got nil]

WARNING: rp\test.lua:16: Bad argument @ 'addEventHandler' [Expected element at argument 2, got nil]

post the full code of it ,

Link to comment
local marker = createMarker (1555.5 , -1675.6 , 16.9, "arrow", 1.5, 0, 150, 255, 255)  
local marker2 = createMarker (246.8, 62.2, 1004.6 , "arrow", 1.5, 0, 150, 255, 255) 
  
addEventHandler("onMarkerHit", marker, interior) 
function interior (player) 
        if (getElementType(player) == 'player' ) then 
           setElementInterior(source, 6 ,246.7, 63.3, 1003.6) 
           outputChatBox("You've entered Los Santos Police Derpartment (ID:6) Owner:State",player, 0 , 255, 150)   
        end 
end 
addEventHandler("onMarkerHit", marker2, world) 
function world(player) 
        if (getElementType(player) == 'player') then 
            setElementInterior(source, 0, 1553.7, -1675.5, 16.1) 
        end 
end 

Edited by Guest
Link to comment
local marker = createMarker (1555.5 , -1675.6 , 16.9, "arrow", 1.5, 0, 150, 255, 255)  
local marker2 = createMarker (246.8, 62.2, 1004.6 , "arrow", 1.5, 0, 150, 255, 255) 
  
  
function interior (player) 
        if (getElementType(player) == 'player' ) then 
           setElementInterior(source, 6 ,246.7, 63.3, 1003.6) 
           outputChatBox("You've entered Los Santos Police Derpartment (ID:6) Owner:State",player, 0 , 255, 150)   
        end 
end 
addEventHandler("onMarkerHit", marker, interior) 
  
function world(player) 
        if (getElementType(player) == 'player') then 
            setElementInterior(source, 0, 1553.7, -1675.5, 16.1) 
        end 
end 
addEventHandler("onMarkerHit", marker2, world) 

now apreas the message again but not interior

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