21.12.2012, 16:21
(
Last edited by Peach; 22/12/2012 at 01:57 PM.
)
I've had problems getting this script to load player vehicles. The query is working as i've debugged it but the problem is, no vehicles are being created.
Here is what I have:
Here is what I have:
PHP Code:
stock LoadPlayerVehicles(playerid)
{
new str[256];
new query[128];
for (new i = 1; i < MAX_PLAYER_OWNED_CARS + 1; i += 1)
{
format(query, sizeof(query), "SELECT * FROM `playervehicles` WHERE `OwnerName` = '%s' AND `VehicleSlot` = '%d'", PlayerName(playerid), i);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows())
{
sscanf(str, "p<|>e<sdffffdddddddddddddddddddddddddddddddddddd>", PlayerOwnedVehicles[playerid][i]);
PlayerOwnedVehicles[playerid][i][pCarID] = CreateVehicle(PlayerOwnedVehicles[playerid][i][pCarModel], PlayerOwnedVehicles[playerid][i][pCarX], PlayerOwnedVehicles[playerid][i][pCarY], PlayerOwnedVehicles[playerid][i][pCarZ], PlayerOwnedVehicles[playerid][i][pCarRot], PlayerOwnedVehicles[playerid][i][pCarColor1], PlayerOwnedVehicles[playerid][i][pCarColor2], -1);
AddVehicleMods(playerid, i);
}
mysql_free_result();
}
return true;
}