Another problem..(saving in y_ini text)
#1

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;
        }
Reply
#2

You can use INI_String for that
Reply
#3

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

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)