Lukkaz Posted August 1, 2011 Share Posted August 1, 2011 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? Link to comment
Jaysds1 Posted August 1, 2011 Share Posted August 1, 2011 you have to use client, player, source... etc, Show me the dx code. Link to comment
Lukkaz Posted August 1, 2011 Author Share Posted August 1, 2011 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) Link to comment
Jaysds1 Posted August 1, 2011 Share Posted August 1, 2011 (edited) When triggering a event to client-side, add client,player, or getRootElement(). triggerClientEvent(source,"SOMETHING",getRootElemet()) Edited August 1, 2011 by Guest Link to comment
Lukkaz Posted August 1, 2011 Author Share Posted August 1, 2011 now it doesnt work at all... Link to comment
Jaysds1 Posted August 1, 2011 Share Posted August 1, 2011 (edited) it should work... hmmm, Show me when you trigger these events and the events. Edited August 1, 2011 by Guest Link to comment
BinSlayer1 Posted August 1, 2011 Share Posted August 1, 2011 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 Link to comment
ChaseOquinn Posted August 1, 2011 Share Posted August 1, 2011 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) Link to comment
Jaysds1 Posted August 1, 2011 Share Posted August 1, 2011 Sorry, Last night I was tired so, I tried to help him... Anyways... Does it work lukkaz? Link to comment
AeroXbird Posted August 1, 2011 Share Posted August 1, 2011 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. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now