Issue with Vehicle Saving [+Rep]
#3

pawn Код:
stock SavePermanentVehicles()
{
    for (new i = 1; i < MAX_VEHICLES; i ++)
    {
        if (!PermanentVehicleStatistics[i][IsPermCar]) continue;
        if (GetVehicleModel(i) < 400) continue;
        SavePermanentVehicle(i);
    }
    return 1;
}

stock SavePermanentVehicle(vehicleid)
{
    new query[768];
    if (!PermanentVehicleStatistics[vehicleid][IsPermCar]) return 0;
    else
    {
        format(query, sizeof(query), "UPDATE `PermCars` SET `PermCarModel` = '%d', `PermCarFaction` = '%d', `PermCarX` = '%f', `PermCarY` = '%f', `PermCarZ` = '%f', `PermCarRot` = '%f', `PermCarColor1` = '%d', `PermCarColor2` = '%d', `PermCarFamily` = '%d', `PermCarVIP` = '%d', `PermCarInt` = '%d', `PermCarVW` = '%d' WHERE `PermCarID` = '%d'",
        PermanentVehicleStatistics[vehicleid][PermCarModel],
        PermanentVehicleStatistics[vehicleid][PermCarFaction],
        PermanentVehicleStatistics[vehicleid][PermCarX],
        PermanentVehicleStatistics[vehicleid][PermCarY],
        PermanentVehicleStatistics[vehicleid][PermCarZ],
        PermanentVehicleStatistics[vehicleid][PermCarRot],
        PermanentVehicleStatistics[vehicleid][PermCarColors][1],
        PermanentVehicleStatistics[vehicleid][PermCarColors][2],
        PermanentVehicleStatistics[vehicleid][PermCarFamily],
        PermanentVehicleStatistics[vehicleid][PermCarVIP],
        PermanentVehicleStatistics[vehicleid][PermCarInt],
        PermanentVehicleStatistics[vehicleid][PermCarVW],
        PermanentVehicleStatistics[vehicleid][PermCarSQL]);
        db_query(ServerDB, query);
        print("Vehicle data successfully saved!");
    }
    return 1;
}
Reply


Messages In This Thread
Issue with Vehicle Saving [+Rep] - by nmader - 20.01.2014, 16:12
Re: Issue with Vehicle Saving [+Rep] - by Smally - 20.01.2014, 16:15
Re: Issue with Vehicle Saving [+Rep] - by nmader - 20.01.2014, 16:18

Forum Jump:


Users browsing this thread: 1 Guest(s)