General > Developers Corner

Ulx Silent Echo

(1/2) > >>

Toxic_Terrorists:
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: ---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." )
--- End code ---

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

Can it be changed to use:
            self.Owner:ChatPrint("")

XxLMM13xX:
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

[0] Board index

Go to full version