07.07.2011, 19:21
Ok.
PlayerData[playerid][pcar] is your vehicle id.
If you check your code it says:
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:
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);
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);}

