Raised This Month: $51 Target: $400
 12% 

Read from a file


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-10-2019 , 10:04   Re: Read from a file
Reply With Quote #11

Quote:
Originally Posted by Relaxing View Post
Give it a try,
Spoiler
A client doesn't have a valid SteamID until after client_authorized() so you should use that instead of client_connect().
__________________
fysiks is offline
shadow728988
Member
Join Date: Sep 2017
Old 07-10-2019 , 10:14   Re: Read from a file
Reply With Quote #12

Quote:
Originally Posted by fysiks View Post
A client doesn't have a valid SteamID until after client_authorized() so you should use that instead of client_connect().
i did tried this but no luck.
shadow728988 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-10-2019 , 10:58   Re: Read from a file
Reply With Quote #13

Quote:
Originally Posted by shadow728988 View Post
cant add all the 100 players you know..thank you for replying
Nevermind, I misread the request.
__________________

Last edited by OciXCrom; 07-10-2019 at 10:58.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
shadow728988
Member
Join Date: Sep 2017
Old 07-11-2019 , 00:33   Re: Read from a file
Reply With Quote #14

Quote:
Originally Posted by shadow728988 View Post
also what can be the condition to not log duplicate names and authid if the player retries..currently this function sits in client_putinserver
Code:
public logplayers(id)
{
	new  szAuthID[32], szName[32];
	get_user_name(id, szName, 31);
	get_user_authid(id, szAuthID, charsmax(szAuthID));
	log_to_file(g_szFileName, "Name %s | AuthID %s | ", szName, szAuthID)
}
help me with this someone
shadow728988 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 07-11-2019 , 03:54   Re: Read from a file
Reply With Quote #15

Quote:
Originally Posted by shadow728988 View Post
also what can be the condition to not log duplicate names and authid if the player retries..currently this function sits in client_putinserver
Code:
public logplayers(id)
{
	new  szAuthID[32], szName[32];
	get_user_name(id, szName, 31);
	get_user_authid(id, szAuthID, charsmax(szAuthID));
	log_to_file(g_szFileName, "Name %s | AuthID %s | ", szName, szAuthID)
}
I wonder what's the purpose of this code. Obviously not stealing their pw that's for sure. Why would I even think that. This is a lovely community.
__________________
Relaxing is offline
shadow728988
Member
Join Date: Sep 2017
Old 07-11-2019 , 05:41   Re: Read from a file
Reply With Quote #16

Quote:
Originally Posted by Relaxing View Post
I wonder what's the purpose of this code. Obviously not stealing their pw that's for sure. Why would I even think that. This is a lovely community.
what do you mean..doesnt this only logs the players steamid and name in a new file players.txt(already defined)?
shadow728988 is offline
thEsp
BANNED
Join Date: Aug 2017
Old 07-11-2019 , 05:43   Re: Read from a file
Reply With Quote #17

Yes it does.
thEsp is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-11-2019 , 07:28   Re: Read from a file
Reply With Quote #18

So, is this a request for a plugin or request for help with creating it yourself? If it's the first one, this is not the right section for the thread. Here you do things by yourself and we guide you through the process.
If you want somebody else to make the plugin for you, use the plugin requests section.
__________________

Last edited by OciXCrom; 07-11-2019 at 07:28.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
shadow728988
Member
Join Date: Sep 2017
Old 07-11-2019 , 09:09   Re: Read from a file
Reply With Quote #19

Quote:
Originally Posted by OciXCrom View Post
So, is this a request for a plugin or request for help with creating it yourself? If it's the first one, this is not the right section for the thread. Here you do things by yourself and we guide you through the process.
If you want somebody else to make the plugin for you, use the plugin requests section.
i guess help me with this then please
Code:
public logplayers(id)
{
	new  szAuthID[32], szName[32];
	get_user_name(id, szName, 31);
	get_user_authid(id, szAuthID, charsmax(szAuthID));
	log_to_file(g_szFileName, "Name %s | AuthID %s | ", szName, szAuthID)
}
what will be the condition to not duplicate the entries if the player retries?
shadow728988 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-11-2019 , 09:28   Re: Read from a file
Reply With Quote #20

You need to read the file to check if the SteamID is already in the list. My advice is reading the file once on map start and store all the SteamIDs in a trie, then simply check if the SteamID is in the trie when the user connects.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 04:26.


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