Save vehicle by vehicleid.
#9

Ok.

PlayerData[playerid][pcar] is your vehicle id.

If you check your code it says:
pawn Код:
new TempVeh = CreateVehicle(534,TurgausSpawn[iRandom][0], TurgausSpawn[iRandom][1], TurgausSpawn[iRandom][2], TurgausSpawn[iRandom][3], -1, -1, -1);
This code means that the id of the vehicle is TempVeh.

A few lines later you say that PlayerData[playerid][pcar]=TempVeh. So you store the vehicle's id into the PlayerData variable.
This means that the PlayerData[playerid][pcar] is your vehicle's id.

So your new code would be:

pawn Код:
stock SaveCar(playerid,vehicleid)
{
if(PlayerData[ playerid ][ pcar ] == -1) return;//if player don't have he own car for him don't save car.
print("Car successfully save");
new files[ 128 ];
format( files, 60, "saves/cars/%d.ini", PlayerData[playerid][pcar]);
if(!fexist(files)){dini_Create(files);}
Reply


Messages In This Thread
Save vehicle by vehicleid. - by budelis - 07.07.2011, 18:15
Re: Save vehicle by vehicleid. - by Hipflop - 07.07.2011, 18:20
Re: Save vehicle by vehicleid. - by budelis - 07.07.2011, 19:02
Re: Save vehicle by vehicleid. - by Hipflop - 07.07.2011, 19:03
Re: Save vehicle by vehicleid. - by budelis - 07.07.2011, 19:11
Re: Save vehicle by vehicleid. - by Hipflop - 07.07.2011, 19:14
Re: Save vehicle by vehicleid. - by budelis - 07.07.2011, 19:17
Re: Save vehicle by vehicleid. - by Scenario - 07.07.2011, 19:18
Re: Save vehicle by vehicleid. - by Hipflop - 07.07.2011, 19:21
Re: Save vehicle by vehicleid. - by budelis - 07.07.2011, 19:21

Forum Jump:


Users browsing this thread: 1 Guest(s)