You need to have a list of offsets for different cars for example...
Код:
new enum VehicleOffsetData { vOffX, vOffY, vOFFz, vOFFRX, vOFFRY, vOFFRZ, bool:vUseOffset }
stock const vOffSets[][VehicleOffsetData] = {
{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, true },
{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, true },
{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false }
};
stock GetOffSetIndex(modelid) { return modelid - 400; }
}
Now when they get in the vehicle do something like
Код:
new offindex = GetOffSetIndex(GetVehicleModel(p));
if(vOffSets[offindex][vUseOffset])
{
obj[playerid] = CreatePlayerObject(playerid,19300, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 100);
AttachPlayerObjectToVehicle(playerid,obj[playerid],p,
vOffSets[offindex][vOffX],
vOffSets[offindex][vOffY],
vOffSets[offindex][vOffZ],
vOffSets[offindex][vOffRX],
vOffSets[offindex][vOffRY],
vOffSets[offindex][vOffRZ]);
}
It's not going to work for every vehicle as well that is the reason for checking if a vehicle can use offsets you probably won't use the rotation offsets but i'm guessing they could be useful.
Additionally you could also expand that array to include offsets for each seat in the vehicle. I hope all these helps BTW you did rip this script off from here
https://sampforum.blast.hk/showthread.php?tid=324233 so you should give the guy some credit.
His Script -> obj[playerid] = CreatePlayerObject(playerid,19300, 0.0000, -1282.9984, 10.1493, 0.0000, -1, -1, 100);
Your Script ->obj[playerid] = CreatePlayerObject(playerid,19300, 0.0000, -1282.9984, 10.1493, 0.0000, -1, -1, 100);
Same useless nonsensical offsets.