Advertisement
Guest User

Untitled

a guest
Aug 28th, 2014
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.15 KB | None | 0 0
  1. if (SERVER) then
  2.     util.AddNetworkString("friendlist")
  3.  
  4.     net.Receive( "friendlist", function(len, ply)
  5.             local friends = net.ReadTable()
  6.             local friendstring = table.concat(  friends, ", " )
  7.             ulx.fancyLogAdmin( nil, true,  "#T is friends with: #s ", ply, friendstring )
  8.     end)
  9. end
  10. if CLIENT then
  11.     net.Receive("friendlist", function()
  12.                 local friends = {}
  13.                 for k, v in pairs(player.GetAll()) do
  14.                         if v:GetFriendStatus() == "friend" then
  15.                             table.insert( friends, v:Nick() )
  16.                             end
  17.                 end
  18.                 net.Start("friendlist")
  19.                    net.WriteTable(friends)
  20.                 net.SendToServer()
  21.     end)
  22. end
  23.  
  24.  
  25. function ulx.listfriends(calling_ply, target_ply)
  26.  
  27.         net.Start("friendlist")
  28.         net.Send(target_ply)
  29. end
  30. local listfriends = ulx.command("Moderator", "ulx listfriends", ulx.listfriends, "!friends",true)
  31. listfriends:addParam{ type=ULib.cmds.PlayerArg }
  32. listfriends:defaultAccess( ULib.ACCESS_ADMIN )
  33. listfriends:help( "Check for friends playing on the server." )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement