Raised This Month: $ Target: $400
 0% 

Write to .txt file and put +1


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
jonatat
Senior Member
Join Date: Dec 2017
Old 04-19-2021 , 10:24   Re: Write to .txt file and put +1
Reply With Quote #7

Quote:
Originally Posted by CrazY. View Post
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("Plugin", "Version", "Author")     new filename[128]     formatex(filename[get_configsdir(filename, charsmax(filename))], charsmax(filename), "/numbers.txt")     new file = fopen(filename, "r+t")     if (file)     {         new buffer[15]         new num = 0         if (fgets(file, buffer, charsmax(buffer)))             num = str_to_num(buffer[1]) + 1         fseek(file, 0, SEEK_SET)         formatex(buffer, charsmax(buffer), "A%d", num)         fputs(file, buffer)         fclose(file)     } }
WORKING! Thanks CrazY
jonatat is offline
 



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 02:31.


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