Jump to content

Marker Trigger Command


CodyLewis

Recommended Posts

There is an other way. Go to the 'hedit' folder and open up your meta.xml file.

Put this line anywhere and save it:

function="toggleEditor" type="client"/> --> Client side only. 

You can now toggle the GUI from any resource like so:

marker = createMarker( 0, 0, 3, "cylinder", 1 ) 
  
addEventHandler('onClientMarkerHit', marker, function() 
    exports.hedit:toggleEditor() 
end) 
  

Link to comment

If you don't want the players to be able to use the command and bind ( command 'hedit' and the 'b' key ), go to this folder: hedit\client\gui.

Open up 'guicreator.lua' and comment out lines 72, 73, so it should look like:

--bindKey ( getUserConfig ( "usedKey" ), "down", toggleEditor ) 
--addCommandHandler ( getUserConfig ( "usedCommand" ), toggleEditor ) 

Link to comment
marker = createMarker( 0, 0, 3, "cylinder", 1 ) 
  
addEventHandler('onClientMarkerHit', marker, function( hitElement) 
    if hitElement == localPlayer or hitElement == getPedOccupiedVehicle ( localPlayer ) and getVehicleController( hitElement ) == localPlayer then 
        exports.hedit:toggleEditor() 
    end 
end) 

Edited by Guest
Link to comment
  • Moderators
marker = createMarker( 0, 0, 3, "cylinder", 1 ) 
  
addEventHandler('onClientMarkerHit', marker, function( hitElement) 
    if hitElement == localPlayer or hitElement == getPedOccupiedVehicle ( localPlayer ) then 
        exports.hedit:toggleEditor() 
    end 
end) 

Nope, it will do the same.

@CodeLewis: check if the function toggleEditor has arguments. Maybe you can specify the player to show it.

Otherwise, modify that function to do so.

Link to comment
marker = createMarker( 0, 0, 3, "cylinder", 1 ) 
  
addEventHandler('onClientMarkerHit', marker, function( hitElement) 
    if hitElement == localPlayer or hitElement == getPedOccupiedVehicle ( localPlayer ) then 
        exports.hedit:toggleEditor() 
    end 
end) 

Nope, it will do the same.

@CodeLewis: check if the function toggleEditor has arguments. Maybe you can specify the player to show it.

Otherwise, modify that function to do so.

Huh? Why would it? hitElement is the element that has entered the marker, I don't get it why would it be the same.

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