ULX

Author Topic: Silent Slay  (Read 1216 times)

0 Members and 1 Guest are viewing this topic.

Offline KewlerGames

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Silent Slay
« on: December 21, 2017, 11:52:26 AM »
This sub-forum is only for help or discussion regarding projects created by Team Ulysses. If you are requesting help, please search the forums FIRST to make sure your question has not already been answered. If you still need help, fill in the following information.

My ULib/ULX versions (run "ulx version" in console):
ULib v2.63d (10/9/17)
ULX v3.73 (11/05/17)

Game mode(s) I am having this problem on:
I believe its every gamemode
Lua errors shown in console, if any:
Code: [Select]
function ulx.sslay( calling_ply, target_plys )
local affected_plys = {}

for i=1, #target_plys do
local v = target_plys[ i ]

if ulx.getExclusive( v, calling_ply ) then
ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
elseif not v:Alive() then
ULib.tsayError( calling_ply, v:Nick() .. " is already dead!", true )
elseif v:IsFrozen() then
ULib.tsayError( calling_ply, v:Nick() .. " is frozen!", true )
else
if v:InVehicle() then
v:ExitVehicle()
end

v:KillSilent()
table.insert( affected_plys, v )
end
end

ulx.fancyLogAdmin( calling_ply, "#A silently slayed #T", affected_plys )
end
local sslay = ulx.command( CATEGORY_NAME, "ulx sslay", ulx.sslay, "!sslay" )
sslay:addParam{ type=ULib.cmds.PlayersArg }
sslay:defaultAccess( ULib.ACCESS_ADMIN )
sslay:help( "Silently slays target(s)." )
And it displays to everyone in chat cause I want things like bring and goto display so I don't want to disable everything so is there a way to make it so that itll be silent without turning off all ulx notifications or hopefully make it so that only Admins+ can see it?