27.12.2012, 19:43
Try this code.
PHP Code:
stock LoadPlayerVehicles(playerid)
{
new
query[600],
i = 0;
format(query, sizeof(query), "SELECT * FROM `playervehicles` WHERE `Name` = '%s' LIMIT %d", PlayerName(playerid), MAX_PLAYER_OWNED_CARS);
mysql_query(query);
mysql_store_result();
printf("%s", query);
while(mysql_retrieve_row())
{
mysql_fetch_row_format(query);
printf("%s", query);
sscanf(query, "p<|>s[24]dffffdddddddddddddddddddddddddddddddddddd",
PlayerOwnedVehicles[playerid][i][playerCarOwner],
PlayerOwnedVehicles[playerid][i][playerCarModel],
PlayerOwnedVehicles[playerid][i][playerCarX],
PlayerOwnedVehicles[playerid][i][playerCarY],
PlayerOwnedVehicles[playerid][i][playerCarZ],
PlayerOwnedVehicles[playerid][i][playerCarRot],
PlayerOwnedVehicles[playerid][i][playerCarColor1],
PlayerOwnedVehicles[playerid][i][playerCarColor2],
PlayerOwnedVehicles[playerid][i][playerCarPaintjob],
PlayerOwnedVehicles[playerid][i][playerCarMod1],
PlayerOwnedVehicles[playerid][i][playerCarMod2],
PlayerOwnedVehicles[playerid][i][playerCarMod3],
PlayerOwnedVehicles[playerid][i][playerCarMod4],
PlayerOwnedVehicles[playerid][i][playerCarMod5],
PlayerOwnedVehicles[playerid][i][playerCarMod6],
PlayerOwnedVehicles[playerid][i][playerCarMod7],
PlayerOwnedVehicles[playerid][i][playerCarMod8],
PlayerOwnedVehicles[playerid][i][playerCarMod9],
PlayerOwnedVehicles[playerid][i][playerCarMod10],
PlayerOwnedVehicles[playerid][i][playerCarMod11],
PlayerOwnedVehicles[playerid][i][playerCarMod12],
PlayerOwnedVehicles[playerid][i][playerCarMod13],
PlayerOwnedVehicles[playerid][i][playerCarMod14],
PlayerOwnedVehicles[playerid][i][playerCarMod15],
PlayerOwnedVehicles[playerid][i][playerCarMod16],
PlayerOwnedVehicles[playerid][i][playerCarMod17],
PlayerOwnedVehicles[playerid][i][playerCarHasLock],
PlayerOwnedVehicles[playerid][i][playerCarLocked],
PlayerOwnedVehicles[playerid][i][playerCarTrunkCash],
PlayerOwnedVehicles[playerid][i][playerCarTrunkGun1],
PlayerOwnedVehicles[playerid][i][playerCarTrunkGun2],
PlayerOwnedVehicles[playerid][i][playerCarTrunkGun3],
PlayerOwnedVehicles[playerid][i][playerCarTrunkGun4],
PlayerOwnedVehicles[playerid][i][playerCarTrunkAmmo1],
PlayerOwnedVehicles[playerid][i][playerCarTrunkAmmo2],
PlayerOwnedVehicles[playerid][i][playerCarTrunkAmmo3],
PlayerOwnedVehicles[playerid][i][playerCarTrunkAmmo4],
PlayerOwnedVehicles[playerid][i][playerCarSpawned],
PlayerOwnedVehicles[playerid][i][playerCarOwned],
PlayerOwnedVehicles[playerid][i][playerCarOwnerID],
PlayerOwnedVehicles[playerid][i][playerCarFuel],
PlayerOwnedVehicles[playerid][i][playerCarSlotID]
);
printf("%s", query);
PlayerOwnedVehicles[playerid][i][playerCarID] = CreateVehicle(PlayerOwnedVehicles[playerid][i][playerCarModel], PlayerOwnedVehicles[playerid][i][playerCarX], PlayerOwnedVehicles[playerid][i][playerCarY], PlayerOwnedVehicles[playerid][i][playerCarZ], PlayerOwnedVehicles[playerid][i][playerCarRot], PlayerOwnedVehicles[playerid][i][playerCarColor1], PlayerOwnedVehicles[playerid][i][playerCarColor2], -1);
AddVehicleMods(playerid, i);
i++;
}
mysql_free_result();
return 1;
}