TorNix~|nR Posted December 12, 2017 Share Posted December 12, 2017 Hello guys, I want when player use a command, it automatically copy a message, please help onPlayerCommand Link to comment
Awang Posted December 12, 2017 Share Posted December 12, 2017 You mean, when player use a Command, send a massege to client with the command like this? addEventHandler("onPlayerCommand",getRootElement(),function(command) outputChatBox("You used this command: "..command,source) end) 1 Link to comment
TorNix~|nR Posted December 12, 2017 Author Share Posted December 12, 2017 When a player for example use a command /facebook it automatically copy the facebook link, is an example Link to comment
Awang Posted December 12, 2017 Share Posted December 12, 2017 (edited) Copy to the client clipboard, or send an outputChatBox() with the link? Becuse in this way, you need a trigger for the client: Server side: addEventHandler("onPlayerCommand",getRootElement(),function(command) if command == "facebook" then triggerClientEvent(source,"copyTheLink",source,"www.facebook.com") end end) Client side: addEvent("copyTheLink",true) addEventHandler("copyTheLink",root,function(link) setClipboard(link) end) Or just for \facebook you can do it only in client side: addCommandHandler("facebook",function() setClipboard("www.facebook.com") end) Edited December 12, 2017 by Awang 1 Link to comment
TorNix~|nR Posted December 12, 2017 Author Share Posted December 12, 2017 Thank you so much 1 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