Raised This Month: $ Target: $400
 0% 

Read from a file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shadow728988
Member
Join Date: Sep 2017
Old 07-10-2019 , 01:59   Read from a file
Reply With Quote #1

is it possible to allow entry to only those players on the server whose steam id's have been written down in a file in config folder.
need this for a tournament based 5v5 matches
thanks a lot
shadow728988 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-10-2019 , 03:08   Re: Read from a file
Reply With Quote #2

Yes, it is possible. Show what you tried or ask a more specific question.
__________________
HamletEagle is offline
shadow728988
Member
Join Date: Sep 2017
Old 07-10-2019 , 03:57   Re: Read from a file
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
Yes, it is possible. Show what you tried or ask a more specific question.
i havent tried it per se..but lets assume we have to files TeamA(steamids of its players) and TeamB(steamids of its players) in configs folder and only they will be allowed in the server, no other steam id or player can connect to the server.
shadow728988 is offline
shadow728988
Member
Join Date: Sep 2017
Old 07-10-2019 , 03:59   Re: Read from a file
Reply With Quote #4

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)
}
shadow728988 is offline
shadow728988
Member
Join Date: Sep 2017
Old 07-11-2019 , 00:33   Re: Read from a file
Reply With Quote #5

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 #6

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

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
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 07-10-2019 , 06:05   Re: Read from a file
Reply With Quote #8

Give it a try,
Spoiler
__________________

Last edited by Relaxing; 07-10-2019 at 09:41. Reason: i++
Relaxing is offline
shadow728988
Member
Join Date: Sep 2017
Old 07-10-2019 , 09:57   Re: Read from a file
Reply With Quote #9

Quote:
Originally Posted by Relaxing View Post
Give it a try,
Spoiler
created the .ini file with my steam id in it..still kicks me
shadow728988 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-10-2019 , 10:04   Re: Read from a file
Reply With Quote #10

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
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 17:26.


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