Hi, I have trouble adding a log message in uppl:
local function cc_upplAdd( ply, command, argv )
if ply:IsValid() and not (ply:IsAdmin() or ply:IsSuperAdmin()) then
ULib.tsay( ply, "You are not an admin!" )
return
end
local err -- Check for errors
if #argv < 2 then
err = "You need at least two arguments for this command."
elseif not file.Exists( "../" .. argv[ 1 ] ) then
err = "That model (" .. argv[ 1 ] .. ") does not exist."
elseif not tonumber( argv[ 2 ] ) or tonumber( argv[ 2 ] ) < 0 then
err = "Invalid number for model " .. argv[ 1 ] .. " " .. argv[ 2 ]
end
if err then
if ply:IsValid() then
ULib.tsay( ply, err )
else
Msg( err .. "\n" )
end
return
end
-- Now we should be error free!
--I've just added this message:
ulx.logServAct( ply, "#A limited model '" .. argv[ 1 ] .. "' to " .. argv[ 2 ] .. " units per player." )
LimitModel( argv[ 1 ], tonumber( argv[ 2 ] ) )
end
concommand.Add( "uppl_add", cc_upplAdd )
But this silently crash the script. I've also tried a simple message ulx.logServAct( ply, "hello" )
What i do wrong ?