General > Developers Corner
Displaying damagelogs?
aaron:
How difficult would this be to code into the server to display damagelogs in the console, for only certain ranks aswell if possible?
This would be on a jailbreak server.
MrPresident:
Not hard at all. Use the PlayerHurt with ULX's FancyLog function.
Add a couple checks for which groups you want it to report on.
All in all, this addon function would only take about 10-15 lines of code and no time at all to do if you know how to write lua. If you do not, I suggest you start by taking a look at some of the other uses of FancyLog and the example function(s) on the wiki that I linked.
aaron:
Thank you very much for your reply. I am new the LUA but there is no harm in me trying!
aaron:
We can't seem to figure out ULX fancylog.
So far we've got damagelogs displaying in the console for the user that was damaged like "You were damaged by ____ for ___ health"
Now we're trying to get all damagelogs to show for all admins like "____ was damaged by ___ for ___ health" but we're having trouble.
Edit:
We've got it showing for admins & superadmins but obviously as we have no idea how to get it working with fancylog, trialmods, mods and any other group from ULX can't see the logs.
Could anybody help?
MrPresident:
So are you wanting it to show in the console for your admins/mods as well as being logged in the servers ULX logs? If so, you'll need to send it as a message to the players. Use something like:
ULib.console(ply, message)
this would print a message to all admins console:
--- Code: ---for k, v in pairs (player.GetAll()) do
if v:IsAdmin() or v:IsUserGroup("moderator") then
ULib.console(v, "This message will show up in the console")
end
end
--- End code ---
Let me know if this helps.
Navigation
[0] Message Index
[#] Next page
Go to full version