04.01.2013, 19:40
pawn Код:
new str[128];
format(str, sizeof(str), "SELECT * FROM Cars WHERE Ownerid = '%d'", UserStats[playerid][Uniqueid]);
mysql_query(str);
mysql_store_result();
while(mysql_retrieve_row())
{
new row[128];
new field[5][128];
mysql_fetch_row_format(row, "|");
print(row); //See what this prints and if it even pritns
explode(row, field, "|"); //sscanf is probably better than explode.
CarStats[playerid][Unid][i] = strval(field[0]);
CarStats[playerid][Carid][i] = strval(field[1]);
CarStats[playerid][Ownerid][i] = strval(field[2]);
CarStats[playerid][Color1][i] = strval(field[3]);
CarStats[playerid][Color2][i] = strval(field[4]);
}
mysql_free_result();