SA-MP Forums Archive
Another problem..(saving in y_ini text) - 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: Another problem..(saving in y_ini text) (/showthread.php?tid=468173)



Another problem..(saving in y_ini text) - Scrillex - 06.10.2013

So I have a problem .. IDK how to save text with y_ini.. Trying to make something like that
Enum
new Scars [256];

pawn Код:
case DIALOG_SCARS:
        {
            if( response )
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_SCARS,DIALOG_STYLE_INPUT,"SCARS","Discribe where you have scars?","Done","");
                {
                    strcpy(PlayerInfo[playerid][Scars], value, sizeof (PlayerInfo[playerid][Scars]));
                }
            }
            return 1;
        }



Re: Another problem..(saving in y_ini text) - TonyII - 06.10.2013

You can use INI_String for that


Re: Another problem..(saving in y_ini text) - Scrillex - 06.10.2013

I have INI_WriteString(File,"Scars",PlayerInfo[playerid][Scars]); but how to check... with inputtext?

Yeah I know I wailed with loading inputtext from that.. soz..(Under dialog.. but yeah need some ideas...


What I need to get is wroted text inputtext and saved in y_ini file.


Re: Another problem..(saving in y_ini text) - TonyII - 06.10.2013

With strcat you can, https://sampwiki.blast.hk/wiki/Strcat
pawn Код:
strcat((PlayerInfo[playerid][Scars], PlayerInfo[playerid][Scars]), inputtext, 128);



Re: Another problem..(saving in y_ini text) - Scrillex - 06.10.2013

Could you give me how it's possible with Y_INI to check the wroted text length?

Just an example or something..

because it doesn't ring a bell to me..


Re: Another problem..(saving in y_ini text) - EiresJason - 06.10.2013

This is how you check the length of a string.
pawn Код:
strlen(string);
Used like:
pawn Код:
new length = strlen(inputtext);

if(length > 80) SendClientMessage(playerid,-1,"ERROR: Message is to long! Shorten it!");



Re: Another problem..(saving in y_ini text) - Scrillex - 06.10.2013

Yeah my fault was that I just needed to open y_ini file and write in it the text what I wanted..


Re: Another problem..(saving in y_ini text) - EiresJason - 06.10.2013

Ooh :P

Did you get it working or do you need the code that opens the file, writes the string to the file and then closes the file?