2021-01-20, 01:55 AM
(2021-01-20, 01:49 AM)Behemoth Wrote: Can you paste the code for the function "UpdatePlayerVehicleParkPosition"?
Sure thing.
Code:
stock UpdatePlayerVehicleParkPosition(playerid, playervehicleid, Float:newx, Float:newy, Float:newz, Float:newangle, Float:health)
{
? ? new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerVehicleInfo[playerid][playervehicleid][pvId] != INVALID_PLAYER_VEHICLE_ID)
{
if(!isnull(PlayerVehicleInfo[playerid][playervehicleid][pvPlate])) {
SetVehicleNumberPlate(playervehicleid, PlayerVehicleInfo[playerid][playervehicleid][pvPlate]);
}
new Float:oldx, Float:oldy, Float:oldz, Float: oldfuel;
oldx = PlayerVehicleInfo[playerid][playervehicleid][pvPosX];
oldy = PlayerVehicleInfo[playerid][playervehicleid][pvPosY];
oldz = PlayerVehicleInfo[playerid][playervehicleid][pvPosZ];
if(oldx == newx && oldy == newy && oldz == newz) return 0;
PlayerVehicleInfo[playerid][playervehicleid][pvPosX] = newx;
PlayerVehicleInfo[playerid][playervehicleid][pvPosY] = newy;
PlayerVehicleInfo[playerid][playervehicleid][pvPosZ] = newz;
PlayerVehicleInfo[playerid][playervehicleid][pvPosAngle] = newangle;
oldfuel = Gas[PlayerVehicleInfo[playerid][playervehicleid][pvId]];
Gas[PlayerVehicleInfo[playerid][playervehicleid][pvId]] = 100.0;
for(new c=0; c<12; c) {
RemoveVehicleComponent(playervehicleid, c);
}
//UpdatePlayerVehicleMods(playerid, playervehicleid);
DestroyVehicle(PlayerVehicleInfo[playerid][playervehicleid][pvId]);
new carcreated = AddStaticVehicleEx(PlayerVehicleInfo[playerid][playervehicleid][pvModelId], PlayerVehicleInfo[playerid][playervehicleid][pvPosX], PlayerVehicleInfo[playerid][playervehicleid][pvPosY], PlayerVehicleInfo[playerid][playervehicleid][pvPosZ],
PlayerVehicleInfo[playerid][playervehicleid][pvPosAngle],PlayerVehicleInfo[playerid][playervehicleid][pvColor1], PlayerVehicleInfo[playerid][playervehicleid][pvColor2], -1);
? ? ? ? PlayerVehicleInfo[playerid][playervehicleid][pvId] = carcreated;
? ? ? ? Gas[carcreated] = oldfuel;
? ? ? ? // SetVehicleNumberPlate(carcreated, PlayerVehicleInfo[playerid][playervehicleid][pvNumberPlate]);
? ? ? ? SetVehicleHealth(carcreated, health);
if(PlayerVehicleInfo[playerid][playervehicleid][pvLocked] == 1) LockPlayerVehicle(playerid, PlayerVehicleInfo[playerid][playervehicleid][pvId], PlayerVehicleInfo[playerid][playervehicleid][pvLock]);
? ? ? ? //LoadPlayerVehicleMods(playerid, playervehicleid);
? ? ? ? return 1;
}
return 0;
}