Raised This Month: $ Target: $400
 0% 

Check if a player enters first time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xDidixX
New Member
Join Date: Apr 2014
Old 05-21-2014 , 17:03   Check if a player enters first time
Reply With Quote #1

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 ..

xDidixX is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-21-2014 , 17:18   Re: Check if a player enters first time
Reply With Quote #2

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
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 05-21-2014 , 17:35   Re: Check if a player enters first time
Reply With Quote #3

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 This is kind'a stupid and probably not the best way, but easier.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
xDidixX
New Member
Join Date: Apr 2014
Old 05-22-2014 , 00:40   Re: Check if a player enters first time
Reply With Quote #4

how i do this ?
xDidixX is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-22-2014 , 01:04   Re: Check if a player enters first time
Reply With Quote #5

Quote:
Originally Posted by Flick3rR View Post
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 This is kind'a stupid and probably not the best way, but easier.
just no.

logging it is best way like Yami said.

If i get time later i might write up a simple example.
__________________
Blizzard_87 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-22-2014 , 08:20   Re: Check if a player enters first time
Reply With Quote #6

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.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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