Jump to content

Problem whit Outputchatbox


'~DaLesTe^'

Recommended Posts

function keysCommand ( command, controlName ) 
    if not controlName then                    
        outputChatBox ( "Bind Incorreta", 255, 0, 0 ) 
        return 
    end 
    local keys = getBoundKeys ( controlName )  
    if not keys then                            
        outputChatBox ( "Nenhuma Bind Encontrada em: " .. controlName, 0,153,255, true) 
        return 
    end 
    outputChatBox ( "Bins Encontradas: " .. controlName .. ":", 0,153,255, true) 
    for keyName, state in pairs(keys) do 
        outputChatBox ( keyName, 0, 255, 0 ) 
    end 
end 
  
addCommandHandler ( "check", keysCommand ) 

Messages do not appear to all players, but as few as the player who entered.

I want works as follows: / check | PLAYER NAME | key

thus appear in chat "Binds found in the player: PlayerName ...

Help me please?

Link to comment
-- Serverside script 
local msg_red,msg_green,msg_blue = 255,255,0 
  
function servertalk(message, sendto) 
    outputChatBox(tostring(message), sendto, msg_red, msg_green, msg_blue, true) 
end 
  
function onJoin() 
    servertalk("Welcome to My Server " .. getPlayerName(source), getRootElement()) 
end 
  
addEventHandler("onPlayerJoin",getRootElement(),onJoin) 

Link to comment

If you want to check for a certain player, you'll need to include an extra parameter for that player's (partial) name. Then just use getPlayerFromPartialName to get the player element. You'll be better off making it server sided and possibly including some client events.

Link to comment
If you want to check for a certain player, you'll need to include an extra parameter for that player's (partial) name. Then just use getPlayerFromPartialName to get the player element. You'll be better off making it server sided and possibly including some client events.

I do not understand it: /

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