Advertisement
Guest User

Untitled

a guest
Aug 28th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.71 KB | None | 0 0
  1. if (SERVER) then
  2.  
  3.     util.AddNetworkString("target_ply")
  4.     util.AddNetworkString("friendlist")
  5.  
  6.     net.Receive( "friendlist", function(len, ply)
  7.             local friends = net.ReadTable()
  8.             local friendstring = table.concat(  friends, ", " )
  9.             ulx.fancyLogAdmin( nil, true,  "#T is friends with: #s ", ply, friendstring )
  10.     end)
  11. end
  12. if CLIENT then
  13.     net.Receive("friendlist", function()
  14.                 local friends = {}
  15.                 for k, v in pairs(player.GetAll()) do
  16.                         if v:GetFriendStatus() == "friend" then
  17.                             table.insert( friends, v:Nick() )
  18.                             end
  19.                 end
  20.                 net.Start("friendlist")
  21.                    net.WriteTable(friends)
  22.                 net.SendToServer()
  23.     end)
  24. end
  25.  
  26.  
  27. function ulx.listfriends(calling_ply, target_ply)
  28.  
  29.         net.Start("friendlist")
  30.         net.Send(target_ply)
  31. end
  32. local listfriends = ulx.command("Moderator", "ulx listfriends", ulx.listfriends, "!friends",true)
  33. listfriends:addParam{ type=ULib.cmds.PlayerArg }
  34. listfriends:defaultAccess( ULib.ACCESS_ADMIN )
  35. listfriends:help( "Check for friends playing on the server." )
  36.  
  37. function ulx.profile(calling_ply, target_ply)
  38.  
  39.     net.Start("target_ply")
  40.         net.WriteEntity(target_ply)
  41.     net.Send(calling_ply)
  42.    
  43.     calling_ply:SendLua([[
  44.             net.Receive("target_ply", function( len )
  45.                 local targ_pl = net.ReadEntity()
  46.                 targ_pl:ShowProfile()
  47.             end)
  48.     ]])
  49.  
  50. end
  51. local profile = ulx.command("Moderator", "ulx profile", ulx.profile, "!profile",true)
  52. profile:addParam{ type=ULib.cmds.PlayerArg }
  53. profile:defaultAccess( ULib.ACCESS_ADMIN )
  54. profile:help( "Opens a link to the target's steam profile." )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement