Author Topic: AWarn 3.4 - Robust warning system  (Read 140901 times)

0 Members and 2 Guests are viewing this topic.

Offline Eccid

  • Full Member
  • ***
  • Posts: 115
  • Karma: 11
  • Hey, come on... We just met...
    • Terror Abound! Steam Group
Re: AWarn 3.3 - Robust warning system
« Reply #60 on: May 11, 2013, 01:41:45 PM »
I also get this error when I warn someone.

Code: [Select]
L 05/11/2013 - 16:42:12: Lua Error:
[ERROR] addons/ulx_warn/lua/ulx/modules/sh/warn.lua:62: attempt to call method 'Nick' (a nil value)
1. AddWarning - addons/ulx_warn/lua/ulx/modules/sh/warn.lua:62
2. call - addons/ulx_warn/lua/ulx/modules/sh/warn.lua:31
3. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
4. unknown - addons/ulib/lua/ulib/shared/commands.lua:1296
5. unknown - lua/includes/modules/concommand.lua:69



[ERROR] addons/ulx_warn/lua/ulx/modules/sh/warn.lua:62: attempt to call method 'Nick' (a nil value)
1. AddWarning - addons/ulx_warn/lua/ulx/modules/sh/warn.lua:62
2. call - addons/ulx_warn/lua/ulx/modules/sh/warn.lua:31
3. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
4. unknown - addons/ulib/lua/ulib/shared/commands.lua

Offline delagious

  • Newbie
  • *
  • Posts: 21
  • Karma: 0
Re: AWarn 3.3 - Robust warning system
« Reply #61 on: May 11, 2013, 06:03:43 PM »
For some reason the warning system doesn't work for a few players on my server. They can receive warns just fine
but when they disconnect and rejoin they no longer have any warnings. I do NOT receive any errors in console or
elsewhere the warnings just disappear for a few users. Any suggestions?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: AWarn 3.3 - Robust warning system
« Reply #62 on: May 11, 2013, 10:44:14 PM »
I will look onto making this more effective when I am out of the hospital.

ALL REPORTING ERRORS!
Though he's out of the hospital now, GIVE HIM TIME to recover.
SHEESH.

He IS paying attention.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline delagious

  • Newbie
  • *
  • Posts: 21
  • Karma: 0
Re: AWarn 3.3 - Robust warning system
« Reply #63 on: May 12, 2013, 12:23:47 PM »
ALL REPORTING ERRORS!
Though he's out of the hospital now, GIVE HIM TIME to recover.
SHEESH.

He IS paying attention.

Uh I'm not trying to rush him or anything I'm just posting about the problem I am having just to see if anyone knows a fix for it.
I hope he is feeling better.

Offline Duke Nukem

  • Newbie
  • *
  • Posts: 23
  • Karma: 0
Re: AWarn 3.3 - Robust warning system
« Reply #64 on: May 16, 2013, 02:39:56 PM »
ALL REPORTING ERRORS!
Though he's out of the hospital now, GIVE HIM TIME to recover.
SHEESH.

He IS paying attention.

No, I demand his attention right meow!

Offline alexys95

  • Newbie
  • *
  • Posts: 10
  • Karma: 0
Re: AWarn 3.3 - Robust warning system
« Reply #65 on: August 05, 2013, 09:23:21 AM »
It would be so awesome if someone could fix this and maybe add mysql support :D

Offline Fysus

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Re: AWarn 3.3 - Robust warning system
« Reply #66 on: August 12, 2013, 09:27:57 AM »
I found out how to make the warnings work with linux!

Im not sure if I should upload the fix becuse its rather easy to actually do. So what you need to do is replace everywhere it has "ulx/Warnings" with "ulx/warnings" and its lines 12, 13, 126, 139, 140, 245 and 246.

If you have a warning history with captital letters inside data/ulx/Warnings then either remove it or rename it with lower case letters then restart your server.

Offline xLiaMz

  • Newbie
  • *
  • Posts: 33
  • Karma: 0
Re: AWarn 3.3 - Robust warning system
« Reply #67 on: August 29, 2013, 12:34:29 PM »
Great Plugin.

However once warned I cannot un-warn people with or without the console. I think it may be better if an In-Game command can be used therefore if mistakes are made they can be deleted right there and then.

How can I un-warn for now?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: AWarn 3.3 - Robust warning system
« Reply #68 on: August 29, 2013, 02:01:35 PM »
How can I un-warn for now?
Commands:
ulx warn <player> <reason> - Warn a player for a specified reason
!warn <player> <reason> - Warn a player for a specified reason

ulx seewarns <player> - generates a printout in console of all warnings a player has received in the past, when they received them and who issued the warning.
ulx removewarning<player> <count> - Removes an amount of active warnings from the targeted player. these are the warnings that count towards the player being kicked.
ulx deletewarnings<player> - Completely removes all history of a player's warnings.
ulx listwarnings - Prints a list to console for all connected players who have warnings. This shows their total active warnings and their total warning count.

