25.04.2015, 09:57
hi guys ,
I need some help with this my problem is when I save player colors it saves correctly but when I load them it load the 1 color but I choosed other color pls help me here is the code
I need some help with this my problem is when I save player colors it saves correctly but when I load them it load the 1 color but I choosed other color pls help me here is the code
pawn Код:
new const P_Colors[ ] = {0x00FFFFFF,0xFFE4C4FF,0x0000FFFF,0x00FF00FF,0xFF0000FF,0xFFFF00FF,0xFFA500FF,0xFFD700FF,0x8A2BE2FF,0xA52A2AFF,0xFF7F50FF,0x8B008BFF};
//dialog
case DIALOG_COLORS+1:
{
if ( !response )
return ( 1 );
SetPlayerColor(playerid, P_Colors[ listitem ] );
format(gsQuery,sizeof(gsQuery),"UPDATE `Accounts` SET `Color` = '%d' WHERE `Name` = '%s'",listitem, getPlayerName(playerid));
mysql_query( gsQuery, THREAD_NONE, playerid, connection );
return 1;
}
//loading player data
cache_get_field_content(0, "Color",savingstring, connection);SetPlayerColor(playerid, P_Colors[strval(savingstring)]);