Colour saving/loading not working -
DaRoderick - 12.12.2012
Hi,
Followed this FS/tut/whatever to create a command to change player's icon/text. Everything is working except the loading part. I rewrote it to dini. Here's the tut;
http://forum.sa-mp.com/showthread.ph...ht=Colour+chat
Here's what I use to save the variable:
pawn Код:
dini_IntSet(file, "pChat", PlayerInfo[playerid][pChat]);
dini_IntSet(file, "pNameCol", PlayerInfo[playerid][pNameCol]);
pChat and pNameCol getting variables like {FFFFFF}. Why doesn't it save and probably therefore not load?
Re: Colour saving/loading not working -
park4bmx - 12.12.2012
That is an embed color (hex) that's how they are.
But do some debuging to see why both variables are set to the colour
Re: Colour saving/loading not working -
DaRoderick - 12.12.2012
Sorry, I have no idea what you're saying right now.
Re: Colour saving/loading not working -
Mike_Peterson - 12.12.2012
I believe the sa-mp colors are hex colors, they include letters aswell, letters and number characters, therefor its a string, so instead of 'IntSet' make it 'Set' so the entire would be 'Dini_Set'
It will work then probably.
Happy scripting, Happy Hanukkah and merry Christmas
Re: Colour saving/loading not working -
park4bmx - 12.12.2012
Make sure your variable is a string and saved as a string.
And also you use it like shown in the tut to save the colour.
pawn Код:
Colour[playerid][pChat] = "{33CC00}";
edit they should be like this
pawn Код:
INI_WriteString(ColFile, "pName", Colour[playerid][pNameCol]);
INI_WriteString(ColFile, "pChat", Colour[playerid][pChat]);
That's with
y_ini!
Re: Colour saving/loading not working -
DaRoderick - 12.12.2012
Alright, now the saving works but not the loading. So for the loading not
pawn Код:
PlayerInfo[playerid][pNameCol] = dini_Int(file, "pNameCol");
but
pawn Код:
PlayerInfo[playerid][pNameCol] = dini_Get(file, "pNameCol");
?
Re: Colour saving/loading not working -
park4bmx - 12.12.2012
I forgot how dini works as I don't use it any more but why don't you try it instead of asking
Re: Colour saving/loading not working -
Mike_Peterson - 12.12.2012
I happen to stay loyal with dracoblue's ingenius script, so uhhm.. yes I know about everything of Dini..
DaRoderick, like park4bmx said, use dini_Get, it is for retrieving string values.
Re: Colour saving/loading not working -
DaRoderick - 12.12.2012
On loading;
pawn Код:
PlayerInfo[playerid][pChat] = dini_Get(file, "pChat");
PlayerInfo[playerid][pNameCol] = dini_Get(file, "pNameCol");
these errors
Код:
array sizes do not match, or destination array is too small
array sizes do not match, or destination array is too small