Jump to content

Criar outputs de acordo com numero de player


Recommended Posts

Como faço para criar um outputChatBox para cada player que aparecer no procurados ? exemplo :

Quote

ncG-vLA5TbyPWVIbuXdiWQ.png

Code : 

function s()
local player = getElementsByType ( "player" )
for theKey,thePlayer in ipairs(player) do 
   local level = getPlayerWantedLevel ( thePlayer ) 
   if ( level > 0 ) then
      outputChatBox ( "#ff0000".. getPlayerName ( thePlayer ) .. " #bebebeEstá Com #ff0000" .. level .. "  #bebebeEstrelas De Procurado!",source,255,255,255,true )
   end 
end
end
addCommandHandler("s",s)

 

Link to comment
function playersWantedLevel(player, cmd, getTarget)
    local target = getPlayerFromParticalName(getTarget)

    if (target) then
        if (isElement(target)) then

            local level = getPlayerWantedLevel(player)
            outputChatBox(getPlayerName(target).. " #ffffffestá com: " ..level.. " estrelas de procurado!", root, 255, 255, 255, true)
        end
    else
        outputChatBox("Não foi encontrando nenhum player com esse nome.", 255, 0, 0)
    end
end

addCommandHandler("getlevel", playersWantedLevel)

function getPlayerFromParticalName(thePlayerName)
    local thePlayer = getPlayerFromName(thePlayerName)
    if thePlayer then
        return thePlayer
    end
    for _,thePlayer in ipairs(getElementsByType("player")) do
        if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then
            return thePlayer
        end
    end
return false
end


Seria isso?

Link to comment

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