Jump to content

Auto copy command


TorNix~|nR

Recommended Posts

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 by Awang
  • Thanks 1
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...