FlyingSpoon Posted April 1, 2016 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 GitHub: https://github.com/flyingspoon YouTube: https://www.youtube.com/channel/UClsnd4SEid3gob33DSk1-GQ
Anubhav Posted April 2, 2016 Posted April 2, 2016 Use onClientRender on dxDrawText See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Tekken Posted April 2, 2016 Posted April 2, 2016 addEventHandler("onClientRender", getRootElement(), function() dxDrawText(getElementData(getLocalPlayer(), "Class"), classx, y+i*20.5); end); much better! Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
FlyingSpoon Posted April 2, 2016 Author 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. GitHub: https://github.com/flyingspoon YouTube: https://www.youtube.com/channel/UClsnd4SEid3gob33DSk1-GQ
Tekken Posted April 2, 2016 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. Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
FlyingSpoon Posted April 2, 2016 Author 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? GitHub: https://github.com/flyingspoon YouTube: https://www.youtube.com/channel/UClsnd4SEid3gob33DSk1-GQ
Walid Posted April 2, 2016 Posted April 2, 2016 all what you need is : -- Function getElementData() setElementData() getAccountData() setAccountData() -- Events onPlayerQuit onPlayerLogin Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
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