Klesh Posted June 13, 2011 Share Posted June 13, 2011 Hi community, i have the following problem: The GUI dont show. Here is the code: Client-Side ocalPlayer = getlocalPlayer () addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource() ), outputChatBox("Resource Cash System Started, Press F1 To open GUI.",0,255,0) outputChatBox("Author: Klesh",0,255,0) userPanelWindow = guiCreateWindow(380,277,290,82,"Player Cash",false) Money_lab = guiCreateLabel(17,32,46,24,"Money :",false,playerMoneyLabel) guiLabelSetColor(Money_lab,0,255,0) playerMoneyLabel = guiCreateLabel(75,33,199,18,"\"\"",false,playerMoneyLabel) guiLabelSetColor(money_lab2,255,0,0) function onresourceStart () bindkey ("F7", "down", showUserPanelWindow) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showUserPanel () getVisible = guiGetVisible (userPanelWindow) if (getVisible == true) then guiSetVisible (userPanelWindow, false) showCursor (false) end if (GetVisible == false) then guiGetVisible (userPanelWindow) showcursor (true) local PlayerMoney = getPlayerMoney(source) guiSetText ( playerMoneyLabel, " [ " .. playerMoney .. " ]" ) end end Link to comment
AHSS Posted June 13, 2011 Share Posted June 13, 2011 ocalPlayer = getlocalPlayer () addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource() ), function() outputChatBox("Resource Cash System Started, Press F1 To open GUI.",0,255,0) outputChatBox("Author: Klesh",0,255,0) userPanelWindow = guiCreateWindow(380,277,290,82,"Player Cash",false) Money_lab = guiCreateLabel(17,32,46,24,"Money :",false,playerMoneyLabel) guiLabelSetColor(Money_lab,0,255,0) playerMoneyLabel = guiCreateLabel(75,33,199,18,"\"\"",false,playerMoneyLabel) guiLabelSetColor(money_lab2,255,0,0) end ) function onresourceStart () bindkey ("F7", "down", showUserPanelWindow) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showUserPanelWindow() getVisible = guiGetVisible (userPanelWindow) if (getVisible == true) then guiSetVisible (userPanelWindow, false) showCursor (false) end if (GetVisible == false) then guiGetVisible (userPanelWindow) showcursor (true) local PlayerMoney = getPlayerMoney(source) guiSetText ( playerMoneyLabel, " [ " .. playerMoney .. " ]" ) end end Link to comment
CowTurbo Posted June 13, 2011 Share Posted June 13, 2011 userPanelWindow = guiCreateWindow(380,277,290,82,"Player Cash",false) Money_lab = guiCreateLabel(17,32,46,24,"Money :",false,playerMoneyLabel) guiLabelSetColor(Money_lab,0,255,0) playerMoneyLabel = guiCreateLabel(75,33,199,18,"\"\"",false,playerMoneyLabel) guiLabelSetColor(money_lab2,255,0,0) guiSetVisible ( userPanelWindow, false ) function onresourceStart () bindkey ("F7", "down", showUserPanelWindow) outputChatBox("Resource Cash System Started, Press F1 To open GUI.",0,255,0) outputChatBox("Author: Klesh",0,255,0) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart ) function showUserPanelWindow() if (guiGetVisible (userPanelWindow)) == true then guiSetVisible (userPanelWindow, false) showCursor (false) else guiSetVisible (userPanelWindow, true) showCursor (true) local PlayerMoney = getPlayerMoney(getLocalPlayer()) guiSetText ( playerMoneyLabel, " [ " ..tonumber(playerMoney).. " ]" ) end end Link to comment
Klesh Posted June 13, 2011 Author Share Posted June 13, 2011 I press F7, the Gui no Open, where is the problem? Link to comment
Castillo Posted June 13, 2011 Share Posted June 13, 2011 userPanelWindow = guiCreateWindow(380,277,290,82,"Player Cash",false) Money_lab = guiCreateLabel(17,32,46,24,"Money :",false,playerMoneyLabel) guiLabelSetColor(Money_lab,0,255,0) playerMoneyLabel = guiCreateLabel(75,33,199,18,"\"\"",false,playerMoneyLabel) guiLabelSetColor(money_lab2,255,0,0) guiSetVisible ( userPanelWindow, false ) function onresourceStart () bindKey ("F7", "down", showUserPanelWindow) outputChatBox("Resource Cash System Started, Press F1 To open GUI.",0,255,0) outputChatBox("Author: Klesh",0,255,0) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart ) function showUserPanelWindow() if (guiGetVisible (userPanelWindow)) == true then guiSetVisible (userPanelWindow, false) showCursor (false) else guiSetVisible (userPanelWindow, true) showCursor (true) local PlayerMoney = getPlayerMoney(getLocalPlayer()) guiSetText ( playerMoneyLabel, " [ " ..tostring(playerMoney).. " ]" ) end end If you take a look in the debugscript(debugscript 3) you will see that it says 'attempt to call global bindkey a (nil value)', that's because it's bindKey not bindkey, upper case at key. Link to comment
Klesh Posted June 13, 2011 Author Share Posted June 13, 2011 I resolve the problem for my own, Thanks to all. 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