Saving vehicle plate using Y_INI(String) Problem
#1

Fixed
Reply
#2

replace
Код:
Info[playerid][Plate] = strval(inputtext);
with
Код:
format(Info[playerid][Plate], 64, "%s", strval(inputtext));
Reply
#3

I did it, It compile right but it's not working.
Reply
#4

Does anyone know how to solve this problem?
Reply
#5

pawn Код:
if(dialogid == VPLATE)
    {
        if(response)
        {
           format(Info[playerid][Plate], 14, "%s", inputtext); //I doubt your number plate is going to be 64 cells long... strval will only return numbers, as it is for values.
           SendClientMessageFormatted(playerid, COLOR_GREEN,"Your vehicle Plate has been set to %s.", inputtext);
        }
    }
However, if we move back to our enum values, we may need to adjust some things.

We're saving our plate as a string right? So instead of having just, for example:
pawn Код:
enum PlayerInfo {
    Plate,
    Kills
};
We would need to change
pawn Код:
Plate,
To:
pawn Код:
Plate[15]
I'm making it 15 because it's close to the maximum plate size + null terminator. You can also change the 14 to a 15 in the format used in your dialog response.

If you don't give it a string size, it might not save as a string, but as an integer. So you need to tell the script, you want this variable to be saved as a string, thus using [15].
Reply
#6

Working like a charm! Thanks for the help clarencecuzz.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)