FlyingSpoon Posted April 1, 2016 Share Posted April 1, 2016 I made a custom scoreboard, and I have set element data's but I am trying to refresh it on my scoreboard, because if player changes class then it should change on scoreboard - I get no errors - Client Side function refresh() data = getElementData(getLocalPlayer(), "Class") end setTimer ( refresh, 51, 0 ) dxDrawText(data, classx, y+i*20.5) It's frozen as the previous class and doesnt change Link to comment
Anubhav Posted April 2, 2016 Share Posted April 2, 2016 Use onClientRender on dxDrawText Link to comment
Tekken Posted April 2, 2016 Share Posted April 2, 2016 addEventHandler("onClientRender", getRootElement(), function() dxDrawText(getElementData(getLocalPlayer(), "Class"), classx, y+i*20.5); end); much better! Link to comment
FlyingSpoon Posted April 2, 2016 Author Share Posted April 2, 2016 I dont need client renders, I wanted to know if that was the right way to refresh the element data, I have my renders already. Link to comment
Tekken Posted April 2, 2016 Share Posted April 2, 2016 I dont need client renders,I wanted to know if that was the right way to refresh the element data, I have my renders already. You didn't got me, instead of refreshing the data by a timer you can just replace data variable with "getElementData(getLocalPlayer(), "Class")" in your event. onClientRender event is already like a timer that update enywhere from 25-100 (depends of how many fps you have) times a second. Link to comment
FlyingSpoon Posted April 2, 2016 Author Share Posted April 2, 2016 Nevermind I found out that my problem was I was using setAccountData, and doing getElementData, but how can I make getElementData permanent like save it, so player still has it after reconnect? Link to comment
Walid Posted April 2, 2016 Share Posted April 2, 2016 all what you need is : -- Function getElementData() setElementData() getAccountData() setAccountData() -- Events onPlayerQuit onPlayerLogin 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