iiv03 Posted September 16, 2019 Share Posted September 16, 2019 hey I have a problem in loop between players problem that the picture is repeated and I do not want to be repeated everyone i want one picture how? for i, player in ipairs(getElementsByType("player")) do local avatar = getElementData(player, "avatarHash") or false if (not loadedTexture[player]) then if avatar then local path = "avatars/avatarcache/"..avatar if fileExists(path) then loadedTexture[player] = dxCreateTexture(path) else loadedTexture[player] = false end end end local avatar = loadedTexture[player] or tes.defaultAvatar dxSetShaderValue(tes.maskShader, "imageTexture", avatar) dxDrawImage(x * (1312/sx), y * (722/sy) + offsetY, x * (25/sx), y * (50/sy), tes.maskShader,0,0,0, tocolor(255,255,255,255*toptimes.progress), false) end Link to comment
Lachuks Posted September 16, 2019 Share Posted September 16, 2019 Move picture out of loop Link to comment
iiv03 Posted September 16, 2019 Author Share Posted September 16, 2019 (edited) 3 hours ago, Emix said: Move picture out of loop i did but not give one avatar pictures for i, player in ipairs(getElementsByType("player")) do local avatar = getElementData(player, "avatarHash") or false if (not loadedTexture[player]) then if avatar then local path = ":avatars/avatarcache/"..avatar if fileExists(path) then loadedTexture[player] = dxCreateTexture(path) else loadedTexture[player] = false end end end end local avatar = loadedTexture[player] or tes.defaultAvatar dxSetShaderValue(tes.maskShader, "imageTexture", avatar) dxDrawImage(x * (1312/sx), y * (722/sy) + offsetY, x * (25/sx), y * (50/sy), tes.maskShader,0,0,0, tocolor(255,255,255,255*toptimes.progress), false) in first code he was giving like this what's wrong? Edited September 16, 2019 by xFabel Link to comment
Lachuks Posted September 18, 2019 Share Posted September 18, 2019 I dont understan wut is ur problem. Explain please Link to comment
iiv03 Posted September 19, 2019 Author Share Posted September 19, 2019 (edited) On 18/09/2019 at 08:36, Emix said: I dont understan wut is ur problem. Explain please the problem is picture of the player comes alone and I do not want him like this I want to come one picture of the player i hope you understand me ^^ Edited September 19, 2019 by xFabel 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