PDA

View Full Version : Y_INI Filterscript help.


Joshb93
01/04/2012, 04:48 AM
Ok, im trying to make an IG Admin command creator.

But heres my problem, when i go to save the command name, it comes out like this

CMD:%s(playerid, params[]) = testcmd

Here is my code, saving the command. This is just a small piece(unfinished) just to see if it would work properly, and.. it didnt.


new string[128];
new INI:File = INI_Open("Commands/Commands.txt");
format(string, sizeof(string), "CMD:%s(playerid, params[])", inputtext);
INI_WriteString(File, string, inputtext);
INI_Close(File);


I see what im doing wrong, i just dont know how to correct it..
Any help is appreciated!

+REP for anyone that helps!

Reklez
01/04/2012, 04:53 AM
i see why.


INI_WriteString(File, string, inputtext);


STRING = RESULT.

You could just do this:


new File:Creator = fopen("Commands/Commands.txt", io_append);
format(string, sizeof(string), "CMD:%s(playerid, params[])\r\n", inputtext);
fwrite(Creator, string);
fclose(Creator);

Joshb93
01/04/2012, 04:55 AM
i see why.


INI_WriteString(File, string, inputtext);


STRING = RESULT.

You could just do this:


new File:Creator = fopen("Commands/Commands.txt", io_append);
format(string, sizeof(string), "CMD:%s(playerid, params[])\r\n", inputtext);
fwrite(Creator, string);
fclose(Creator);



Ahh. Thanks. Ive ALWAYS had a problem with file saving. So im forcing myself to learn it better.

Joshb93
01/04/2012, 05:01 AM
Lesson learned: Always test something before you say thanks/add rep. >.<

That didnt work, still comes out like stated above..

Anyone else that could help?

Reklez
01/04/2012, 05:04 AM
I though that will fix the problem.
What did i do wrong? ???

Joshb93
01/04/2012, 05:08 AM
I though that will fix the problem.
What did i do wrong? ???

Well, idk. Im as stumped as you are. Im wondering if what im wanting to do, is not possible, since it always has an "= RESULT"