Szerző Téma: Nametag HELP!  (Megtekintve 1033 alkalommal)

Nametag HELP!
« Dátum: 2015. május 09. - 20:59:06 »
0 Show voters
Sziasztok az a problémám hogy mikor felrakom a jelvényt akkor nem írja ki a nevem felett hogy pl: Rendőrség - Kadét.Na ezt hogy lehet megoldani?
local nametags = { }
local _max_distance = 120
local _min_distance = 7.5
local _alpha_distance = 20
local _nametag_alpha = 170
local _bar_alpha = 120
local _scale = 0.2
local _nametag_textsize = 1
local _chatbubble_size = 15
local _bar_width = 35
local _bar_height = 5
local _bar_border = 1.2
local nevekbe = true
local _, screenY = guiGetScreenSize( )
real_scale = screenY / ( _scale * 800 )
real_scale2 = screenY / ( 1 * 800 )
local _alpha_distance_diff = _max_distance - _alpha_distance
local localPlayer = getLocalPlayer( )
local FONT = dxCreateFont (\"myriadproregular.ttf\",10)
addEventHandler( \'onClientRender\', root,
function( )
if nevekbe then
   local cx, cy, cz = getCameraMatrix( )
   local dimension = getElementDimension( localPlayer )
   local interior = getElementInterior( localPlayer )
   local localPlayer = getLocalPlayer( )
   for player, chaticon in pairs( nametags ) do
      if isElement( player ) then
         local dbid = tonumber(getElementData(player, \"dbid\"))
         local id = tonumber(getElementData(player, \"playerid\"))
         local dbid2 = tonumber(getElementData(player, \"dbid\"))
         local admintitle = exports.rp_core:getPlayerAdminTitle(player)
         local theTeam = getTeamName(getPlayerTeam(player))
         local ismer1 = true
         local TV = getElementData(player, \"reconx\") or false
         local Freecam = getElementData(player, \"freecam:state\") or false
         local duty = getElementData(player, \"duty\")
         if not TV and not Freecam then
            local adminduty = getElementData(player, \"adminduty\")
            local adminnick = getElementData(player, \"anick\") or getPlayerName(player)
            if getElementDimension( player ) == dimension and getElementInterior( player ) == interior and isElementOnScreen( player ) and (ismer1 == true or adminduty == 1) then
               local px, py, pz = getElementPosition( player )
               local distance = getDistanceBetweenPoints3D( px, py, pz, cx, cy, cz )
               local maxdist = 30
               if adminduty == 1 then
                  maxdist = 120
               end
               if distance <= maxdist then
                  local dz = 0.9
                  pz2 = pz
                  pz = pz + dz
                  local sx, sy = getScreenFromWorldPosition( px, py, pz )
                  if sx and sy then
                     local cx = sx
                     distance = math.max( distance, _min_distance )
                     local nametag_alpha = 255
                     local scale = 30 / ( real_scale2 * (distance + 20) )
                  if (adminduty==1) then
                     dxDrawText( \"#e7d9b0(\" .. id .. \") \" .. adminnick .. \"#00ced1(\" .. admintitle .. \")\", sx, sy, sx, sy, tocolor( 0, 0, 0, 180 ), scale, FONT, \'center\', \'bottom\', false, true, false, true )
                     dxDrawText( \"#e7d9b0(\" .. id .. \") \" .. adminnick .. \"#00ced1(\" .. admintitle .. \")\", sx, sy, sx, sy, tocolor( 255, 230, 157, nametag_alpha ), scale, FONT, \'center\', \'bottom\', false, true, false, true )
                  elseif (duty==1) then
                     dxDrawText( \"#e7d9b0(\" .. id .. \") \" .. getPlayerNametagText( player ) .. \"#00ced1(\" .. theTeam .. \")\", sx, sy, sx, sy, tocolor( 0, 0, 0, 180 ), scale, FONT, \'center\', \'bottom\', false, true, false, true )
                     dxDrawText( \"#e7d9b0(\" .. id .. \") \" .. getPlayerNametagText( player ) .. \"#00ced1(\" .. theTeam .. \")\", sx, sy, sx, sy, tocolor( 255, 230, 157, nametag_alpha ), scale, FONT, \'center\', \'bottom\', false, true, false, true )
                  else
                     dxDrawText(\"(\" .. id .. \") \" .. getPlayerNametagText( player ) .. \"\", sx, sy, sx, sy-0.5, tocolor( 0, 0, 0, 180 ), scale + 0.03, FONT, \'center\', \'bottom\' )
                     dxDrawText(\"#e7d9b0(\" .. id .. \") \" .. getPlayerNametagText( player ) .. \"\", sx, sy, sx, sy, tocolor( 255, 255, 255, nametag_alpha ), scale, FONT, \'center\', \'bottom\', false, true, false, true )
                  end
                  end
               end
            end -- VĂ©ge
         end
      end
   end
end
end
)
addEventHandler( \'onClientResourceStart\', getResourceRootElement( ),
function( )
for _, player in pairs( getElementsByType( \"player\" ) ) do
   if player ~= localPlayer then
      setPlayerNametagShowing( player, false )
      if isElementStreamedIn( player ) then
         nametags[ player ] = false
      end
   end
end
end
)
addEventHandler( \'onClientResourceStop\', getResourceRootElement( ),
function( )
for player in pairs( nametags ) do
   setPlayerNametagShowing( player, true )
   nametags[ player ] = nil
end
end
)
addEventHandler ( \'onClientPlayerJoin\', root,
function( )
setPlayerNametagShowing( source, false )
end
)
addEventHandler ( \'onClientElementStreamIn\', root,
function( )
if source ~= localPlayer and getElementType( source ) == \"player\" then
   nametags[ source ] = false
   triggerServerEvent( \"nametags:chatbubble\", source )
end
end
)
addEventHandler ( \'onClientElementStreamOut\', root,
function( )
if nametags[ source ] then
   nametags[ source ] = nil
end
end
)
addEventHandler ( \'onClientPlayerQuit\', root,
function( )
if nametags[ source ] then
   nametags[ source ] = nil
end
end
)

Nametag HELP!
« Válasz #1 Dátum: 2015. május 10. - 09:59:49 »
0 Show voters
X,Y,Z koordinátákat megkell adni hogy hol legyen a fejed felett elvileg...

Nametag HELP!
« Válasz #2 Dátum: 2015. május 10. - 10:18:40 »
0 Show voters
Ezt hol találtad? Melyik mappában ?
mert ez érdekes ötlet lenne amúgy

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal