E-mail Posted August 27, 2011 Share Posted August 27, 2011 Hi i have made TapPanel But i need to add bind key F3 to open and close Please Help any one! local myWindow = guiCreateWindow ( 0, 0, 0.5, 0.4, "Information", true ) local tabPanel = guiCreateTabPanel ( 0, 0.1, 1, 1, true, myWindow ) local tabMap = guiCreateTab( "information", tabPanel ) local tabHelp = guiCreateTab( "Need Help?", tabPanel ) guiCreateLabel(0.02,0.04,0.94,0.2,"This server By|x[Dev-PoinT]x",true,tabMap) guiCreateLabel(0.02,0.04,0.94,0.92,"Email:[email protected]",true,tabHelp) Link to comment
Jaysds1 Posted August 27, 2011 Share Posted August 27, 2011 Try this: --Server side addEventHandler("onPlayerJoin",getResourceRootElement(getThisResource()),function() bindKey (source, "f3", "down", tapP) end) addEventHandler("onResourceStart",getRootElement(), function() for index, player in pairs(getElementsByType("player")) do unbindKey ( player, "f3", "down", tapP) end end) function tapP() triggerClientEvent(source,"tPan",getRootElement()) end --Client-side function tp() local myWindow = guiCreateWindow ( 0, 0, 0.5, 0.4, "Information", true ) local tabPanel = guiCreateTabPanel ( 0, 0.1, 1, 1, true, myWindow ) local tabMap = guiCreateTab( "information", tabPanel ) local tabHelp = guiCreateTab( "Need Help?", tabPanel ) guiCreateLabel(0.02,0.04,0.94,0.2,"This server By|x[Dev-PoinT]x",true,tabMap) guiCreateLabel(0.02,0.04,0.94,0.92,"Email:[email protected]",true,tabHelp) end addEventHaadler("onClientResourceStart",resourceRoot,function() tp() end) addEvent("tPan",true) addEventHandler("tPan",getRootElement(), function() guiSetVisible(myWindow, not guiGetVisible(myWiindw)) showCursor(not isCursorShowing()) end) Link to comment
JR10 Posted August 27, 2011 Share Posted August 27, 2011 Better to do this: showCursor(guiGetVisible ( myWiindw ) ) 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