Ulysses
General => Developers Corner => Topic started by: Skarr on March 26, 2016, 08:07:21 AM
-
Hey guys so I'm not really getting any errors however the files are just not working, not sure if ulx is overpowering the files or not.
I've added the "Custom-ULX-Commands" from here: https://github.com/jkralicky/Custom-ULX-Commands
Mainly cause of the watch list presented via table format; https://github.com/jkralicky/Custom-...sh/cc_util.lua
Anyone that could know anything on how to get this working ?
Edit:
In chat it appears as: "Steb (STEAM ##) is on watchlist for RDM'ing" When the user joins that is okay, say i want to list the Watchlist and i have several users ? it wont fit in chat...
function ulx.watchlist(calling_ply)
watchlist = {}
for k, v in pairs(player.GetAll()) do
if v:GetPData("Watched") == "true" then
table.insert( watchlist, v:Nick())
table.insert(watchlist, v:GetPData("WatchReason"))
end
end
local watchstring = table.concat( watchlist, "," )
ulx.fancyLogAdmin( nil, true, "Watchlist: #s ",watchstring )
end
local watchlist = ulx.command("Essentials", "ulx watchlist", ulx.watchlist, "!watchlist",true)
watchlist:defaultAccess( ULib.ACCESS_ADMIN )
watchlist:help( "Prints watch list." )
Trying to get it to lodge like this as a watch list, or if not possible;
List the watchlist in chat ona new line:
Eg.
WatchList
---------
Name1 : Reason
Name2 : Reason
Name3 : Reason
but instead i get this: (http://prntscr.com/ak93h0)
As you see it's missing 1 player.
PS. i am still new at all this and slowly learning it all. Anything help would be great :)
-
Don't use ulx fancylogadmin.
Use a standard chat print message.
-
Any suggestions ?
Or what format i could use ?
-
ChatPrint - https://wiki.garrysmod.com/page/Player/ChatPrint
or
PrintMessage - https://wiki.garrysmod.com/page/Player/PrintMessage
Would have to use \n I think to get new line.
Personally, I wouldn't want a full list of names/reasons in my chat box.
Perhaps a single line saying 'check your console, warned players are currently connected' then see a list in console.
Or if getting fancy, some gui window or additional XGUI tab. (
But, that's just me.
Awarn 3 does the console list - https://forums.ulyssesmod.net/index.php?topic=5958.0
Good to learn from.
-
Yeah, like console doesnt work for all players, like i dont mind if it comes down as watchlist doesnt get viewed much and onyl shows from those online, it will just help, as right now it's blocking the test...
i will check what you said in a few mins and get back to you. Thanks for the help!
-
Hey,
Tried what you said seem to just break it, could you do an example please??
function ulx.watchlist(calling_ply)
watchlist = {}
for k, v in pairs(player.GetAll()) do
if v:GetPData("Watched") == "true" then
table.insert( watchlist, v:Nick())
table.insert(watchlist, v:GetPData("WatchReason"))
end
end
local watchstring = table.concat( watchlist, "," )
ulx.fancyLogAdmin( nil, true, "Watchlist: #s ",watchstring )
end
local watchlist = ulx.command("Essentials", "ulx watchlist", ulx.watchlist, "!watchlist",true)
watchlist:defaultAccess( ULib.ACCESS_ADMIN )
watchlist:help( "Prints watch list." )