Jump to content

Ajuda com um resource aviso pff ._.


Recommended Posts

Posted

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

Posted

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 ) 

Posted

Vlwww manow mais ele preciza de cor para avisar queria saber se tem como faser pelo ID ou pelo nome sem código? mais obrrrrrrrrrrrrrrrrrrrrrrrrrrgado msm assim

Posted

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 ) 

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