In the most basic explanation possible: create the variable to save the vehicle's position, when the player disconnects you set the vehicle's position in these variables and save it in the database. Then when the player logs in you create the vehicle with the coordinates retrieved from the database.
Basically, the logic would start like this:
Basically, the logic would start like this:
PHP Code:
new playerVehicle[MAX_PLAYERS];
new Float:carPos[MAX_PLAYERS][3];
public OnPlayerLogin(playerid)
{
// Retrieves the coordinates saved in the database
....
carPos[playerid][0] = X;
carPos[playerid][1] = Y;
carPos[playerid][2] = Z;
// Creates the vehicle with the coordinates retrieved
playerVehicle[playerid] = CreateVehicle(modelid, carPos[playerid][0], carPos[playerid][1], carPos[playerid][2]);
}
public OnPlayerDisconnect(playerid, reason)
{
// Sets the vehicle's position in the variable
GetVehiclePos(playerVehicle[playerid], carPos[playerid][0], carPos[playerid][1], carPos[playerid][2]);
// Saves the position of the variable in the database
Save System...
}