Jump to content

Painel ao clicar no Ped


Recommended Posts

for i = 1, #peds do 
	ped = createPed(peds[i][1], peds[i][3], peds[i][4], peds[i][5]) 
	setElementRotation(ped, 0, 0, peds[i][6]) 
	setElementData(ped, "name", peds[i][2], true)
	setElementInterior (ped, 6)
	setElementDimension (ped, 90)
	setPedAnimation ( ped, "ped", "IDLE_CHAT", 1 )
end

function clickPed(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) 
	if (clickedElement) and (getElementType(clickedElement) == "ped" ) then 
        local x, y, z = getElementPosition(getLocalPlayer()) 
        local wx, wy, wz = getElementPosition(clickedElement) 
        local jij = getLocalPlayer() 
        if (getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=3) and (button == "left") and (state == "down" ) then              
			local ped = getElementData(clickedElement, "name") 
			if (ped=="John") then 
				Dx_Posto ()
			end
		end
	end
end 
addEventHandler("onClientClick", getRootElement(), clickPed, true) 

Bom eu coloquei isso, e está tudo funcional porém ao clicar no ped o painel "Dx_Posto" aparece e some no mesmo instante. Gostaria de solicitar ajuda.

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