Raised This Month: $32 Target: $400
 8% 

Solved How to write "Stats" information to txt file?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
msbeden
Member
Join Date: Jan 2020
Location: Turkey, Eskisehir
Old 02-17-2020 , 16:18   How to write "Stats" information to txt file?
Reply With Quote #1

I want to write "stats" information to txt file.

I want to print Nick, Kill, Death, Headshoot information. I would like to print out other details, if any.

How can I do it?

SOLVED:

Code:
public sayPrint()
{
    new iMax = get_statsnum()
	
    new szFile[50];
    new szDate[40];
    get_time("%Y-%m-%d", szDate, charsmax(szDate));
    formatex(szFile, charsmax(szFile), "addons/amxmodx/stat/%s.txt",szDate);
    new szLog[2500];

	for (new i = 0; i < iMax ; i++)
	{
		new izStats[8] = {0, ...}, izBody[8], nick[32]
		get_stats(i, izStats, izBody, nick, 32);
		formatex(szLog, charsmax(szLog), "%d | %s | %d | %d | %d | %d | %d @parcala@ %d", i + 1, nick, izStats[0], izStats[1], izStats[2], izStats[4], izStats[5], izStats[6]);
                write_file(szFile, szLog);
	}
}

Last edited by msbeden; 02-18-2020 at 13:15.
msbeden is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-17-2020 , 16:35   Re: How to write "Stats" information to txt file?
Reply With Quote #2

By using the provided file natives.

"fopen" with flag "w" to open the .txt file in writing mode.
"fputs" to write a line in the file.
"fclose" when done.

Use the API for more information on how these functions work - https://www.amxmodx.org/api/
__________________

Last edited by OciXCrom; 02-17-2020 at 16:35.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Old 06-14-2022, 07:24
Woodrow Harris
This message has been deleted by asherkin. Reason: Spam.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-14-2022 , 22:08   Re: How to write "Stats" information to txt file?
Reply With Quote #3

Quote:
Originally Posted by Woodrow Harris View Post
I am also very interested in this question. I will be glad if I find important information for me here
A suggestion has already been provided. Do you have a specific scripting help question?
__________________
fysiks is offline
samsoares
BANNED
Join Date: Jul 2022
Location: United States
Old 07-29-2022 , 15:55   Re: How to write "Stats" information to txt file?
Reply With Quote #4

We can say that this website https://www.hardwaretimes.com/top-4-...vices-in-2022/ has all the data on different assignments stuff that is useful for kids. You can let us know as that was what we will be able to explore for them in the meantime as well for those who like it.
samsoares is offline
whitewalter
BANNED
Join Date: Sep 2022
Old 09-20-2022 , 06:05   Re: How to write "Stats" information to txt file?
Reply With Quote #5

Quote:
Originally Posted by samsoares View Post
We can say that this website https://www.hardwaretimes.com/top-4-...vices-in-2022/ has all the data on different assignments stuff that is useful for kids. You can let us know as that was what we will be able to explore for them in the meantime as well for those who like it.
Hi, I can advise you to go on site - https://mylearninghub.com/industries/aviation. Here you find one of the best service for improving your staff. Well qualified personnel can faster make their work with fewer mistakes. So don't wait go to them now.
whitewalter 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 07:28.


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