General > Developers Corner

Gag & mute.

(1/1)

Spider:
I need a command that gags AND mutes the player with one command. I'm new to coding ulx, and this is what I came up with and it failed horribly.


--- Quote ---function ulx.mute2( calling_ply, target_plys )
   local affected_plys = {}

   for i=1, #target_plys do
      local v = target_plys[ i ]
      v:ConCommand:("ulx gag")
      v:ConCommand:("ulx mute")
   

   ulx.fancyLogAdmin( calling_ply, "#A gagged and muted #T!", command, target_plys )
end
local mute2= ulx.command( "Zero's Commands", "ulx mute2", ulx.mute2, "!mute2" )
mute2:defaultAccess( ULib.ACCESS_SUPERADMIN )
mute2:help( "Gags and mutes the target." )
--- End quote ---

My main problem is how to get the v:ConCommand("ulx gag") to target someone.

An Error Has Occurred!

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

[0] Board index

Go to full version