Advertisement
quintosh

Untitled

Jun 7th, 2012
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. -- Todo:
  2. -- add string.find check so it doesn't add the same nick for the same SID more than once
  3. -- workaround for PlayerAuthed hook (or replace with a timer once ^ works)
  4.  
  5.  
  6. function DumpSIDs()
  7. local SIDs = {}
  8.    for k, v in pairs(player.GetAll()) do
  9.       if ValidEntity(v) then
  10.          table.insert(SIDs, v:Nick() .. v:SteamID())
  11.    for k1, v1 in pairs(player.GetAll()) do
  12.     if ValidEntity(v) then
  13.       if !file.Exists("logs/SIDs.txt") then
  14.       file.Write("logs/SIDs.txt", "[" ..v:Nick() .. "]" .. ":" .. v:SteamID() .. "\n" )
  15.    else
  16.       filex.Append("logs/SIDs.txt", "[" ..v:Nick() .. "]" .. ":" .. v:SteamID() .. "\n" )
  17.                end
  18.             end
  19.          end
  20.       end
  21.    end
  22. end
  23.  
  24. local Target
  25.  
  26. concommand.Add("getSIDs", DumpSIDs)
  27. concommand.Add("sid", function()
  28.    for k, v in pairs(player.GetAll()) do
  29.       if ValidEntity(v) then
  30.          if string.match(v:Nick() .. v:SteamID(), SIDs) then
  31.             Target = v
  32.          end
  33.       end
  34.    end
  35.    SetClipboardText(Target)
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement