I'm terrible at ns2 modding, but I would guess you could set up some sort of thing to hook into the server side client connect / disconnect then send a message to the client and have some stuff happen.
That's not server side, that is client side, though all that is tracking is your own client, not others. You weren't very clear on what you want to do. I'm assuming you want to be able to access some sort of client data when other clients connect? If you want to do that, you'll have to setup and send network messages from the server -> client when other clients connect and disconnect. That process is rather easy. Unfortunately if you're only doing a client side mod, then there's no much that can be done, as that data isn't passed. The only thing you could do is parse out the player is connected message that happens on a setname that is broadcasted, which is a bit of a kludge.
There also may be other kludgey ways of doing it buried in the client code (ie: the scoreboard needs to be updated when a user connects/disconnects).
Does LUA/NS2 allow for a "cron" type of event? You could then just check the sv_status return value every x seconds, see what's changed and do stuff with it. And that should all be client side.
But I never tried modding NS2, I'm just throwing in some noob-ish idea, so maybe I'm completely wrong
Comments
In Client.lua
Pro-Tip of the Day: CTRL+SHIFT+F is your best friend in Decoda
If I remember correctly, the client connect/disconnect there is *your* client connecting or disconnecting as a status. Not other players.
There also may be other kludgey ways of doing it buried in the client code (ie: the scoreboard needs to be updated when a user connects/disconnects).
But I never tried modding NS2, I'm just throwing in some noob-ish idea, so maybe I'm completely wrong