Jump to content

Console /players command?


Recommended Posts

addCommandHandler ( 'pinfo',  
    function ( ) 
        for pID,pName in ipairs ( getElementsByType ( 'player' ) ) do 
            outputChatBox ( 'Player: ' .. getPlayerName ( pName ), source ) 
            outputChatBox ( 'IP: ' .. getPlayerIP ( pName ), source ) 
            outputChatBox ( 'Ping: ' .. tostring(getPlayerPing ( pName )), source ) -- maybe you dont need to use tostring but safety first  
        end 
    end)  

You can use the command with " / " or with ingame console.

Link to comment
addCommandHandler ( 'pinfo',  
    function ( ) 
        for pID,pName in ipairs ( getElementsByType ( 'player' ) ) do 
            outputChatBox ( 'Player: ' .. getPlayerName ( pName ), source ) 
            outputChatBox ( 'IP: ' .. getPlayerIP ( pName ), source ) 
            outputChatBox ( 'Ping: ' .. tostring(getPlayerPing ( pName )), source ) -- maybe you dont need to use tostring but safety first  
        end 
    end)  

You can use the command with " / " or with ingame console.

He means, to show this 'playerlist' in console, not in chatbox?

So you must put outputConsole instead of outputChatBox

Link to comment
addCommandHandler ( 'pinfo',  
    function ( ) 
        for pID,pName in ipairs ( getElementsByType ( 'player' ) ) do 
            outputChatBox ( 'Player: ' .. getPlayerName ( pName ), source ) 
            outputChatBox ( 'IP: ' .. getPlayerIP ( pName ), source ) 
            outputChatBox ( 'Ping: ' .. tostring(getPlayerPing ( pName )), source ) -- maybe you dont need to use tostring but safety first  
        end 
    end)  

You can use the command with " / " or with ingame console.

He means, to show this 'playerlist' in console, not in chatbox?

So you must put outputConsole instead of outputChatBox

Yea thats what i meant :D and big thanks to proracer for this script! :mrgreen:

EDIT: outputConsole is for ingame console... outputServerLog is for server console i think :)

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