AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Check if a player enters first time (https://forums.alliedmods.net/showthread.php?t=240751)

xDidixX 05-21-2014 17:03

Check if a player enters first time
 
Hey All,

I Want To Check In My Plugin if a player enters first time to the server ( check on ip .. )
please help me and sorry for my bad english ..


YamiKaitou 05-21-2014 17:18

Re: Check if a player enters first time
 
You will need to log each connection and then check against that to see if it is already logged. If it is not, it is the first time they have visited your server

Flick3rR 05-21-2014 17:35

Re: Check if a player enters first time
 
May I just ask about a simple way, the idea of which I get few time ago. Couldn't it happen with a non-reset bool, which to set on connection and never reset? Or this will be only to the change of map, I guess. Or with a variable in nvault with index, in connection to set to 1 and never reset :D This is kind'a stupid and probably not the best way, but easier. :D

xDidixX 05-22-2014 00:40

Re: Check if a player enters first time
 
how i do this ?

Blizzard_87 05-22-2014 01:04

Re: Check if a player enters first time
 
Quote:

Originally Posted by Flick3rR (Post 2140847)
May I just ask about a simple way, the idea of which I get few time ago. Couldn't it happen with a non-reset bool, which to set on connection and never reset? Or this will be only to the change of map, I guess. Or with a variable in nvault with index, in connection to set to 1 and never reset :D This is kind'a stupid and probably not the best way, but easier. :D

just no.

logging it is best way like Yami said.

If i get time later i might write up a simple example.

hornet 05-22-2014 08:20

Re: Check if a player enters first time
 
Best way would be to save all Steam ID's ( since IP's change ) by some method such as SQL, text file, nVault.
You would then load all saved ID's into a trie on server start and then check connections against the trie, then add the new connection to the trie aswell.


All times are GMT -4. The time now is 09:40.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.