Kopi Posted August 23, 2023 Posted August 23, 2023 (edited) server side: function onPlayerLogin(_,acc) if getPlayerAccount(acc) then for i = 1, #coords do for j = 1, 3 do if getAccountData(source, "timeTrial"..i.."-"..j) ~= nil then triggerClientEvent(source, "accountDatasFromServer", source, getAccountData(source, "timeTrial"..i.."-"..j), i) else triggerClientEvent(source, "accountDatasFromServer", source, "-", i) end end end end end addEventHandler("onPlayerLogin", root, onPlayerLogin) Client side: function accountDatasFrom(data, i) accountDatas[i] = {data1, data2, data3} end addEvent("accountDatasFromServer", true) addEventHandler("accountDatasFromServer", root, accountDatasFrom) dxDrawText(accountDatas[id][1], sx/2 - 120, sy/2 - 126, _, _, tocolor(255,255,255,255), 0.65, font, "center", _, false, false, false, true) My problem: I would like to be able to use the matrix sent from the server side on the client side. I am currently still learning this feature, that's why I contacted you. Edited August 23, 2023 by Vinyard
Moderators IIYAMA Posted August 25, 2023 Moderators Posted August 25, 2023 On 23/08/2023 at 15:16, Kopi said: getAccountData(source, "timeTrial"..i.."-"..j) How does the data looks like? And what type does it have? Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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