Raised This Month: $ Target: $400
 0% 

Player Status in DB


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
harethecoder
New Member
Join Date: Jan 2014
Old 01-03-2014 , 14:29   Re: Player Status in DB (sqlstats Lite)
Reply With Quote #1

I have spent some time to repair public init_status() function

and

it doesn't crash the server!
It was all about get_time() function.

All you have to do is to find this code:
Code:
//initialize all player status
public init_status()
{
	new datfile[MAX_LENGTH+10],datfile2[MAX_LENGTH+20]
	formatex(datfile,MAX_LENGTH+9,"%s/csstats.dat",g_datadir)
	get_time("%Y%M%D",datfile2,MAX_LENGTH+19)
	formatex(datfile2,MAX_LENGTH+19,"%s/csstats-%s.bak",g_datadir,datfile2)
	server_print(datfile)
	if(file_exists(datfile))
	{
		if(rename_file(datfile,datfile2,1))
		{
			server_print("[PSD] Initialize Successful, and backup csstats.dat now.")		
			server_print("[PSD] Please reloading server...")
		}else{
			server_print("[PSD] Initialize Failed...")
		}
	}else{
		server_print("[PSD] Can't Initializing... Sequence Failed...")
	}
	return PLUGIN_CONTINUE
}
and change it with this one:
Code:
//initialize all player status for backup
public init_status()
{
	new datfile[MAX_LENGTH+10],datfile2[MAX_LENGTH+20],thedate[MAX_LENGTH]
	formatex(datfile,MAX_LENGTH+9,"%s/csstats.dat",g_datadir) 			//prepare csstats.dat
	get_time("%Y-%m-%d",thedate,MAX_LENGTH) 					//get server date year-month-day
	/* 
	now prepare backup-file-name datadir/csstats-thedate.bak 
	i.e. your_datadir/csstats-2014-01-01.bak
	*/
	formatex(datfile2,MAX_LENGTH+19,"%s/csstats-%s.bak",g_datadir,thedate)	//prepare backup file
	if(file_exists(datfile))							//check if csstats.dat exists
	{
		if(rename_file(datfile,datfile2,1))					//rename csstats.dat to backup-file.bak
		{
			server_print("[PSD] Initialize Successful, and backup csstats.dat now.")		
			server_print("[PSD] Please reloading server...")
		}else{
			server_print("[PSD] Initialize Failed...")
		}
	}else{
		server_print("[PSD] Can't Initializing... Sequence Failed...")
	}
	return PLUGIN_CONTINUE
}
As you will check this function, you can see that, it only makes backup file!
However, working function is better than crashing one
harethecoder is offline
eHardy
New Member
Join Date: Feb 2012
Old 09-05-2012 , 03:46   Re: Player Status in DB (sqlstats Lite)
Reply With Quote #2

who tested it on windows 7?
eHardy is offline
Mofforg
Senior Member
Join Date: Aug 2010
Location: Moscow, Russia
Old 01-05-2013 , 10:52   Re: Player Status in DB (sqlstats Lite)
Reply With Quote #3

Sorry is that statsx.amxx for MySQL with additional feature (player status)??
Mofforg is offline
Send a message via ICQ to Mofforg Send a message via Skype™ to Mofforg
sandeep
Member
Join Date: Dec 2012
Location: india/gujarat/bharuch
Old 01-07-2014 , 11:08   Re: Player Status in DB (sqlstats Lite)
Reply With Quote #4

How to use this plugins on hlds server
sandeep is offline
Send a message via Skype™ to sandeep
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 03-22-2020 , 08:43   Re: Player Status in DB (sqlstats Lite)
Reply With Quote #5

v0.8 Now Testing.


__________________
GitHub
SteamWishlist

六四天安門事件

Last edited by +ARUKARI-; 03-28-2020 at 07:33.
+ARUKARI- is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 03-29-2020 , 01:21   Re: Player Status in DB (sqlstats Lite)
Reply With Quote #6

0.8 commited in github.
https://github.com/AoiKagase/AMXMODX...er/psd_008.sma
https://github.com/AoiKagase/AMXMODX...ster/csx_stats
__________________
GitHub
SteamWishlist

六四天安門事件

Last edited by +ARUKARI-; 03-29-2020 at 08:35.
+ARUKARI- is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 04-02-2020 , 22:16   Re: Player Status in DB (sqlstats Lite)
Reply With Quote #7

Thank you for the update!
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 04-02-2020 , 22:22   Re: Player Status in DB (sqlstats Lite)
Reply With Quote #8

Quote:
Originally Posted by JocAnis View Post
Thank you for the update!
But, Not completed yet.
If you are a alliedmodders donor, please cooperate in the donor thread.
__________________
GitHub
SteamWishlist

六四天安門事件
+ARUKARI- is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 04-05-2020 , 07:46   Re: Player Status in DB (sqlstats Lite)
Reply With Quote #9

Now working Status Pages.
__________________
GitHub
SteamWishlist

六四天安門事件

Last edited by +ARUKARI-; 04-05-2020 at 07:49.
+ARUKARI- is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 04-05-2020 , 23:21   Re: Player Status in DB (sqlstats Lite)
Reply With Quote #10

Update and top upload v1.0!
__________________
GitHub
SteamWishlist

六四天安門事件
+ARUKARI- 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 11:24.


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