Those aren't working for you from server console at the least?
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Jakers12342

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: AWarn 3.3 - Robust warning system
« Reply #69 on: September 25, 2013, 01:59:10 PM »
How do i download this?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: AWarn 3.3 - Robust warning system
« Reply #70 on: September 25, 2013, 02:04:57 PM »
How do i download this?
The little paperclip/filename/size info/how many times downloaded link at the bottom of the release/first post.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Jakers12342

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: AWarn 3.3 - Robust warning system
« Reply #71 on: September 25, 2013, 02:32:06 PM »
when i do !warn [name] [reason] it says You do not have access to this command and im SuperAdmin...What do i do?
« Last Edit: September 25, 2013, 02:39:24 PM by Jakers12342 »

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: AWarn 3.3 - Robust warning system
« Reply #72 on: September 25, 2013, 05:49:42 PM »
make sure you allow superadmin's to run ulx warn.

I believe you could do:

ulx groupallow superadmin "ulx warn"

Offline rainbowdash

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
  • That awkward feeling when you forget ur main login
Re: AWarn 3.3 - Robust warning system
« Reply #73 on: October 16, 2013, 04:30:39 PM »
Not sure if its fixed, but there was an issue with warning players from the server console, as Nick() would return nil because the console has no nickname, the warning would not occur correctly...

Just looked at the latest version. Doesn't appear to be fixed... My fix for it is like this...

Code: [Select]
table.insert(target_ply.warntable["warnings"], {os.date(), calling_ply:Nick(), reason})

Change to

Code: [Select]
table.insert(target_ply.warntable["warnings"], {os.date(), calling_ply:Nick() or "Console", reason})

Should solve the error that people get when warning players from the server console or from rcon.

EDIT: That fix doesnt work, I applied it a while ago, restarted, just tested it,

Code: [Select]
(Console) warned Batman (Test, unwarn whenever)
ServerLog: [ULX] (Console) warned Batman (Test, unwarn whenever)
L 10/16/2013 - 19:47:47: [ULX] (Console) warned Batman (Test, unwarn whenever)
L 10/16/2013 - 19:47:47: Lua Error:
[ERROR] addons/ulx_warn/lua/ulx/modules/sh/warn.lua:61: attempt to call method 'Nick' (a nil value)
1. AddWarning - addons/ulx_warn/lua/ulx/modules/sh/warn.lua:61
2. call - addons/ulx_warn/lua/ulx/modules/sh/warn.lua:31
3. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
4. unknown - addons/ulib/lua/ulib/shared/commands.lua:1296
5. unknown - lua/includes/modules/concommand.lua:69



[ERROR] addons/ulx_warn/lua/ulx/modules/sh/warn.lua:61: attempt to call method 'Nick' (a nil value)
1. AddWarning - addons/ulx_warn/lua/ulx/modules/sh/warn.lua:61
2. call - addons/ulx_warn/lua/ulx/modules/sh/warn.lua:31
3. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
4. unknown - addons/ulib/lua/ulib/shared/commands.lua:1296
5. unknown - lua/includes/modules/concommand.lua:69

As another (blind) attempt, I stole a leaf out of my old book used in my DarkRP HUD, by storing calling_ply in a local variable, and then checking if the variable contains a string, and if not, set it to "Console"... which was an errorcheck i put in my hud to stop errors from spamming when a player first joins and their wallet hasn't loaded.

Code: [Select]
function ulx.AddWarning( target_ply, calling_ply, reason )
local safenick = calling_ply:Nick()
if not safenick then safenick = "Console" end

if target_ply.warntable == nil then
target_ply.warntable = {}
end

if target_ply.warntable["wcount"] == nil then
target_ply.warntable["wcount"] = 0
end

if target_ply.warntable["warnings"] == nil then
target_ply.warntable["warnings"] = {}
end

table.insert(target_ply.warntable["warnings"], {os.date(), safenick, reason})

target_ply.warntable["wcount"] = target_ply.warntable["wcount"] + 1
ULib.tsayColor(target_ply, Color(0,0,0,255), "AWarn: " , Color(255,255,255,255), "You were warned by ", Color(0,0,0,255), "(", Color(0,255,0,255), safenick, Color(0,0,0,255), ")", Color(255,255,255,255), " for: ", Color(255,0,0,255), reason)



if target_ply.warntable["wcount"] >= GetConVarNumber( "ulx_warnkick_num" ) then
if GetConVarNumber( "ulx_warnkick_ban" ) == 0 then
target_ply.warntable["wcount"] = target_ply.warntable["wcount"] - 1
ulx.WarningSave( target_ply )
ULib.kick( target_ply, "Warning threshold exceeded" )
else
local btime = tostring( GetConVarNumber( "ulx_warnkick_bantime" ) )
target_ply.warntable["wcount"] = target_ply.warntable["wcount"] - 1
ulx.WarningSave( target_ply )
ULib.kickban( target_ply, GetConVarNumber( "ulx_warnkick_bantime" ), "Warning threshold exceededm Banned for (" .. btime .. ") minutes.", calling_ply )
end
else
ulx.WarningSave( target_ply )
end


end

EDIT: Lol missed an instance of calling_ply:Nick().. also may want to adjust that typo for the kickban reason.
« Last Edit: October 16, 2013, 04:43:33 PM by rainbowdash »

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: AWarn 3.3 - Robust warning system
« Reply #74 on: October 16, 2013, 05:07:51 PM »
Nice catch! Thanks!

Updated to version 3.4
-Fixed the console warning a player returning a nil error for warning admin's name.