26.01.2014, 03:23
Hey all,
I am trying to load a color code from MySQL to use for SetPlayerColor.
I have confirmed that the color saves and loads:
SetPlayerColor is setting the players color to black.
I went ahead and checked the variable later:
and none of those return anything at all.
What should I do?
Loading the teams:
I am trying to load a color code from MySQL to use for SetPlayerColor.
I have confirmed that the color saves and loads:
Код:
[07:27:19] Team Loaded: (1) Team 1 at 0x33CCFFAA [07:27:19] Team Loaded: (2) Team 2 at 0xAA3333FF [07:27:19] Team Loaded: (3) Team 3 at 0x0000BBAA [07:27:19] Team Loaded: (4) Team 4 at 0xFFFF00AA [07:27:19] Team Loaded: (5) Team 5 at 0x33AA33AA
I went ahead and checked the variable later:
pawn Код:
new string[128];
format(string,sizeof string, "%s or %d or %i",tData[1][pColor],tData[1][pColor],tData[1][pColor]);
SendClientMessage(playerid, COLOR_WHITE, string);
What should I do?
Loading the teams:
pawn Код:
stock T_Create(i)
{
new query[420], savingstring[20];
format(query, sizeof(query), "SELECT * FROM teams WHERE TeamID=%d",i);
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row_format(query,"|"))
{
mysql_fetch_field_row(savingstring, "TeamID"); tData[i][TeamID] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Active"); tData[i][Active] = strval(savingstring);
mysql_fetch_field_row(tData[i][Color],"Color");
mysql_fetch_field_row(tData[i][pColor],"tColor");
mysql_fetch_field_row(tData[i][Name],"Name");
printf("Team Loaded: (%d) %s at %s", tData[i][TeamID], tData[i][Name],tData[i][pColor]);
tNumbers++;
}
mysql_free_result();
return 1;
}