Colour saving/loading not working
#1

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

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

Sorry, I have no idea what you're saying right now.
Reply
#4

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

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

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

I forgot how dini works as I don't use it any more but why don't you try it instead of asking
Reply
#8

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

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)