Jump to content

How to createmarker for createobject mta


Orangotango

Recommended Posts

Hi there, I need some help. I am using the house system created by dakilla, but i want to change some things in there.

Like the title saids, i want to replace the market that shows on the entrance when you create the house, for the green house object for players to buy it. This is the code:

  
local m_Enter = createMarker( eX, eY, eZ - 1, 'cylinder', 1.25, 0, 153, 255, 150 ); 
  setElementData( m_Enter, 'HS_INFO', { etX, etY, etZ, int, dim, cost, owner, key, ID } ); 
   
  if getElementData( m_Enter, 'HS_INFO' )[7] ~= '' then 
    setMarkerColor( m_Enter, 255, 51, 36, 150 ); 
  end; 
   
  addEventHandler( 'onMarkerHit', m_Enter, function( player ) 
    if getElementType( player ) == 'player' and not getPedOccupiedVehicle( player ) then 
      if not getElementData( player, 'HP_Opened' ) then 
        if not isGuestAccount( getPlayerAccount( player ) ) then 
          setElementData( player, 'mrk_in', getElementData( source, 'HS_INFO' )[9] ); 
          onPlayerHouseMarkerHit( player, source, true ); 
          setElementFrozen( player, true ); 
        else 
          outputChatBox( '* You must be logged in to get in this house!', player, 255, 51, 36 ); 
        end; 
      end; 
    end; 
  end ); 
  

I know i was giving you to much code, but you are more experinced that I am, and I am sure you can help me. I also have take a look on mtawiki, but the code doesn't work. I hope you really can help me. Thanks.

Edited by Guest
Link to comment

Anyway, i think i got you

  
local m_Enter  = createPickup(eX, eY, eZ,3,1273,0); 
  setElementData( m_Enter, 'HS_INFO', { etX, etY, etZ, int, dim, cost, owner, key, ID } ); 
  
  if getElementData( m_Enter, 'HS_INFO' )[7] ~= '' then 
    setMarkerColor( m_Enter, 255, 51, 36, 150 ); 
  end; 
   
 addEventHandler ( "onPickupHit", m_Enter,   
  function( player ) 
    if getElementType( player ) == 'player' and not getPedOccupiedVehicle( player ) then 
      if not getElementData( player, 'HP_Opened' ) then 
        if not isGuestAccount( getPlayerAccount( player ) ) then 
          setElementData( player, 'mrk_in', getElementData( source, 'HS_INFO' )[9] ); 
          onPlayerHouseMarkerHit( player, source, true ); 
          setElementFrozen( player, true ); 
        else 
          outputChatBox( '* You must be logged in to get in this house!', player, 255, 51, 36 ); 
        end; 
      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...