Jump to content

problem with loop player


iiv03

Recommended Posts

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
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)

tdvS7jW.png

in first code he was giving like this

rJFWXmH.png

what's wrong?

 

Edited by xFabel
Link to comment
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 by xFabel
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...