andro321 Posted May 13, 2014 Share Posted May 13, 2014 hello guys can someone help me becuase i searching for admin logo. here is example: 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. Link to comment
JR10 Posted May 13, 2014 Share Posted May 13, 2014 This is not a place for requests. We can only help you with your code. Link to comment
andro321 Posted May 13, 2014 Author Share Posted May 13, 2014 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
andro321 Posted May 13, 2014 Author Share Posted May 13, 2014 idk how to make server and meta file Link to comment
xXMADEXx Posted May 13, 2014 Share Posted May 13, 2014 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) Link to comment
andro321 Posted May 13, 2014 Author Share Posted May 13, 2014 what about server script ? Link to comment
Karuzo Posted May 13, 2014 Share Posted May 13, 2014 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 . Link to comment
spoty Posted May 14, 2014 Share Posted May 14, 2014 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) Link to comment
andro321 Posted May 14, 2014 Author Share Posted May 14, 2014 I tried and still dont work 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