Jump to content

[Request]Admin logo


Recommended Posts

Posted

hello guys can someone help me becuase i searching for admin logo.

here is example:

aadssaasd.png

you can see admin and picture on head... and i want this picture to be shown only for admins..

if someone can help me i really need it.

Posted

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

hZ = hZ + 0.5

local pX,pY,pZ = getPedBonePosition(localPlayer, 8)

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)

Posted

meta.xml:

<meta> 
    <script src="client.lua" type="client" /> 
</meta> 

client.lua:

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

Posted

There is none, ofcourse only if you want to do that with teams only.

If you want to use with acl you could set an element data to check if he's an admin .

Posted

here this is what you need

Meta

    

Client Side

  
  
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) 

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