Jump to content

[HELP]Interior


Recommended Posts

Posted

Hello Community,

I want to make a Marker (createMarker) when onMarkerHit I want to enter an interior.

How can I make it enter it and how to return with another marker.

Thanks.

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

What do you mean by "own created interiors"? you can create objects inside an interior ( on a free space ), then use that interior ID at setElementInterior, but you can't add new interior IDs.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

+ Where can I get the Id's for the interiors in this function?

@SolidSnake14

Is every Interior an new dimension?

So I can create as example an interior in ID 1 and use other coordinates?

+ Are there more Interiors in 1 ID but other coordinates?

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

So is it possible to make a new room in Interior ID 1 or 2... ?

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

You can create it, yes.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Here's my code, No Errors but Marker dissapears after hit and nothing happens furter.

local myMarker = createMarker(-2620.7634277344, 1376.0603027344, 7.1228446960449, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker 
  
function MarkerHit( hitElement, matchingDimension ) -- define MarkerHit function for the handler 
    local elementType = getElementType( hitElement ) -- get the hit element's type 
    setElementInterior(source, 3, 1494.3350, 1305.6510, 1093.2890) 
end 
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) 

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

The source of onMarkerHit event is the marker that got hit, It's dissapearing because you're sending it to another interior .

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted

Change 'source' to 'hitElement' at setElementInterior.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Thank You I will try that and reply if it worked or not.

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted
Thanks,

Can I set a Marker in an Interior and how?

local marker = createMarker() 
setElementInterior(marker, interior) 
setElementDimension(marker, dimension) 

Posted
local myMarker = createMarker(-2620.7634277344, 1376.0603027344, 7.1228446960449, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker 
  
function MarkerHit( hitElement, matchingDimension ) 
    local elementType = getElementType( hitElement ) 
    setElementInterior(source, 3, 1494.3350, 1305.6510, 1093.2890) 
end 
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) 
  
local marker = createMarker() 
setElementInterior(myMarker, 1494.3350, 1305.6510, 1093.2890) 
setElementDimension(myMarker, 3) 

Correct?

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

Wrong, that makes no sense, you are creating 2 markers, one without any argument at all.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Moderators
Posted

remove:

local marker = createMarker() -- line 9 

Also:

setElementInterior(myMarker, 1494.3350, 1305.6510, 1093.2890) 
setElementInterior ( element theElement, int interior [, float x, float y, float z] ) -- read syntax clearly 

local myMarker = createMarker(-2620.7634277344, 1376.0603027344, 7.1228446960449, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker 
  
  
function MarkerHit( hitElement, matchingDimension ) 
    if getElementType( hitElement ) == "player"  then 
    setElementInterior( hitElement, 3, 1494.3350, 1305.6510, 1093.2890) 
    end 
end 
  
setElementInterior(myMarker,3, 1494.3350, 1305.6510, 1093.2890)-- I have set it to interior 3, if that isn't your interior you have to change the value 
setElementDimension(myMarker, 3) 
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) 

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

Thanks but where is a Dimension needed for? (Noob question)

I know an Interior is in an other world then but still Dimension 0

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

You had it on your code, so he just left it there.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
local myMarker = createMarker(-2620.7634277344, 1376.0603027344, 7.1228446960449, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker 
  
  
function MarkerHit( hitElement, matchingDimension ) 
    if getElementType( hitElement ) == "player"  then 
    setElementInterior( hitElement, 3, 1494.3350, 1305.6510, 1093.2890) 
    end 
end 
  
setElementInterior(myMarker,3, 1494.3350, 1305.6510, 1093.2890)-- I have set it to interior 3, if that isn't your interior you have to change the value 
setElementDimension(myMarker, 3) 
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) 

doesn't work

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

Try this :

local myMarker = createMarker( -2620.7634277344, 1376.0603027344, 7.1228446960449, 'cylinder', 2.0, 255, 0, 0, 150 );  
setElementInterior( myMarker, 3, 1494.3350, 1305.6510, 1093.2890 ); 
setElementDimension( myMarker, 3 ); 
  
  
function MarkerHit( hitElement, matchingDimension ) 
    if getElementType( hitElement ) == 'player'  then 
        setElementInterior( hitElement, 3, 1494.3350, 1305.6510, 1093.2890 ); 
    end 
end 
addEventHandler( 'onMarkerHit', myMarker, MarkerHit ); 

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted
Try this :
local myMarker = createMarker( -2620.7634277344, 1376.0603027344, 7.1228446960449, 'cylinder', 2.0, 255, 0, 0, 150 );  
setElementInterior( myMarker, 3, 1494.3350, 1305.6510, 1093.2890 ); 
setElementDimension( myMarker, 3 ); 
  
  
function MarkerHit( hitElement, matchingDimension ) 
    if getElementType( hitElement ) == 'player'  then 
        setElementInterior( hitElement, 3, 1494.3350, 1305.6510, 1093.2890 ); 
    end 
end 
addEventHandler( 'onMarkerHit', myMarker, MarkerHit ); 

What's the point to use ( setElementInterior ) Function? The player hit the marker when it's already at the interior 3 use ( setElementPosition ) Would be much better .

  

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