Raised This Month: $ Target: $400
 0% 

How to make a ini file?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 12-22-2008 , 13:06   Re: How to make a ini file?
Reply With Quote #7

Try this:
Code:
#include <amxmodx> #include <amxmisc> #define VERSION "1.0" new g_szFile[ 62 ]; public plugin_precache() {     get_configsdir( g_szFile, 61 );     new mapname[ 20 ];     get_mapname( mapname, 19 );     format( g_szFile, 61, "%s/test/%s.ini", g_szFile, mapname );         fclose( fopen( g_szFile, "x" ) ); // Creates the file. // I think it's useless as the file is //                    created when attempting to write into it. } public plugin_init() {     register_plugin( "File Test", VERSION, "Dores" );     register_clcmd( "say /lol", "Cmd_LoL" ); } public Cmd_LoL( id ) {     new f = fopen( g_szFile, "w" );     fputs( f, "LoL" );     fclose( f ); // Always close the file no matter what. }
Type in chat: /lol, or say /lol in console to write "LoL" into the file.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores 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 23:12.


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