Castillo Posted March 22, 2014 Share Posted March 22, 2014 You said there was no errors in the debugscript, I guess you were wrong. Show me the GUI creation code. Link to comment
Newbie Posted March 22, 2014 Author Share Posted March 22, 2014 (edited) Thanks Solid Edited March 22, 2014 by Guest Link to comment
Newbie Posted March 22, 2014 Author Share Posted March 22, 2014 That is the exact code? Yep, all client file wich includes labels Link to comment
Castillo Posted March 22, 2014 Share Posted March 22, 2014 Found the typo, in guiSetText you got "GUIEditor_Label" uppercase "L" in "Label", change it to "GUIEditor_label". Link to comment
Newbie Posted March 22, 2014 Author Share Posted March 22, 2014 Same line error: attempt to concatenate local win (a nil value) Link to comment
Castillo Posted March 22, 2014 Share Posted March 22, 2014 addEvent ( "myEvent", true ) addEventHandler ( "myEvent", root, function ( win, dead ) guiSetText ( GUIEditor_label [ 2 ], " Wins:".. tostring ( win ) ) guiSetText ( GUIEditor_label [ 3 ], " Deaths:".. tostring ( dead ) ) end ) Link to comment
Newbie Posted March 22, 2014 Author Share Posted March 22, 2014 Works! Thanks! Got some questions 1.My data of wins is 0 so in label shows a "nil" Deaths working fine and other all data that is above 0 Possible to show it as 0 not as nil ? Did it no needed anymore 2. Update stats ? Bec it updates only on login How to ? Link to comment
Castillo Posted March 22, 2014 Share Posted March 22, 2014 You can use the event onClientElementDataChange to detect when the element data changes and then update the labels. Link to comment
Newbie Posted March 23, 2014 Author Share Posted March 23, 2014 Thanks for your help Solidsnake! I did like this: function statss() if isElement( source ) then local account = getPlayerAccount( source ) if account then if isGuestAccount( account ) then return end local account = getPlayerAccount( source ) local win = tonumber(getAccountData(account, "Wins")) or 0 local dead = tonumber(getAccountData(account, "Deaths")) or 0 local tim = tonumber(getAccountData(account, "Time")) or 0 local hunt = tonumber(getAccountData(account, "Hunters")) or 0 local xp = tonumber(getAccountData(account, "EXP")) or 0 local cas = tonumber(getAccountData(account, "Cash")) or 0 local mapp = tonumber(getAccountData(account, "Maps")) or 0 local bmap = tonumber(getAccountData(account, "BuyMaps")) or 0 local luc = tonumber(getAccountData(account, "Lucky")) or 0 local sou = tonumber(getAccountData(account, "Sound")) or 0 triggerClientEvent(source,"myEvent",root,win,dead,tim,hunt,xp,cas,mapp,bmap,luc,sou) end end end addEventHandler("onPlayerLogin",root, statss ) addEventHandler("onElementDataChange",root, statss ) Working fine too Link to comment
Castillo Posted March 23, 2014 Share Posted March 23, 2014 I wouldn't exactly recommend using onElementDataChange. If you are storing the data in element data, then you can make it easier with the event I gave you. 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