PDA

View Full Version : Save Cars!


KrishkoW
11/06/2013, 04:07 PM
Hello everyone, I have problem with saving cars!
I need to some1 code for me [stock savecar(payerid)] if my loadcar stock looks like this!

stock LoadMyCar(playerid)
{
if(GetPlayerHouse(playerid) == 0) return 1;
if(GetPlayerCar(playerid) == 0) return 1;
new c = GetPVarInt(playerid, "PlayerCars");
new carid = CreateVehicle(CarInfo[c][cModel], CarInfo[c][cX], CarInfo[c][cY], CarInfo[c][cZ], CarInfo[c][cFa], CarInfo[c][cColor][0], CarInfo[c][cColor][1], 90000);
CarDoors(carid, CarInfo[c][cLock]);
Fuel[carid] = CarInfo[c][cFuel];
SetVehicleHealth(carid, CarInfo[c][cHeal]);
Engine[carid] = false;
Lights[carid] = false;
switch(CarInfo[c][cLock])
{
case 0: IsLocked[carid] = false;
case 1: IsLocked[carid] = true;
}
SetPVarInt(playerid,"CREVEH",carid);
if(CarInfo[c][cVehcoms][0]!=0) AddVehicleComponent(carid, CarInfo[c][cVehcoms][0]);
if(CarInfo[c][cVehcoms][1]!=0) AddVehicleComponent(carid, CarInfo[c][cVehcoms][1]);
if(CarInfo[c][cVehcoms][2]!=0) AddVehicleComponent(carid, CarInfo[c][cVehcoms][2]);
if(CarInfo[c][cVehcoms][3]!=0) AddVehicleComponent(carid, CarInfo[c][cVehcoms][3]);
if(CarInfo[c][cVehcoms][4]!=0) AddVehicleComponent(carid, CarInfo[c][cVehcoms][4]);
if(CarInfo[c][cVehcoms][5]!=0) AddVehicleComponent(carid, CarInfo[c][cVehcoms][5]);
if(CarInfo[c][cVehcoms][6]!=0) AddVehicleComponent(carid, CarInfo[c][cVehcoms][6]);
if(CarInfo[c][cVehcoms][7]!=0) AddVehicleComponent(carid, CarInfo[c][cVehcoms][7]);
if(CarInfo[c][cVehcoms][8]!=0) AddVehicleComponent(carid, CarInfo[c][cVehcoms][8]);
if(CarInfo[c][cVehcoms][9]!=0) AddVehicleComponent(carid, CarInfo[c][cVehcoms][9]);
if(CarInfo[c][cVehcoms][10]!=0) AddVehicleComponent(carid, CarInfo[c][cVehcoms][10]);
if(CarInfo[c][cVehcoms][11]!=0) AddVehicleComponent(carid, CarInfo[c][cVehcoms][11]);
if(CarInfo[c][cVehcoms][12]!=0) AddVehicleComponent(carid, CarInfo[c][cVehcoms][12]);
if(CarInfo[c][cVehcoms][13]!=0) AddVehicleComponent(carid,CarInfo[c][cVehcoms][13]);
if(CarInfo[c][cPaintjob]!=0) ChangeVehiclePaintjob(carid, CarInfo[c][cPaintjob]);
return true;
}