megaman54 Posted April 8, 2011 Posted April 8, 2011 How to make a /players command that shows list of players with their IP and ping in the server console (not ingame F8 console)?
Kenix Posted April 8, 2011 Posted April 8, 2011 How to make a /players command that shows list of players with their IP and ping in the server console (not ingame F8 console)? https://wiki.multitheftauto.com/wiki/OutputDebugString https://wiki.multitheftauto.com/wiki/GetPlayerPing https://wiki.multitheftauto.com/wiki/GetPlayerIP https://wiki.multitheftauto.com/wiki/AddCommandHandler
megaman54 Posted April 8, 2011 Author Posted April 8, 2011 https://wiki.multitheftauto.com/wiki/OutputDebugString https://wiki.multitheftauto.com/wiki/GetPlayerPing https://wiki.multitheftauto.com/wiki/GetPlayerIP https://wiki.multitheftauto.com/wiki/AddCommandHandler I know i must use those functions but HOW ?
proracer Posted April 8, 2011 Posted April 8, 2011 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.
Timic Posted April 8, 2011 Posted April 8, 2011 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
megaman54 Posted April 8, 2011 Author Posted April 8, 2011 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 and big thanks to proracer for this script! EDIT: outputConsole is for ingame console... outputServerLog is for server console i think
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now