Hello guys.
I`m really stuck with this triggerServerEvent thing.
Lets say i got in the client file this:
wdw = guiCreateWindow(left, top, windowWidth, windowHeight, "withdraw", false)
guiCreateLabel(20, 25, 121, 16, "Balance: ", false, wdw)
in server file i add this:
function balance()
local sql = mysql_query(handler, "SELECT cash FROM accounts WHERE username = '"..getPlayerName(source).."';")
end
addEvent("balance", true)
addEventHandler("balance", getRootElement(), balance)
How do i trigger balance event so that in the label after "Balance: " shows the value from cash column ?
PS. Another issue i got with setTimer
lets say i got this:
function time()
local h ,m = getTime()
if (m == 0) then
outputChatBox("text", source, 255, 0, 0)
else
return
end
end
setTimer ( time, 600, 0 )
So... every 1 min the timmer is triggerd. Works great so far, but "text" appears twice. I read on the wiki page that is something to do with fames per secound and "shouldn't rely on the timer triggering at an exact point in the future". But i want that timer to be triggered at that point. How do i fix it ?
Thanks in advance.