Jump to content

Score Help


Daniel1zD

Recommended Posts

tengo un problema no sale la imagen en el score no se cual es el problema por favor ayuda solo se crea el espacio en el score pero no aparese nada mas

:cry::cry::cry:

function medalla() 
setElementData ( player, "rango", "imajen/1.png" ) 
setElementData ( player, "rango", "imajen/1.png" ) 
end 
  
addCommandHandler ( "giverango", medalla ) 
  
function onPlayerQuit ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
           local imajen = getElementData(source,"Rango") 
            setAccountData ( playeraccount, "Rango", imajen ) 
      end 
end 
  
function onPlayerLogin ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            local imajen = getAccountData ( playeraccount, "Rango" ) 
            if ( imajen ) then 
            setElementData ( source, "Rango", imajen ) 
            end 
      end 
end 
  
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerLogout", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin ) 
  
exports.scoreboard:addScoreboardColumn('Rango',getRootElement(),1,70,'Rango') 

Link to comment
  • MTA Team

No defines Player..Además usas un Element Data incorrecto:

PD:Modifique un poco tu script para hacerlo mas funcional..

function medalla(_,_,quien,medalla) 
local rango = tonumber(medalla) 
local destino = getPlayerFromNamePart(quien) 
setElementData ( destino, "Rango", "imajen/".. rango..".png" ) 
end 
 --El comando seria /giverango [PARTEDELNOMBRE] [N° DE MEDALLA] 
addCommandHandler ( "giverango", medalla ) 
  
--Utiles 
function getPlayerFromNamePart(name) 
    local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil 
    if name then 
        for _, player in ipairs(getElementsByType("player")) do 
            local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() 
            if name_:find(name, 1, true) then 
                return player 
            end 
        end 
    end 
end 
-- 
  
function onPlayerQuit ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
           local imajen = getElementData(source,"Rango") 
            setAccountData ( playeraccount, "Rango", imajen ) 
      end 
end 
  
function onPlayerLogin ( ) 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            local imajen = getAccountData ( playeraccount, "Rango" ) 
            if ( imajen ) then 
            setElementData ( source, "Rango", imajen ) 
            end 
      end 
end 
  
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerLogout", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin ) 
  
exports.scoreboard:addScoreboardColumn('Rango',getRootElement(),1,70,'Rango') 

Link to comment
  • MTA Team
a hora aparese el nombre dela carpeta dela imajen y el nombre dela imajen pero no se muestra la imajen :c

Debes editar el resource del scoreboard en dxscoreboard_client.lua para que acepte imagenes..Hay varios topics en el foro de como hacerlo..

Suerte!

PD: Tu script se parece bastante al script beta que hize para PDz..Y que luego se distribuyo sin mi permiso.. xD

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...