• Print

Author Topic: TTT Damagelogs?  (Read 10572 times)

0 Members and 1 Guest are viewing this topic.

Offline th3applek1d

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
TTT Damagelogs?
« on: July 29, 2013, 08:37:58 am »
So, I want the moderators on my server to be able to do the ttt_print_damagelog command in their console.

The way I understood it, I can give them access to rcon and that command.
Can't really word it correctly, here's a screenie.



Y dis no work D:

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: TTT Damagelogs?
« Reply #1 on: July 29, 2013, 08:56:34 am »
Go into -Server directory-\gamemodes\terrortown\gamemode\admin.lua. (I recommend getting Notepad++ and opening the admin.lua file with that).

Now if you open that with Notepad++, you should see the lines on the left side. Find line 105, or scroll down until you find "PrintDamagelog".

Now the default damagelog function looks like this:
Code: Lua
  1. local function PrintDamageLog(ply)
  2.    local pr = GetPrintFn(ply)
  3.  
  4.    if (not IsValid(ply)) or ply:IsSuperAdmin() or GetRoundState() != ROUND_ACTIVE then
  5.       ServerLog(Format("%s used ttt_print_damagelog\n", IsValid(ply) and ply:Nick() or "console"))
  6.       pr("*** Damage log:\n")
  7.  
  8.       if not dmglog_console:GetBool() then
  9.          pr("Damage logging for console disabled. Enable with ttt_log_damage_for_console 1.")
  10.       end
  11.  
  12.       for k, txt in ipairs(GAMEMODE.DamageLog) do
  13.          pr(txt)
  14.       end
  15.  
  16.       pr("*** Damage log end.")
  17.    else
  18.       if IsValid(ply) then
  19.          pr("You do not appear to be RCON or a superadmin, nor are we in the post-round phase!")
  20.       end
  21.    end
  22. end
  23. concommand.Add("ttt_print_damagelog", PrintDamageLog)
  24.  

On line 108 (or in this case, line 4), change ply:IsSuperAdmin() to ply:IsAdmin().

It should look like this:

Code: Lua
  1. local function PrintDamageLog(ply)
  2.    local pr = GetPrintFn(ply)
  3.  
  4.    if (not IsValid(ply)) or ply:IsAdmin() or GetRoundState() != ROUND_ACTIVE then
  5.       ServerLog(Format("%s used ttt_print_damagelog\n", IsValid(ply) and ply:Nick() or "console"))
  6.       pr("*** Damage log:\n")
  7.  
  8.       if not dmglog_console:GetBool() then
  9.          pr("Damage logging for console disabled. Enable with ttt_log_damage_for_console 1.")
  10.       end
  11.  
  12.       for k, txt in ipairs(GAMEMODE.DamageLog) do
  13.          pr(txt)
  14.       end
  15.  
  16.       pr("*** Damage log end.")
  17.    else
  18.       if IsValid(ply) then
  19.          pr("You do not appear to be RCON or a superadmin, nor are we in the post-round phase!")
  20.       end
  21.    end
  22. end
  23. concommand.Add("ttt_print_damagelog", PrintDamageLog)
  24.  

Although, this only works if the ULX moderator group counts as an admin. It would need to inherit from the default ULX group "admin" for this to work (or you will have to rename the admin group to moderator, then make another group above moderator and make that for admins).

That's basically how I did it on "my" server.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline th3applek1d

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: TTT Damagelogs?
« Reply #2 on: July 29, 2013, 01:51:26 pm »
When I re upload the file to the server, I get a critical file transfer error. Any idea why?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: TTT Damagelogs?
« Reply #3 on: July 29, 2013, 02:16:38 pm »
Why do I feel the Ulysses forums now has a parrot as a mascot?
/index.php/topic,5863.0.html
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

  • Print