TorNix~|nR Posted December 12, 2017 Posted December 12, 2017 Hello guys, I want when player use a command, it automatically copy a message, please help onPlayerCommand ZI ZOMBIE INFECTION: mtasa://5.196.7.163:22003
Awang Posted December 12, 2017 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
TorNix~|nR Posted December 12, 2017 Author Posted December 12, 2017 When a player for example use a command /facebook it automatically copy the facebook link, is an example ZI ZOMBIE INFECTION: mtasa://5.196.7.163:22003
Awang Posted December 12, 2017 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
TorNix~|nR Posted December 12, 2017 Author Posted December 12, 2017 Thank you so much 1 ZI ZOMBIE INFECTION: mtasa://5.196.7.163:22003
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