Y_INI Filterscript help.
#1

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!
Reply
#2

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);
Reply
#3

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.
Reply
#4

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?
Reply
#5

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

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"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)