SA-MP Forums Archive
Y_INI Filterscript help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Y_INI Filterscript help. (/showthread.php?tid=330327)



Y_INI Filterscript help. - Joshb93 - 01.04.2012

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

pawn Код:
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.

pawn Код:
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!


Re: Y_INI Filterscript help. - Reklez - 01.04.2012

i see why.

pawn Код:
INI_WriteString(File, string, inputtext);
STRING = RESULT.

You could just do this:

pawn Код:
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);



Re: Y_INI Filterscript help. - Joshb93 - 01.04.2012

Quote:
Originally Posted by Reklez
Посмотреть сообщение
i see why.

pawn Код:
INI_WriteString(File, string, inputtext);
STRING = RESULT.

You could just do this:

pawn Код:
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.


Re: Y_INI Filterscript help. - Joshb93 - 01.04.2012

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?


Re: Y_INI Filterscript help. - Reklez - 01.04.2012

I though that will fix the problem.
What did i do wrong?


Re: Y_INI Filterscript help. - Joshb93 - 01.04.2012

Quote:
Originally Posted by Reklez
Посмотреть сообщение
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"