• Print

Author Topic: Denying Echoes To Others  (Read 6245 times)

0 Members and 1 Guest are viewing this topic.

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Denying Echoes To Others
« on: October 13, 2015, 08:27:31 pm »
I run a Garry's Mod server using ULX and ULib and on it me and my friends play a lot of TTT. Ive set up a working set of commands that work and function fine, but what Im wondering is that is there a way I can keep seeing all echoes from me/others (WispySkies set the hp of NAME to 1 vice versa) but when I perform a command the !COMMAND and the "WispySkies gave NAME x credits." is not visible to anyone (including superadmins, which is me as well, possible conflict?).

Thanks for any help you guys can give!

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Denying Echoes To Others
« Reply #1 on: October 13, 2015, 08:43:27 pm »
This would probably better fit in developers corner, as it's not directly asking for help with ULX usage, so, I'm moving it after I post.
Our ulx.command object has additional parameters not commonly used. One of those is a boolean to hide the say command.

Our function set-up;
function ulx.command( category, command, fn, say_cmd, hide_say, nospace )

So when setting up your commands, use;
local obj = ulx.command ( "My Category", "ulx blah", my_funcnameblah, "!my_say", true )
And that will prevent your say commands from showing in chat if no other conflicts occur/chat text code returns the text.
« Last Edit: October 13, 2015, 08:46:45 pm by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Denying Echoes To Others
« Reply #2 on: October 14, 2015, 03:56:02 am »
Since I just fully suck at Lua how would you implement that? I probably sound really stupid .-.

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Denying Echoes To Others
« Reply #3 on: October 14, 2015, 04:19:41 am »
One more thing as well, would I have to add that line through every function? Because I meant it for EVERY command that I do and I'd rather not mess around with the original ULX code. Is it possible to still hide the !COMMAND and "WispySkies set the HP of SOMEONE to 1" but just have a script in what I would think to be in C:/garrysmod/addons/ulx/lua/ulx/modules/sh/FILES.lua that automatically does that without changing all the other code?

Offline Storm

  • Full Member
  • ***
  • Posts: 220
  • Karma: 4
Re: Denying Echoes To Others
« Reply #4 on: October 14, 2015, 09:49:12 am »
Can we do an example? I would like to know this too. So using ulx blind,


function ulx.blind( calling_ply, target_plys, amount, should_unblind )
   for i=1, #target_plys do
      local v = target_plys[ i ]
      umsg.Start( "ulx_blind", v )
         umsg.Bool( not should_unblind )
         umsg.Short( amount )
      umsg.End()
.
.
.
.

local blind = ulx.command( CATEGORY_NAME, "ulx blind", ulx.blind, "!blind")

So how would you change this so the echo never shows,even when logecho is on?

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Denying Echoes To Others
« Reply #5 on: October 14, 2015, 10:57:22 am »
JamminR, thoughts?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Denying Echoes To Others
« Reply #6 on: October 14, 2015, 03:15:16 pm »
Wispy, no need to rush for my thoughts. You and I are likely world time zones apart, and I'm not available here during weekdays GMT-5 from 23:45 to at least 18:00, and often much later.

There is no way to stop all ulx commands from echoing the chat portion.
I thought you were talking about commands you created, that you made.

Though you could disable echo mode in ULX settings, anyone using commands chat could still be seen saying "!blah".
You'd have to teach your admins/etc to use game console "ulx blah" in combo with echo off.
Logging would still occur.

local blind = ulx.command( CATEGORY_NAME, "ulx blind", ulx.blind, "!blind")

So how would you change this so the echo never shows,even when logecho is on?
You can't. You could only prevent the person using the chat command from being seen saying it. You'd still require echo being off to prevent echo of actions taken.
local blind = ulx.command( CATEGORY_NAME, "ulx blind", ulx.blind, "!blind", true)



« Last Edit: October 14, 2015, 03:19:27 pm by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Denying Echoes To Others
« Reply #7 on: October 14, 2015, 04:46:58 pm »
Sorry about that, I did not intend to rush you. Ill try that thanks! Although I was talking about both commands I made, etc. Storm, after looking at this that will work for you. Just when in game create a new group, not inherited from SA and then give it every command except the ULX Echo.

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Denying Echoes To Others
« Reply #8 on: October 14, 2015, 05:01:53 pm »
Yay! It works! Just one thing, Ive looked through the  code and when giving/revoking permissions it says some are _Uncategorized so can you look through the code and tell me whats wrong? I didnt notice anything fishy :/

