Jump to content

Aid someone kind


xRGamingx

Recommended Posts

Someone else tried to replace markers too but failed to do so by using the functions from MTA. I suggested the person to replace a default object ( for example 1337 ) and place it on the same location of the markers. Just hide the actual marker and make the object non-collidable.

Link to comment
Someone else tried to replace markers too but failed to do so by using the functions from MTA. I suggested the person to replace a default object ( for example 1337 ) and place it on the same location of the markers. Just hide the actual marker and make the object non-collidable.

I understand but which object should I use to create those maket?

Link to comment
-- Client --  
addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) 
     local txd = engineLoadTXD ( pathoftxd ) 
     engineImportTXD ( txd, 1337 ) 
     local dff = engineLoadDFF ( pathofdff ) 
     engineReplaceModel ( dff, 1337 ) 
end ) 
  
-- Server -- 
function createCustomMarker ( x, y, z, theType, size, r, g, b, a, visibleTo ) 
     local x = tonumber ( x ) or false 
     if x then 
         local y = tonumber ( y ) or false 
             if y then 
                 local z = tonumber ( z ) or false 
                 if z then 
                     local theType = theType or "checkpoint" 
                     local size = tonumber ( size ) or 4.0 
                     local a = tonumber ( a ) or 255 
                     local visibleTo = visibleTo or root 
                     local marker = createMarker ( x, y, z, theType, size, 0, 0, 0, 0, visibleTo ) 
                     if marker then 
                         local object = createObject ( 1337, x, y, z ) 
                         setObjectScale ( object, size )    -- I bet you have to try a calculation for the perfect size 
                         setElementCollisionsEnabled ( object, false ) 
                         setElementFrozen ( object, true ) 
                         setElementAlpha ( object, a ) 
                         if visibleTo ~= root then 
                              setElementVisibleTo ( object, root, false ) 
                              setElementVisibleTo ( object, visibleTo, true ) 
                         end 
                         attachElements ( object, marker ) 
                         setElementParent ( object, marker ) 
                         return marker  
                     end 
                 end 
             end 
         end 
     end 
     return false 
end 

Try that, should work if I did everything right.

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