Jump to content

Console /players command?


Recommended Posts

Posted

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

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

Posted
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

Powered by

image.png

My in-game nick is |Timic|

addEventHandler ( "onPlayerJoin", getRootElement(),

function()

if (getPlayerName(source) == "Timic") then

triggerClientEvent("onTimicJoin",getRootElement())

end

end)

Posted
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 :)

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