Jump to content

Showing dx only to one person?


Lukkaz

Recommended Posts

Posted

I toggle my DX menus with add/remove event handlers. However when a player adds an event handler every player in the server can see the menu. Is there a way to disable it / enable it for the one person rather than the while server?

Posted
  
function iceBreaker() 
addEventHandler("onClientClick", getRootElement(), convoReply) 
addEventHandler("onClientRender", getRootElement(), convoDX) 
end 
  
addEvent("breakIce", true) 
addEventHandler("breakIce", getRootElement(), iceBreaker) 
  
  
function convoEnd() 
removeEventHandler("onClientClick", getRootElement(), convoReply) 
removeEventHandler("onClientRender", getRootElement(), convoDX) 
setCameraTarget(getLocalPlayer()) 
showCursor(false) 
cLevel = 1 
cOption = 1 
end 
  
addEvent("endConvo", true) 
addEventHandler("endConvo", getRootElement(), convoEnd) 
  
  

Posted (edited)

When triggering a event to client-side, add client,player, or getRootElement().

triggerClientEvent(source,"SOMETHING",getRootElemet()) 

Edited by Guest
Posted

how could your way even work?

So every client ADDS an EVENT for each remote player???

This isn't possible..

His problem is most likely when he triggers breakIce and endConvo

the triggerClientEvent should look like this:

triggerClientEvent(, 'breakIce', getRootElement())

You're most likely missing the first argument in the triggerClientEvent() function. You should read about it in the wiki to understand it fully

Posted
Jaysds1 that's wrong. If you want to trigger a client event from the server side for only the source player use this.
triggerClientEvent(source,"event name",source) 

It wont really work, unless the source is the actual player, otherwise he would have to get the player element from an argument.

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