Tete omar Posted June 15, 2012 Share Posted June 15, 2012 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
TAPL Posted June 15, 2012 Share Posted June 15, 2012 --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
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