Im trying to make few little changes in ulx warning system.
first one. to display how many warns you have after each warn.
seccond. to display chat message to whole server what user got banned for reaching too many warnings.
[url]http://pastebin.com/pRDcXqX4[/url] - full code
im just learning lua so im still bad at it.
first problem:
[IMG]https://dl.dropbox.com/u/84539988/ShareX/2014-01-11_19-16-15.png[/IMG]
seccond problem:
When bot / user gets banned it should display message that "x user reached too many warns..."
it dosent show anything
[lua]
ULib.tsayColor(target_ply, Color(80,80,80,255), "[Warn] " , Color(255,255,255,255), calling_ply:Nick(), Color(0,200,30,255), " Has Reached 3 Warnings and was banned." )
[/lua]
maybe its bad idea to use ULib's tsayColor maybe chat print would be good enough?
if anyone with better lua skills could give me some tips it would be great.
@Edit:
Why are you adding warns to :
[lua]target_ply.warntable["wcount"][/lua]
but then using just
[lua]target_ply["wcount"][/lua]
?
[QUOTE=Netheous;43499507]@Edit:
Why are you adding warns to :
[lua]target_ply.warntable["wcount"][/lua]
but then using just
[lua]target_ply["wcount"][/lua]
?[/QUOTE]
because warntable gives error can't say what error now will edit post later
[QUOTE=LeChris;43499674]because warntable gives error can't say what error now will edit post later[/QUOTE]
Yeah, and target_ply["wcount"] doesn't lol.
It would if you got rid of tostring() then it would say that target_ply["wcount"] is a nil value because you havent assigned it anywhere.
My suggestion, PrintTable( target_ply.warntable["wcount"] ), then paste the table here
This is same error it gives with "warntable" and ToString and PrintTable
[code]
[ERROR] addons/ulx/lua/ulx/modules/sh/warn.lua:26: attempt to index field 'warntable' (a nil value)
[/code]
Sorry, you need to Log In to post a reply to this thread.