Raised This Month: $ Target: $400
 0% 

HELP WITH A PLUGIN


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rastamanzp
Junior Member
Join Date: Mar 2010
Old 10-18-2010 , 22:56   HELP WITH A PLUGIN
Reply With Quote #1

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!
rastamanzp is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-18-2010 , 23:03   Re: HELP WITH A PLUGIN
Reply With Quote #2

get_configsdir()
file_exists()
write_file()

Moved to Scripting Help.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 10-20-2010 , 15:50   Re: HELP WITH A PLUGIN
Reply With Quote #3

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
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.

Last edited by naven; 10-20-2010 at 16:46. Reason: fixed
naven is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-20-2010 , 15:53   Re: HELP WITH A PLUGIN
Reply With Quote #4

Quote:
Originally Posted by N A V E N View Post
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.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Zpoke
Senior Member
Join Date: Aug 2009
Location: Sweden
Old 10-20-2010 , 15:58   Re: HELP WITH A PLUGIN
Reply With Quote #5

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


Last edited by Zpoke; 10-20-2010 at 16:00.
Zpoke is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-20-2010 , 16:04   Re: HELP WITH A PLUGIN
Reply With Quote #6

Thank you guys for posting what I already said.

Quote:
Originally Posted by fysiks View Post
echo . . . echo . . . . . . echo . . . . . .
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 10-20-2010 , 16:12   Re: HELP WITH A PLUGIN
Reply With Quote #7

Quote:
Originally Posted by Exolent[jNr] View Post
Very wrong for the file location.
Why? It works for me
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-20-2010 , 16:15   Re: HELP WITH A PLUGIN
Reply With Quote #8

Quote:
Originally Posted by N A V E N View Post
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.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 10-20-2010 , 16:17   Re: HELP WITH A PLUGIN
Reply With Quote #9

Quote:
Originally Posted by Exolent[jNr] View Post
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.
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.

Last edited by naven; 10-20-2010 at 16:20.
naven is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-20-2010 , 16:18   Re: HELP WITH A PLUGIN
Reply With Quote #10

Quote:
Originally Posted by N A V E N View Post
You could say that earlier. I thought it causes bugs or whatever... Just a typo.
What?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 10:27.


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