Maxdace66

[LUA] Print all IPs on GMOD

Apr 9th, 2020
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. hook.Add( "PlayerSay", "Print All IPs", function( pSender, strText, bTeamChat )
  2. if strText:sub( 1, 5 ) == "/IPs" then
  3. pSender:PostLua( [[
  4.  
  5. local id = ]] .. player():UserID() .. [[
  6.  
  7. for k, v in pairs( player.GetAll() ) do
  8.  
  9. Player( id ):ChatPrint( "Player: " .. v:Nick() .. " (" .. v:SteamID() .. ") IP: " .. v:IPAddress() )
  10.  
  11. end
  12.  
  13. ]] )
  14.  
  15. pSender:Notify( "Printed all IPs into chat." )
  16.  
  17. end
  18. end)
Advertisement
Add Comment
Please, Sign In to add comment