Hooking the first connection of a player
How can I get, if the user got the first time on the server? So basically, I would like to print them a special client_print to their first connect.
|
Re: Hooking the first connection of a player
First connect in what scope?
|
Re: Hooking the first connection of a player
For example I found a new server, connected to it first time. But the second time or more I should not get the client_print.
|
Re: Hooking the first connection of a player
You would need to create a list of all the people that have connected to the server. Each time someone connects, you check the list. If they are not in the list then print the message and add them to the list. If they are already in the list, don't print the message.
However, this list can get extremely long and can cause adverse side effects. I would not recommend doing this at all. It may be possible to pull from stats (for this 'list'; not entirely sure though), if they have stats then don't print the message. I'm not sure how often stats reset though. On my clans server they reset after 3500 unique connections. |
Re: Hooking the first connection of a player
I really don't know how to work with a list or something, so I thought some users here have maybe experience with that also with that server side effects which you now told.
|
Re: Hooking the first connection of a player
I would use nvault because i don't know how to use other systems ;)
Once you have printed to player, set nvault with his steamid to 1. nvault_get returns 0 if key doesn't exist, this way you can know if users come for first fime. |
Re: Hooking the first connection of a player
Thanks connor, would something like this be right?
PHP Code:
|
Re: Hooking the first connection of a player
You don't need to format the nvault key, steamid is enough if the vault is unique.
|
Re: Hooking the first connection of a player
Ok, did that, still it doesn't work how it should.
|
Re: Hooking the first connection of a player
Actually it does but how do you think it will print the messages when the player is still connecting.
|
| All times are GMT -4. The time now is 01:59. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.