Crosshair Posted May 31, 2012 Posted May 31, 2012 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.
TAPL Posted May 31, 2012 Posted May 31, 2012 function time() local h ,m = getTime() if (m == 0) then outputChatBox("text", root, 255, 0, 0) else return end end setTimer ( time, 1000, 0 )
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