20.09.2016, 06:04
So hello there, i have a problem with my script i can't get it working.
I want to store a value from my database "COLOR_WHITE" into pInfo[playerid][namecolor] but. When i store it i recieve no errors but it's still not working, i made a test string with SendClientMessage and it print's to me only letter "C" and the name is then converted to black, as the variable is not defined and doesn't exist in my color list as "C". The mysql colomn is "namecolor" set to TEXT as type. I tried varchar(250) too, nothing happens.
This is were the variable is set when user log in:
Here is when user uses command to change color: (still in test purposes)

I have no idea how to resolve this..
I want to store a value from my database "COLOR_WHITE" into pInfo[playerid][namecolor] but. When i store it i recieve no errors but it's still not working, i made a test string with SendClientMessage and it print's to me only letter "C" and the name is then converted to black, as the variable is not defined and doesn't exist in my color list as "C". The mysql colomn is "namecolor" set to TEXT as type. I tried varchar(250) too, nothing happens.
This is were the variable is set when user log in:
PHP код:
new dest[256];
cache_get_field_content(0,"namecolor",dest);
//cache_get_field_content(0,"namecolor",pInfo[playerid][namecolor],dbhandle,128); //i tried this too and same.
format(pInfo[playerid][namecolor], sizeof(dest), dest);
PHP код:
CMD:color(playerid, params[])
{
new color = pInfo[playerid][namecolor];
SetPlayerColor(playerid, pInfo[playerid][namecolor]);
new string[128];
format(string, sizeof(string), "Color: %s", color);
SendClientMessage(playerid, COLOR_GREEN, string);
return 1;
}

I have no idea how to resolve this..