MildaBegginer Posted May 15, 2014 Share Posted May 15, 2014 plz help me he script doesn't work imgW = 500 imgH = 90 function adminLogo() local players = getPlayersInTeam(getTeamFromName("Admin")) for i,player in ipairs(players) do if player ~= localPlayer then local cX, cY, cZ = getCameraMatrix() local hX, hY, hZ = getPedBonePosition(player, hZ = hZ + 0.5 local pX,pY,pZ = getPedBonePosition(localPlayer, pZ = pZ + 0.5 if getScreenFromWorldPosition(hX, hY, hZ) and isLineOfSightClear(cX,cY,cZ, pX,pY,pZ) then local sX, sY, sD = getScreenFromWorldPosition(hX, hY, hZ) local relative = (50 - sD) / 50 if relative > 0 then local iW = imgW * relative local iH = imgH * relative local iX = sX - (iW / 2) local iY = sY - (iH / 2) dxDrawImage(iX, iY, iW, iH, "admin.png") end end end end end addEventHandler("onClientRender", root, adminLogo) Link to comment
rpgforlife Posted May 16, 2014 Share Posted May 16, 2014 This one works for me. Try it (its client side) imgW = 250 imgH = 90 function adminLogo() local players = getPlayersInTeam(getTeamFromName("Admin")) for i,player in ipairs(players) do if player ~= localPlayer then local cX, cY, cZ = getCameraMatrix() local hX, hY, hZ = getPedBonePosition(player, -- s8) --> hZ = hZ + 1.0 local pX,pY,pZ = getPedBonePosition(localPlayer, -- s8) --> pZ = pZ + 1.0 if getScreenFromWorldPosition(hX, hY, hZ) and isLineOfSightClear(cX,cY,cZ, pX,pY,pZ) then local sX, sY, sD = getScreenFromWorldPosition(hX, hY, hZ) local relative = (50 - sD) / 50 if relative > 0 then local iW = imgW * relative local iH = imgH * relative local iX = sX - (iW / 2) local iY = sY - (iH / 2) dxDrawImage(iX, iY, iW, iH, "admin.png") end end end end end addEventHandler("onClientRender", root, adminLogo) 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