AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Auto Create a .cfg in configs (https://forums.alliedmods.net/showthread.php?t=76177)

AntiBots 08-19-2008 18:37

Auto Create a .cfg in configs
 
Someone can give me an Idea to do this :D

thanks :D

Exolent[jNr] 08-19-2008 18:47

Re: Auto Create a .cfg in configs
 
Code:
public plugin_init() {     new filename[64];     get_configsdir(filename, 63);     add(filename, 63, "/my_config.cfg");         if( !file_exists(filename) )     {         new f = fopen(filename);         fputs(f, "");         fclose(f);     } }

Arkshine 08-19-2008 18:59

Re: Auto Create a .cfg in configs
 
Just using that is enough :

Code:
new fp = fopen( filename, "w" ); fclose( fp );

Alka 08-20-2008 03:41

Re: Auto Create a .cfg in configs
 
I don't know shure if it works only with "w" mode, maybe you will have to put "at+"

Arkshine 08-20-2008 03:59

Re: Auto Create a .cfg in configs
 
No.

w = Create an empty file for writing. If a file with the same name already exists its content is erased and the file is treated as a new empty file.


All times are GMT -4. The time now is 03:14.

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