Author Topic: Ulx Silent Echo  (Read 3426 times)

0 Members and 1 Guest are viewing this topic.

Offline Toxic_Terrorists

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
Ulx Silent Echo
« on: February 28, 2015, 08:34:30 AM »
Is there a way to change a ulx Silent echo to show up only for the person that did the command?

The command in question is:
Code: [Select]
if (SERVER) then

util.AddNetworkString("target_ply")
    util.AddNetworkString("friendlist")

    net.Receive( "friendlist", function(len, ply)
            local friends = net.ReadTable()
            local friendstring = table.concat(  friends, ", " )
            ulx.fancyLogAdmin( nil, true,  "#T is friends with: #s ", ply, friendstring )
    end)
end
if CLIENT then
    net.Receive("friendlist", function()
                local friends = {}
                for k, v in pairs(player.GetAll()) do
                        if v:GetFriendStatus() == "friend" then
                            table.insert( friends, v:Nick() )
                            end
                end
                net.Start("friendlist")
                   net.WriteTable(friends)
                net.SendToServer()
    end)
end


function ulx.listfriends(calling_ply, target_ply)

        net.Start("friendlist")
        net.Send(target_ply)
end
local listfriends = ulx.command("Essentials", "ulx listfriends", ulx.listfriends, "!friends",true)
listfriends:addParam{ type=ULib.cmds.PlayerArg }
listfriends:defaultAccess( ULib.ACCESS_ADMIN )
listfriends:help( "Check for friends playing on the server." )

Instead of:
            ulx.fancyLogAdmin( nil, true,  "#T is friends with: #s ", ply, friendstring )

Can it be changed to use:
            self.Owner:ChatPrint("")
« Last Edit: February 28, 2015, 08:48:47 AM by Toxic_Terrorists »

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Re: Ulx Silent Echo
« Reply #1 on: March 02, 2015, 03:00:23 PM »
Did you try it? Did you get any errors if you did?

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given