mirror of
https://github.com/CFC-Servers/cfc_ulx_commands.git
synced 2025-03-04 03:13:28 -05:00
Fix console call error (#137)
* Fix console call error * Add empty friend tbl message * Check caller in receiver * Update lua/ulx/modules/sh/cfc_checkfriends.lua Co-authored-by: legokidlogan <26103433+legokidlogan@users.noreply.github.com> --------- Co-authored-by: legokidlogan <26103433+legokidlogan@users.noreply.github.com>
This commit is contained in:
parent
1b308c5f41
commit
48f59eecc1
@ -11,6 +11,18 @@ end
|
||||
local awaitingResponse = {}
|
||||
|
||||
local function sendResponse( ply, friendTable, caller )
|
||||
if not IsValid( caller ) then -- console
|
||||
print( "\n=======================" )
|
||||
print( ply:Name() .. "'s friends:" )
|
||||
print( "-----------------------" )
|
||||
for target, status in pairs( friendTable ) do
|
||||
print( target:Name() .. " : " .. status )
|
||||
end
|
||||
print( "=======================" )
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
caller:PrintMessage( 2, "\n=======================" )
|
||||
caller:PrintMessage( 2, ply:Name() .. "'s friends:" )
|
||||
caller:PrintMessage( 2, "-----------------------" )
|
||||
@ -26,6 +38,11 @@ net.Receive( "CFC_ULX_CheckFriendsReceive", function( _, ply )
|
||||
|
||||
local caller = awaitingResponse[ply]
|
||||
if table.IsEmpty( friendTable ) then
|
||||
if IsValid( caller ) then
|
||||
caller:PrintMessage( 2, ply:Name() .. " does currently not have any friends on the server." )
|
||||
else
|
||||
print( ply:Name() .. " does currently not have any friends on the server." )
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user