Jump to content

Markers


Recommended Posts

trigger a client event for the admin that will create the marker

example:

--server side 
addEventHandler('onPlayerJoin', root, 
function() 
--if isPlayerAdmin then check if the player admin your way 
triggerClientEvent(source, 'showMarker', source) 
--end 
end 
) 
  
--client side 
addEvent('showMarker', true) 
addEventHandler('showMarker', root, 
function() 
createMarker(--arguments) 
end 
) 

Link to comment

no need for client/server triggering

use createMarker() to create it and afterwards use this function:

https://wiki.multitheftauto.com/wiki/SetElementVisibleTo

First, you have to use this function to set the marker invisible to everyone

Afterwards, you will use this function to set it visible only to the admin (whom you will detect with

https://wiki.multitheftauto.com/wiki/Has ... rmissionTo

(everything serverside)

Link to comment

You are right but i prefer client event.

because

Can an element only be visible to one element (and its children) at a time? If so, do we need clearElementVisibleTo? If not, surely we need to remove the root element before using this function?

So i just prefer using client scripts.

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