Jump to content

Ajuda com um resource aviso pff ._.


Recommended Posts

olha aqui da erro nela alguem pode me ajudar queria faser um resource com o comando de /avisar

  
addCommandHandler ( "aviso", aviso ) 
function aviso (theAdmin) 
    outputChatBox ('#00FFFF' .. getPlayerName(thePlayer) .. ' #828282Você foi avisado pelo #FFFFFF(#00FF00getAdminName(theAdmin)#FFFFFF  Motivo:getMotivo(theMotivo) )', root, 255, 255, 255, true) 
end 
  
  
  

obrigado

Link to comment

Tenta isso

function aviso ( theAdmin, _, thePlayer, ... ) 
    local thePlayer = getPlayerFromName ( thePlayer ) 
    local motivo = table.concat ( { ... }, ' ' ) 
    if ( thePlayer and ... ) then 
        outputChatBox ( '#00FFFF' .. getPlayerName ( thePlayer ) .. ' #828282Você foi avisado pelo #FFFFFF(#00FF00' .. getPlayerName ( theAdmin ) .. '#FFFFFF)  Motivo: ' .. motivo, thePlayer, 255, 255, 255, true ) 
    else 
        outputChatBox ( '/aviso ', theAdmin, 255, 0, 0 ) 
    end 
end 
addCommandHandler ( 'aviso', aviso ) 

Link to comment

Assim?

function getPlayerFromNamePart ( name ) 
    if ( name ) then  
        for _, player in ipairs ( getElementsByType ( "player" ) ) do 
            if ( string.find ( string.gsub ( getPlayerName ( player ) : lower ( ), "#%x%x%x%x%x%x", "" ), tostring ( name ) : lower ( ), 1, true ) ) then 
                return player  
            end 
        end 
    end 
    return false 
end 
  
function aviso ( theAdmin, _, thePlayer, ... ) 
    local thePlayer = getPlayerFromNamePart ( thePlayer ) 
    local motivo = table.concat ( { ... }, ' ' ) 
    if ( thePlayer and ... ) then 
        outputChatBox ( '#00FFFF' .. getPlayerName ( thePlayer ) .. ' #828282Você foi avisado pelo #FFFFFF(#00FF00' .. getPlayerName ( theAdmin ) .. '#FFFFFF)  Motivo: ' .. motivo, thePlayer, 255, 255, 255, true ) 
    else 
        outputChatBox ( '/aviso ', theAdmin, 255, 0, 0 ) 
    end 
end 
addCommandHandler ( 'aviso', aviso ) 

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