Jump to content

showGui


Klesh

Recommended Posts

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

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