Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(listitem == 1)
- {
- new vehicleid = GetOwnedVehicleID(playerid);
- if (vehicleid == INVALID_VEHICLE_ID) return SendClientMessage(playerid, RED1, "Você não tem um veículo.");
- if(!IsPlayerInVehicle(playerid, vehicleid)) return SendClientMessage(playerid, RED1, "Você precisa estar em seu Veículo.");
- VehicleInfo[vehicleid][vPark] = 1;
- GetVehiclePos(vehicleid, VehicleInfo[vehicleid][vPX], VehicleInfo[vehicleid][vPY], VehicleInfo[vehicleid][vPZ]);
- GetVehicleZAngle(vehicleid, VehicleInfo[vehicleid][vPA]);
- format(string, sizeof string, "|- Você estacionou seu veículo nesse local -|");
- SavePlayerVehicle(playerid);
- SendClientMessage(playerid, GREEN1, string);
- }
- forward SavePlayerVehicle(playerid);
- public SavePlayerVehicle(playerid)
- {
- new string[256];
- format(string, 128, VEH_SAVE_FILE, PlayerName(playerid));
- if (GetOwnedVehicleID(playerid) == INVALID_VEHICLE_ID) return 1;
- new File:vehs = fopen(string, io_write);
- if (vehs)
- {
- new vic = GetOwnedVehicleID(playerid);
- printf("vehicle name: %s", VehicleInfo[vic][vName]);
- format(string, sizeof(string), "%d|%f|%f|%f|%f|%d|%d|%d|%s|%s|%d|%d|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d",
- VehicleInfo[vic][vModel],
- VehicleInfo[vic][vX],
- VehicleInfo[vic][vY],
- VehicleInfo[vic][vZ],
- VehicleInfo[vic][vA],
- VehicleInfo[vic][vColor1],
- VehicleInfo[vic][vColor2],
- VehicleInfo[vic][vPaintjob],
- VehicleInfo[vic][vName],
- VehicleInfo[vic][vOwner],
- VehicleInfo[vic][vLock],
- VehicleInfo[vic][vPark],
- VehicleInfo[vic][vPX],
- VehicleInfo[vic][vPY],
- VehicleInfo[vic][vPZ],
- VehicleInfo[vic][vPA],
- VehicleInfo[vic][vMod][0],
- VehicleInfo[vic][vMod][1],
- VehicleInfo[vic][vMod][2],
- VehicleInfo[vic][vMod][3],
- VehicleInfo[vic][vMod][4],
- VehicleInfo[vic][vMod][5],
- VehicleInfo[vic][vMod][6],
- VehicleInfo[vic][vMod][7],
- VehicleInfo[vic][vMod][8],
- VehicleInfo[vic][vMod][9],
- VehicleInfo[vic][vMod][10],
- VehicleInfo[vic][vMod][11]
- );
- fwrite(vehs, string);
- fclose(vehs);
- VehicleInfo[vic][vModel] = 0;
- VehicleInfo[vic][vX] = 0;
- VehicleInfo[vic][vY] = 0;
- VehicleInfo[vic][vZ] = 0;
- VehicleInfo[vic][vA] = 0;
- VehicleInfo[vic][vColor1] = -1;
- VehicleInfo[vic][vColor2] = -1;
- VehicleInfo[vic][vPaintjob] = -1;
- format(VehicleInfo[vic][vName], MAX_PLAYER_NAME, "[NONE]");
- format(VehicleInfo[vic][vOwner], MAX_PLAYER_NAME, "[NONE]");
- VehicleInfo[vic][vPark] = 0;
- VehicleInfo[vic][vPX] = 0;
- VehicleInfo[vic][vPY] = 0;
- VehicleInfo[vic][vPZ] = 0;
- VehicleInfo[vic][vPA] = 0;
- for(new m = 0; m < MAX_MODS; m++) VehicleInfo[vic][vMod][m] = 0;
- CarConce[vic] = 0;
- TOTAL_CARROS--;
- if(VehicleInfo[vic][SoundCar] == 1086) RemoveSound(vic);
- DestroyVehicle(vic);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement