megaman54 Posted April 8, 2011 Share 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)? Link to comment
Kenix Posted April 8, 2011 Share 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 Link to comment
megaman54 Posted April 8, 2011 Author Share 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 ? Link to comment
proracer Posted April 8, 2011 Share 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. Link to comment
Timic Posted April 8, 2011 Share 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 Link to comment
megaman54 Posted April 8, 2011 Author Share 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 Link to comment
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