Jump to content

setClipboard problem


Recommended Posts

client side

addEventHandler ("onClientGUIClick", getRootElement(), 
  
function(button, state, absoluteX, absoluteY, ip) 
 local ser = getPlayerSerial ( localPlayer ) 
 local ip =  triggerServerEvent("onGetPlayerIP", getRootElement()) -- is this code true ? 
    if ( source ==  CopySer ) then  
     setClipboard ( ser ) 
     guiSetVisible(GUIEditor_Image[1], false)     
     guiSetVisible(Note, true) 
     playSound("other/newW.mp3") 
    elseif ( source ==  CopyIP ) then  
     setClipboard ( ip ) -- here's the bad argument.. 
     guiSetVisible(GUIEditor_Image[1], false) 
     guiSetVisible(Note, true) 
     playSound("other/newW.mp3") 
  
    elseif ( source ==  ok ) then  
     guiSetVisible(Note, false)   
     showCursor(false) 
     guiSetInputEnabled(false) 
    end 
end 
) 

server side

addEvent("onGetPlayerIP",true) 
function copyip() 
getPlayerIP ( source ) 
end 
addEventHandler("onGetPlayerIP",root, copyip) 

debugscript says: Bad argument @ setClipboard <~ client side

but the serial works correctly, thanks.

Link to comment

--Client Side--

addEventHandler ("onClientGUIClick", root, 
function() 
    if ( source ==  CopySer ) then  
     setClipboard(getPlayerSerial()) 
     guiSetVisible(GUIEditor_Image[1], false)     
     guiSetVisible(Note, true) 
     playSound("other/newW.mp3") 
    elseif ( source ==  CopyIP ) then  
     triggerServerEvent("onGetPlayerIP", localPlayer) 
     guiSetVisible(GUIEditor_Image[1], false) 
     guiSetVisible(Note, true) 
     playSound("other/newW.mp3") 
  
    elseif ( source ==  ok ) then  
     guiSetVisible(Note, false)   
     showCursor(false) 
     guiSetInputEnabled(false) 
    end 
end 
) 
  
addEvent("PlayerIP",true) 
addEventHandler("PlayerIP",root, 
function(IP) 
     setClipboard(IP) 
end) 

--Server Side--

addEvent("onGetPlayerIP",true) 
function copyip() 
triggerClientEvent(source,"PlayerIP",source,getPlayerIP(source)) 
end 
addEventHandler("onGetPlayerIP",root, copyip) 

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