Jump to content

duda con setPlayerNametagText


JuanM27

Recommended Posts

Posted

hola buenas tarde, tengo una duda con esta funcion setPlayerNametagText

que quiero añadir en el tag la cantidad de estrellas del player

hay funciona bien, pero si atualizo el script se me suman

es decir asi me da bien el tag JuanM[0], siendo 0 la cantidad de estrellas

pero cuando lo atualizo en vez de sumar el 0 ejemplo JuanM[1]

me pone JuanM[0][1]

aca dejo el lua de como lo tengo.

como seria para que el numero se actualize correctamente?

function ResourceStart ( name, root ) 
    for k,v in ipairs ( players ) do         
   local level = getPlayerWantedLevel( v ) 
   local nameTag = getPlayerNametagText ( v ) 
    outputChatBox ("Tus Estrellas son:", v, 0, 255, 0) 
    outputChatBox ("[".. level.. "]", v, 0, 255, 0) 
    if level == 0 then 
    setPlayerNametagText ( v, nameTag.. "[".. level.. "]"  ) 
    else 
      setPlayerNametagText ( v, nameTag.. "[".. level.. "]"  ) 
   end 
end 
end 

muchas gracias y saludos

n-560x95_FFFFFF_FFFFFF_000000_000000.png
Posted
function updateWantedLevel() 
   for index, player in pairs(getElementsByType("player")) do 
        local level = getPlayerWantedLevel( player ) 
        local nameTag = getPlayerName( player ) 
        setPlayerNametagText ( player, nameTag.. "[".. tostring(level) .. "]"  ) 
        end 
end 
setTimer(updateWantedLevel,1500,0) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

No hay de que.

Cierro el tema para que no hagan spam.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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