18.05.2014, 04:37
pInfo[playerid][pColor] is the wrong value.
Do this:
Then see what appears in your server log/console.
EDIT: You can also shorten your code to:
Do this:
pawn Код:
if(pInfo[playerid][pUseCol] == 1)
{
/*new color;
//strmid(color,pInfo[playerid][pColor], 0, strlen(pInfo[playerid][pColor]), 11);
color = pInfo[playerid][pColor];
color <<= 8;
color |= 0xFF;*/
SetPlayerColor(playerid, pInfo[playerid][pColor]);
printf("%d", pInfo[playerid][pColor]);
}
EDIT: You can also shorten your code to:
pawn Код:
stock LoadColor(playerid)
return SetPlayerColor(playerid, ((pInfo[playerid][pUseCol]) ? (pInfo[playerid][pColor]) : (PlayerColors[playerid])));