Code: Lua
  1. local CATEGORY_NAME = "TTT Admin"
  2. local gamemode_error = "You are currently not playing TTT!"
  3.  
  4. function ulx.tttsetup( calling_ply, command )
  5.                 game.ConsoleCommand( "ttt_detective_min_players 1\n" )
  6.                 game.ConsoleCommand( "ttt_detective_max 1\n" )
  7.                 game.ConsoleCommand( "ttt_detective_pct .5\n" )
  8.                 game.ConsoleCommand( "ttt_haste 20\n" )
  9.                 game.ConsoleCommand( "ttt_traitor_max 1\n" )
  10.                 game.ConsoleCommand( "ttt_traitor_pct .5\n" )
  11.                 game.ConsoleCommand( "ttt_round_limit 6969\n" )
  12.                 game.ConsoleCommand( "ttt_preptime_seconds 15\n" )
  13.                 game.ConsoleCommand( "jihad_difsound 1\n" )
  14.                 game.ConsoleCommand( "ttt_ragdoll_pinning_innocents 1\n" )
  15. end
  16.  
  17. local ecvar = ulx.command( CATEGORY_NAME, "ulx ecvar", ulx.tttsetup, "!ecvar", true )
  18. ecvar:defaultAccess ( ULib.ACCESS_SUPERADMIN )
  19. ecvar:help( "Sets up convar's for Trouble In Terrorist Town." )
  20.  
  21. -- Adds TTT Roles
  22. ulx.target_role = {}
  23. function updateRoles()
  24.         table.Empty( ulx.target_role )
  25.            
  26.     table.insert(ulx.target_role,"traitor")
  27.     table.insert(ulx.target_role,"detective")
  28.     table.insert(ulx.target_role,"innocent")
  29. end
  30. hook.Add( ULib.HOOK_UCLCHANGED, "ULXRoleNamesUpdate", updateRoles )
  31. updateRoles()
  32.  
  33. -- Slay Next Round
  34. function ulx.slaynr( calling_ply, target_ply, num_slay, should_slaynr )
  35.         if not GetConVarString("gamemode") == "terrortown" then ULib.tsayError( calling_ply, gamemode_error, true ) else
  36.                 local affected_plys = {}
  37.                 local slays_left = tonumber(target_ply:GetPData("slaynr_slays")) or 0
  38.                 local current_slay
  39.                 local new_slay
  40.            
  41.        
  42.                 if ulx.getExclusive( target_ply, calling_ply ) then
  43.                         ULib.tsayError( calling_ply, ulx.getExclusive( target_ply, calling_ply ), true )
  44.                 elseif num_slay < 0 then
  45.                         ULib.tsayError( calling_ply, "Invalid integer:\"" .. num_slay .. "\" specified.", true )
  46.                 else
  47.                         current_slay = tonumber(target_ply:GetPData("slaynr_slays")) or 0
  48.                         if not should_slaynr then      
  49.                 new_slay = current_slay + num_slay  
  50.             else
  51.                 new_slay = current_slay - num_slay     
  52.             end
  53.  
  54.                         if new_slay > 0 then           
  55.                 target_ply:SetPData("slaynr_slays", new_slay)
  56.             else
  57.                                 target_ply:RemovePData("slaynr_slays")
  58.             end
  59.  
  60.                 local slays_left        = tonumber(target_ply:GetPData("slaynr_slays"))  or 0
  61.                         local slays_removed = ( current_slay - slays_left )             or 0
  62.  
  63.                         if slays_removed==0 then
  64.                                 chat_message = ("#T will not be slain next round.")
  65.                         elseif slays_removed > 0 then
  66.                                 chat_message = ("#A removed ".. slays_removed .." round(s) of slaying from #T.")
  67.                         elseif slays_left == 1 then
  68.                                 chat_message = ("#A will slay #T next round.")
  69.                         elseif slays_left > 1 then
  70.                                 chat_message = ("#A will slay #T for the next ".. tostring(slays_left) .." rounds.")
  71.                         end
  72.                         ulx.fancyLogAdmin( calling_ply, chat_message, target_ply, reason )
  73.                 end
  74.         end
  75. end
  76. local slaynr = ulx.command( CATEGORY_NAME, "ulx slaynr", ulx.slaynr, "!slaynr" )
  77. slaynr:addParam{ type=ULib.cmds.PlayerArg }
  78. slaynr:addParam{ type=ULib.cmds.NumArg, max=100, default=1, hint="rounds", ULib.cmds.optional, ULib.cmds.round }
  79. slaynr:addParam{ type=ULib.cmds.BoolArg, invisible=true }
  80. slaynr:defaultAccess( ULib.ACCESS_SUPERADMIN )
  81. slaynr:help( "Slays target(s) for a number of rounds" )
  82. slaynr:setOpposite( "ulx rslaynr", {_, _, _, true}, "!rslaynr" )
  83.  
  84. -- Forced Role
  85. function ulx.force( calling_ply, target_plys, target_role, should_silent )
  86.         if not GetConVarString("gamemode") == "terrortown" then ULib.tsayError( calling_ply, gamemode_error, true ) else
  87.  
  88.                 local affected_plys = {}
  89.                 local starting_credits=GetConVarNumber("ttt_credits_starting")
  90.  
  91.                 local role
  92.                 local role_grammar
  93.                 local role_string
  94.                 local role_credits
  95.  
  96.             if target_role ==  "traitor"   or target_role == "t" then role, role_grammar, role_string, role_credits = ROLE_TRAITOR,   "a ",  "traitor",   starting_credits end
  97.             if target_role ==  "detective" or target_role == "d" then role, role_grammar, role_string, role_credits = ROLE_DETECTIVE, "a ",  "detective", starting_credits end
  98.             if target_role ==  "innocent"  or target_role == "i" then role, role_grammar, role_string, role_credits = ROLE_INNOCENT,  "an ", "innocent",  0                end
  99.            
  100.             for i=1, #target_plys do
  101.                         local v = target_plys[ i ]
  102.                         local current_role = v:GetRole()
  103.        
  104.                         if ulx.getExclusive( v, calling_ply ) then
  105.                                 ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
  106.                         elseif GetRoundState() == 1 or GetRoundState() == 2 then
  107.                         ULib.tsayError( calling_ply, "The round has not begun!", true )
  108.                         elseif role == nil then
  109.                         ULib.tsayError( calling_ply, "Invalid role :\"" .. target_role .. "\" specified", true )
  110.                         elseif not v:Alive() then
  111.                                 ULib.tsayError( calling_ply, v:Nick() .. " is dead!", true )
  112.                         elseif current_role == role then
  113.                         ULib.tsayError( calling_ply, v:Nick() .. " is already " .. role_string, true )
  114.                         else
  115.                                 v:ResetEquipment()
  116.                                 RemoveLoadoutWeapons(v)
  117.                                 RemoveBoughtWeapons(v)
  118.  
  119.                     v:SetRole(role)
  120.                     v:SetCredits(role_credits)
  121.                     SendFullStateUpdate()
  122.  
  123.                     GiveLoadoutItems(v)
  124.                     GiveLoadoutWeapons(v)
  125.  
  126.                     table.insert( affected_plys, v )
  127.                 end
  128.             end
  129.             send_messages(affected_plys, "Your role has been set to " .. role_string .. "." )
  130.         end
  131. end
  132. local force = ulx.command( CATEGORY_NAME, "ulx force", ulx.force, "!force" )
  133. force:addParam{ type=ULib.cmds.PlayersArg }
  134. force:addParam{ type=ULib.cmds.StringArg, completes=ulx.target_role, hint="Role" }
  135. force:addParam{ type=ULib.cmds.BoolArg, invisible=true }
  136. force:defaultAccess( ULib.ACCESS_SUPERADMIN )
  137. force:setOpposite( "ulx sforce", {_, _, _, true}, "!sforce", true )
  138. force:help( "Force <target(s)> to become a specified role." )
  139.  
  140. -- Respawn
  141. function ulx.respawn( calling_ply, target_plys, should_silent )
  142.         if not GetConVarString("gamemode") == "terrortown" then ULib.tsayError( calling_ply, gamemode_error, true ) else
  143.                 local affected_plys = {}
  144.        
  145.                 for i=1, #target_plys do
  146.                         local v = target_plys[ i ]
  147.        
  148.                         if ulx.getExclusive( v, calling_ply ) then
  149.                                 ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
  150.                         elseif GetRoundState() == 1 then
  151.                         ULib.tsayError( calling_ply, "Waiting for players!", true )
  152.                
  153.                         elseif v:Alive() and v:IsSpec() then -- players arent really dead when they are spectating, we need to handle that correctly
  154.                 timer.Destroy("traitorcheck" .. v:SteamID())
  155.                 v:ConCommand("ttt_spectator_mode 0") -- just incase they are in spectator mode take them out of it
  156.                 timer.Create("respawndelay", 0.1, 0, function() --seems to be a slight delay from when you leave spec and when you can spawn this should get us around that
  157.                     local corpse = corpse_find(v) -- run the normal respawn code now
  158.                     if corpse then corpse_remove(corpse) end
  159.  
  160.                     v:SpawnForRound( true )
  161.                     v:SetCredits( ( (v:GetRole() == ROLE_INNOCENT) and 0 ) or GetConVarNumber("ttt_credits_starting") )
  162.                                
  163.                     table.insert( affected_plys, v )
  164.                    
  165.                     send_messages(affected_plys, "You have been respawned.")
  166.        
  167.                     if v:Alive() then timer.Destroy("respawndelay") return end
  168.                 end)
  169.                
  170.             elseif v:Alive() then
  171.                                 ULib.tsayError( calling_ply, v:Nick() .. " is already alive!", true )
  172.                         else
  173.                 timer.Destroy("traitorcheck" .. v:SteamID())
  174.                                 local corpse = corpse_find(v)
  175.                                 if corpse then corpse_remove(corpse) end
  176.  
  177.                                 v:SpawnForRound( true )
  178.                                 v:SetCredits( ( (v:GetRole() == ROLE_INNOCENT) and 0 ) or GetConVarNumber("ttt_credits_starting") )
  179.                                
  180.                                 table.insert( affected_plys, v )
  181.                         end
  182.                 end
  183.                 send_messages(affected_plys, "You have been respawned.")
  184.         end
  185. end
  186. local respawn = ulx.command( CATEGORY_NAME, "ulx respawn", ulx.respawn, "!respawn")
  187. respawn:addParam{ type=ULib.cmds.PlayersArg }
  188. respawn:addParam{ type=ULib.cmds.BoolArg, invisible=true }
  189. respawn:defaultAccess( ULib.ACCESS_SUPERADMIN )
  190. respawn:setOpposite( "ulx srespawn", {_, _, true}, "!srespawn", true )
  191. respawn:help( "Respawns <target(s)>." )
  192.  
  193. -- Karma
  194. function ulx.karma( calling_ply, target_plys, amount )
  195.         if not GetConVarString("gamemode") == "terrortown" then ULib.tsayError( calling_ply, gamemode_error, true ) else
  196.         for i=1, #target_plys do
  197.                         target_plys[ i ]:SetBaseKarma( amount )
  198.             target_plys[ i ]:SetLiveKarma( amount )
  199.         end    
  200.         end
  201. end
  202. local karma = ulx.command( CATEGORY_NAME, "ulx karma", ulx.karma, "!karma" )
  203. karma:addParam{ type=ULib.cmds.PlayersArg }
  204. karma:addParam{ type=ULib.cmds.NumArg, min=0, max=10000, default=1000, hint="Karma", ULib.cmds.optional, ULib.cmds.round }
  205. karma:defaultAccess( ULib.ACCESS_SUPERADMIN )
  206. karma:help( "Changes the <target(s)> Karma." )
  207.  
  208. -- Force Spectate
  209. function ulx.tttspec( calling_ply, target_plys, should_unspec )
  210.         if not GetConVarString("gamemode") == "terrortown" then ULib.tsayError( calling_ply, gamemode_error, true ) else
  211.  
  212.             for i=1, #target_plys do
  213.                         local v = target_plys[ i ]
  214.  
  215.                         if should_unspec then
  216.                             v:ConCommand("ttt_spectator_mode 0")
  217.                         else
  218.                             v:Kill()
  219.                             v:SetForceSpec(true)
  220.                             v:SetTeam(TEAM_SPEC)
  221.                             v:ConCommand("ttt_spectator_mode 1")
  222.                             v:ConCommand("ttt_cl_idlepopup")
  223.                         end
  224.             end
  225.             if should_unspec then
  226.                         ulx.fancyLogAdmin( calling_ply, "#A has forced #T to join the world of the living next round.", target_plys )
  227.                 else
  228.                 ulx.fancyLogAdmin( calling_ply, "#A has forced #T to spectate.", target_plys )
  229.                 end
  230.         end
  231. end
  232. local tttspec = ulx.command( CATEGORY_NAME, "ulx fspec", ulx.tttspec, "!fspec" )
  233. tttspec:addParam{ type=ULib.cmds.PlayersArg }
  234. tttspec:addParam{ type=ULib.cmds.BoolArg, invisible=true }
  235. tttspec:defaultAccess( ULib.ACCESS_SUPERADMINACCESS_SUPERADMIN )
  236. tttspec:setOpposite( "ulx unspec", {_, _, true}, "!unspec" )
  237. tttspec:help( "Forces the <target(s)> to/from spectator." )
  238.  
  239. -- Forced Role Next Round
  240. ulx.next_round = {}
  241. local function updateNextround()
  242.         table.Empty( ulx.next_round )
  243.    
  244.     table.insert(ulx.next_round,"traitor")
  245.     table.insert(ulx.next_round,"detective")   
  246.     table.insert(ulx.next_round,"unmark")
  247.  
  248. end
  249. hook.Add( ULib.HOOK_UCLCHANGED, "ULXNextRoundUpdate", updateNextround )
  250. updateNextround()
  251.  
  252.  
  253. local PlysMarkedForTraitor = {}
  254. local PlysMarkedForDetective = {}
  255. function ulx.nextround( calling_ply, target_plys, next_round )
  256.     if not GetConVarString("gamemode") == "terrortown" then ULib.tsayError( calling_ply, gamemode_error, true ) else
  257.         local affected_plys = {}
  258.         local unaffected_plys = {}
  259.         for i=1, #target_plys do
  260.             local v = target_plys[ i ]
  261.             local ID = v:UniqueID()
  262.        
  263.             if next_round == "traitor" then
  264.                 if PlysMarkedForTraitor[ID] == true or PlysMarkedForDetective[ID] == true then
  265.                     ULib.tsayError( calling_ply, "that player is already marked for the next round", true )
  266.                 else
  267.                     PlysMarkedForTraitor[ID] = true
  268.                     table.insert( affected_plys, v )
  269.                 end
  270.             end
  271.             if next_round == "detective" then
  272.                 if PlysMarkedForTraitor[ID] == true or PlysMarkedForDetective[ID] == true then
  273.                     ULib.tsayError( calling_ply, "that player is already marked for the next round!", true )
  274.                 else
  275.                     PlysMarkedForDetective[ID] = true
  276.                     table.insert( affected_plys, v )
  277.                 end
  278.             end
  279.             if next_round == "unmark" then
  280.                 if PlysMarkedForTraitor[ID] == true then
  281.                     PlysMarkedForTraitor[ID] = false
  282.                     table.insert( affected_plys, v )
  283.                 end
  284.                 if PlysMarkedForDetective[ID] == true then
  285.                     PlysMarkedForDetective[ID] = false
  286.                     table.insert( affected_plys, v )
  287.                 end
  288.             end
  289.         end    
  290.     end
  291. end        
  292. local nxtr= ulx.command( CATEGORY_NAME, "ulx forcenr", ulx.nextround, "!nr" )
  293. nxtr:addParam{ type=ULib.cmds.PlayersArg }
  294. nxtr:addParam{ type=ULib.cmds.StringArg, completes=ulx.next_round, hint="Next Round", error="invalid role \"%s\" specified", ULib.cmds.restrictToCompletes }
  295. nxtr:defaultAccess( ULib.ACCESS_SUPERADMIN )
  296. nxtr:help( "Forces the target to be a detective/traitor in the following round." )
  297.  
  298. local function TraitorMarkedPlayers()
  299.         for k, v in pairs(PlysMarkedForTraitor) do
  300.                 if v then
  301.                         ply = player.GetByUniqueID(k)
  302.                         ply:SetRole(ROLE_TRAITOR)
  303.             ply:AddCredits(GetConVarNumber("ttt_credits_starting"))
  304.                         PlysMarkedForTraitor[k] = false
  305.                 end
  306.         end
  307. end
  308. hook.Add("TTTBeginRound", "Admin_Round_Traitor", TraitorMarkedPlayers)
  309.  
  310. local function DetectiveMarkedPlayers()
  311.         for k, v in pairs(PlysMarkedForDetective) do
  312.                 if v then
  313.                         ply = player.GetByUniqueID(k)
  314.                         ply:SetRole(ROLE_DETECTIVE)
  315.             ply:AddCredits(GetConVarNumber("ttt_credits_starting"))
  316.             ply:Give("weapon_ttt_wtester")
  317.                         PlysMarkedForDetective[k] = false
  318.                 end
  319.         end
  320. end
  321. hook.Add("TTTBeginRound", "Admin_Round_Detective", DetectiveMarkedPlayers)
  322.  
  323. -- Destroy Corpse
  324. function ulx.removebody( calling_ply, target_ply )
  325.     if not GetConVarString("gamemode") == "terrortown" then ULib.tsayError( calling_ply, gamemode_error, true ) else
  326.         body = corpse_find( target_ply )
  327.         if not body then ULib.tsayError( calling_ply, "This player's corpse does not exist!", true ) return end
  328.         if string.find( body:GetModel(), "zm_", 6, true ) then
  329.             body:Remove()
  330.         elseif body.player_ragdoll then
  331.             body:Remove()
  332.         end
  333.     end
  334. end
  335. local removebody = ulx.command( CATEGORY_NAME, "ulx removebody", ulx.removebody, "!removebody")
  336. removebody:addParam{ type=ULib.cmds.PlayerArg }
  337. removebody:defaultAccess( ULib.ACCESS_SUPERADMIN )
  338. removebody:help( "Removes a target's body." )
  339.  
  340. -- Role of Corpse
  341. function ulx.identify( calling_ply, target_ply, unidentify )
  342.     if not GetConVarString("gamemode") == "terrortown" then ULib.tsayError( calling_ply, gamemode_error, true ) else
  343.         body = corpse_find( target_ply )
  344.         if not body then ULib.tsayError( calling_ply, "This player's corpse does not exist!", true ) return end
  345.  
  346.         if not unidentify then
  347.             CORPSE.SetFound( body, true )
  348.             target_ply:SetNWBool("body_found", true)
  349.            
  350.             if target_ply:GetRole() == ROLE_TRAITOR then
  351.                 SendConfirmedTraitors(GetInnocentFilter(false))
  352.                 SCORE:HandleBodyFound( calling_ply, target_ply )
  353.             end
  354.            
  355.         else
  356.             CORPSE.SetFound( body, false )
  357.             target_ply:SetNWBool("body_found", false)
  358.             SendFullStateUpdate()
  359.         end
  360.     end    
  361. end
  362. local identify = ulx.command( CATEGORY_NAME, "ulx identify", ulx.identify, "!identify")
  363. identify:addParam{ type=ULib.cmds.PlayerArg }
  364. identify:addParam{ type=ULib.cmds.BoolArg, invisible=true }
  365. identify:defaultAccess( ULib.ACCESS_SUPERADMIN )
  366. identify:setOpposite( "ulx unidentify", {_, _, true}, "!unidentify", true )
  367. identify:help( "Identifies a target's body." )
  368.  
  369. -- Restart Game
  370. function ulx.roundrestart( calling_ply )
  371.         if not GetConVarString("gamemode") == "terrortown" then ULib.tsayError( calling_ply, gamemode_error, true ) else
  372.                 ULib.consoleCommand( "ttt_roundrestart" .. "\n" )
  373.                 ulx.fancyLogAdmin( calling_ply, "#A has restarted the round." )
  374.         end
  375. end
  376. local restartround = ulx.command( CATEGORY_NAME, "ulx roundrestart", ulx.roundrestart )
  377. restartround:defaultAccess( ULib.ACCESS_SUPERADMIN )
  378. restartround:help( "Restarts the round." )
  379.  
  380. -- Credits
  381. function ulx.credits( calling_ply, target_plys, amount, should_silent )
  382.         if not GetConVarString("gamemode") == "terrortown" then ULib.tsayError( calling_ply, gamemode_error, true ) else
  383.         for i=1, #target_plys do
  384.             target_plys[ i ]:AddCredits(amount)
  385.         end
  386.         end
  387. end
  388. local credits = ulx.command( CATEGORY_NAME, "ulx credits", ulx.credits, "!credits")
  389. credits:addParam{ type=ULib.cmds.PlayersArg }
  390. credits:addParam{ type=ULib.cmds.NumArg, hint="Credits", ULib.cmds.round }
  391. credits:defaultAccess( ULib.ACCESS_SUPERADMIN )
  392. credits:setOpposite( "ulx silent credits", {_, _, _, true}, "!scredits", true )
  393. credits:help( "Gives the <target(s)> credits." )

EDIT: Yes, some of the code here is taken directly (some modified to remove FancyLogAdmin thingy) from the ULX TTT. Credit to them, not me

  • Print