My question is: When I "F5" status "up", "Gui" can not close! help.!
client
addEvent( "moneyn", true )
addEventHandler( "moneyn", getRootElement(),
function(qian)
bindKey ( "F5", "down",function()
qianbao.window[1] = guiCreateWindow(0.33, 0.28, 0.25, 0.16, "钱包", true)
guiWindowSetSizable(qianbao.window[1], false)
guiSetAlpha(qianbao.window[1], 1.00)
qianbao.label[1] = guiCreateLabel(0.10, 0.18, 0.34, 0.24, "你的金钱:", true, qianbao.window[1])
guiSetFont(qianbao.label[1], "default-bold-small")
guiLabelSetColor(qianbao.label[1], 247, 246, 121)
guiLabelSetHorizontalAlign(qianbao.label[1], "center", true)
guiLabelSetVerticalAlign(qianbao.label[1], "center")
qianbao.label[2] = guiCreateLabel(0.34, 0.38, 0.48, 0.23,"请登录!", true, qianbao.window[1])
guiSetText ( qianbao.label[2], qian )
guiLabelSetColor(qianbao.label[2], 213, 72, 92)
guiLabelSetVerticalAlign(qianbao.label[2], "center")
qianbao.staticimage[1] = guiCreateStaticImage(0.04, 0.18, 0.92, 0.76, ":login_mysql/images/qianbao.png", true, qianbao.window[1])
guiSetAlpha(qianbao.staticimage[1], 0.23)
guiSetProperty(qianbao.button[1], "NormalTextColour", "FFAAAAAA")
end
)
end
)
bindKey ( "F5", "up",function()
guiSetVisible(qianbao.window[1],false)
end
)
server
addEventHandler("onPlayerJoin", getRootElement(),
function(player)
setTimer(function()
handler = mysql_connect( host, username, password, db )
if handler then
local result = mysql_query(handler, "SELECT Money FROM players WHERE Username='crazyde21'")-- Execute the query
for result,row in mysql_rows(result) do -- Iterate through all the result rows
mysql_field_seek(result, 1) -- Reset the field cursor to the first field
for k,qian in ipairs(row) do
local field = mysql_fetch_field(result) -- Retreive the field data
triggerClientEvent("moneyn",getRootElement(),qian)
end
end
end
end,10000,0)
end
)