Author Topic: Question, Please help  (Read 4128 times)

0 Members and 1 Guest are viewing this topic.

Offline Weapon317

  • Newbie
  • *
  • Posts: 25
  • Karma: 0
Question, Please help
« on: February 26, 2011, 12:55:47 PM »
Hey guys, i have a question.

When a players connects it says "Player [name] had joined the game" but i want when they are in the game it says "Player [name] entered the game with steam id [id]" and when they leave it says "player [name] left the game with steam id [id]" A friend of mine told it was a ULX addon? But couldnt find it D:

I use the GUI made by Sticky man, great work there man btw :) The SVN Version

Thanks! :D

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Question, Please help
« Reply #1 on: February 26, 2011, 01:34:34 PM »
I'm pretty sure the message you're specifically talking about, the non steamid one, is created by the server itself, not any addon including ULX.
ULX has log files that track atll that, and can be set to display joins ip and steamid in the console, but not the chat area.
I see no reason to have that in the chat text, as it would duplicate the server's actual announcement, and be a bit annoying (imo).

Also, I see no efficient way to have the player's steamid listed when they leave.
The gmod lua command PlayerDisconnect doesn't keep track, it kicks off after the player is gone, after the steamid and ip are no longer known to the lua environment.
I'm not saying the code couldn't be written to track all of that, but, it seems a waste of memory.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Weapon317

  • Newbie
  • *
  • Posts: 25
  • Karma: 0
Re: Question, Please help
« Reply #2 on: February 26, 2011, 02:04:32 PM »
I'm pretty sure the message you're specifically talking about, the non steamid one, is created by the server itself, not any addon including ULX.
ULX has log files that track atll that, and can be set to display joins ip and steamid in the console, but not the chat area.
I see no reason to have that in the chat text, as it would duplicate the server's actual announcement, and be a bit annoying (imo).

Also, I see no efficient way to have the player's steamid listed when they leave.
The gmod lua command PlayerDisconnect doesn't keep track, it kicks off after the player is gone, after the steamid and ip are no longer known to the lua environment.
I'm not saying the code couldn't be written to track all of that, but, it seems a waste of memory.

Hmm cuz i saw it in a server before and it was quite usefull when a player Joins you see in chat "Player [name] entered the game with steam id: [id]" Is there any way i could make that work in ULX or else?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Question, Please help
« Reply #3 on: February 26, 2011, 02:37:48 PM »
There is a way, in addition to the common one the Source server says, but, why do you need it in the chat area?
Is the console not enough?
I'd leave a server if everytime someone joined I had to see two join messages, one from the server, one from a mod.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Weapon317

  • Newbie
  • *
  • Posts: 25
  • Karma: 0
Re: Question, Please help
« Reply #4 on: February 26, 2011, 02:45:38 PM »
There is a way, in addition to the common one the Source server says, but, why do you need it in the chat area?
Is the console not enough?
I'd leave a server if everytime someone joined I had to see two join messages, one from the server, one from a mod.

Hmm i guess ur right, well then yeah in console might do, but how do i see/activate that, that i can see steamid's in console? (when a player joins u see his steam id in console with his name to) (Sorry im not really common with this kind of stuff >.>)


EDIT: I found this code on the website

local function playerFirstSpawn( ply )
   if util.tobool( GetConVarNumber( "ulx_logEvents" ) ) then
      ulx.logString( string.format( "%s [%s][%s] joined the server.", ply:Nick(), ply:SteamID(), ply:IPAddress() ) )
   end
end
hook.Add( "PlayerInitialSpawn", "ULXLogConnect", playerFirstSpawn )

Where can i put this to test it in my serv? Cuz this is actolly exacly what i was looking for, In lua/autorun/server it doesnt work but i probebly have to put it into a ULX file, besides i founded out the log thing for console but it dont work :( it dont show up in my console and its enabled. I use SVN ULX Version 3.5 and ULib 2.4  (SVN 158)
« Last Edit: February 26, 2011, 04:58:45 PM by Weapon317 »

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: Question, Please help
« Reply #5 on: February 26, 2011, 05:21:50 PM »
That is logging it, not printing it into chat/console.  Just change it accordingly via Player.ChatPrint or G.MsgAll .
« Last Edit: February 26, 2011, 05:25:16 PM by Aaron113 »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Question, Please help
« Reply #6 on: February 26, 2011, 05:36:26 PM »
Added a cvar in newest ULX revision to print a player's steamid to admins' consoles when joining/leaving.
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Question, Please help
« Reply #7 on: February 26, 2011, 06:31:49 PM »
Added a cvar in newest ULX revision to print a player's steamid to admins' consoles when joining/leaving.
Thought logstring already did print to admins consoles, like entity spawning/etc.
Been a while, guess I was wrong.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Question, Please help
« Reply #8 on: February 26, 2011, 07:34:47 PM »
Thought logstring already did print to admins consoles, like entity spawning/etc.
Been a while, guess I was wrong.

It does if they spawn something, but only if they spawn something. What if a player comes in and griefs without spawning anything? Anyways, I thought it was a good idea. :P
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Question, Please help
« Reply #9 on: February 26, 2011, 10:50:53 PM »
Oh, it was a good idea, but thats what I'm saying. I know the log files contain joins/leaves, but I thought console already did.
Either way, whether it ever did or didn't, I'm glad it's back!
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming