AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   HELP WITH A PLUGIN (https://forums.alliedmods.net/showthread.php?t=141048)

rastamanzp 10-18-2010 22:56

HELP WITH A PLUGIN
 
I need to know how wirte en pawn,to create a new file.ini to save in the amxmodx/configs folder with some information inside . i need an example of code to make my own code then. please help! thanks!

Exolent[jNr] 10-18-2010 23:03

Re: HELP WITH A PLUGIN
 
get_configsdir()
file_exists()
write_file()

Moved to Scripting Help.

naven 10-20-2010 15:50

Re: HELP WITH A PLUGIN
 
Example.
Code:
#define LOCATION "addons/amxmodx/configs/file.txt" //at the right place of course! //then... new szMessage[126] format(szMessage, 125, "Content %s", some_variable) write_file(LOCATION, szMessage) //3rd parameter default

Exolent[jNr] 10-20-2010 15:53

Re: HELP WITH A PLUGIN
 
Quote:

Originally Posted by N A V E N (Post 1330400)
Example.
Code:
#define LOCATION "addons/amxmodx/configs" //at the right place of course! //then... new szMessage[126] format(szMessage, 125, "Content %s", some_variable) write_file(LOCATION, szMessage) //3rd parameter default

Very wrong for the file location.

Zpoke 10-20-2010 15:58

Re: HELP WITH A PLUGIN
 
PHP Code:

public plugin_cfg()
{  
    new 
configsdir[32], file[64];
    
get_configsdir(configsdir31);
    
format(file63"%s/whatever.ini"configsdir);



Exolent[jNr] 10-20-2010 16:04

Re: HELP WITH A PLUGIN
 
Thank you guys for posting what I already said.

Quote:

Originally Posted by fysiks (Post 1316688)
echo . . . echo . . . . . . echo . . . . . .


naven 10-20-2010 16:12

Re: HELP WITH A PLUGIN
 
Quote:

Originally Posted by Exolent[jNr] (Post 1330406)
Very wrong for the file location.

Why? It works for me

Exolent[jNr] 10-20-2010 16:15

Re: HELP WITH A PLUGIN
 
Quote:

Originally Posted by N A V E N (Post 1330432)
Why? It works for me

The code you posted will not work because you are writing to a directory, not a file.
Actually, it may work, but not like you expected. If it works, it will write to a new file called "configs" (no extension) in the addons/amxmodx directory.

naven 10-20-2010 16:17

Re: HELP WITH A PLUGIN
 
Quote:

Originally Posted by Exolent[jNr] (Post 1330436)
The code you posted will not work because you are writing to a directory, not a file.
Actually, it may work, but not like you expected. If it works, it will write to a new file called "configs" (no extension) in the addons/amxmodx directory.

You could say that earlier. I thought it causes bugs or whatever...
@ down: just nevermind, let's try to do not spam anymore.

Exolent[jNr] 10-20-2010 16:18

Re: HELP WITH A PLUGIN
 
Quote:

Originally Posted by N A V E N (Post 1330441)
You could say that earlier. I thought it causes bugs or whatever... Just a typo.

What?


All times are GMT -4. The time now is 10:27.

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