GetVehicleModelInfo() trunk of the vehicle -
Noliax8 - 27.01.2014
Hi,
I want to find the position of the trunk of the vehicle, i use GetVehicleModelInfo, i tested VEHICLE_MODEL_INFO_WHEELSREAR, but it's not very good...
http://www.upimg.fr/ih/07rt.png
PHP код:
#define posArr{%0} %0[0],%0[1],%0[2]
GetVehiclePos(ii, posArr{ vPos });
GetVehicleModelInfo(vInfo[ii][veh__model], VEHICLE_MODEL_INFO_WHEELSREAR, posArr{ vInfoPos } );
CreatePickup(1239, 0, (vPos[0] + vInfoPos[0]), (vPos[1] + vInfoPos[1]), (vPos[2] + vInfoPos[2]), -1);
How to get a better position ?
Thanks
Re: GetVehicleModelInfo() trunk of the vehicle -
Kyle - 27.01.2014
Код:
stock GetCenterOfTrunk(vehicleid, &Float:x, &Float:y, &Float:z)
{
new model = GetVehicleModel(vehicleid);
if (!model)
return 0;
new Float:fPosition[5];
GetVehicleZAngle(vehicleid, fPosition[3]);
GetVehiclePos(vehicleid, fPosition[0], fPosition[1], fPosition[2]);
GetVehicleModelInfo(model, VEHICLE_MODEL_INFO_REAR_BUMPER_Z, x, y, z);
fPosition[4] = z;
x += fPosition[0];
y += fPosition[1];
x -= (2.35 * (floatsin(-fPosition[3], degrees)));
y -= (2.35 * (floatcos(fPosition[3], degrees)));
return 1;
}
+1 to Emmet_ who did this for me sometime ago.
Re: GetVehicleModelInfo() trunk of the vehicle -
Jay_ - 27.01.2014
This is not related to SA-MP 0.3z. Please post in the correct section.
Re : GetVehicleModelInfo() trunk of the vehicle -
Noliax8 - 28.01.2014
Sorry Jay_
KyleSmith: That don't work, i don't see the pickup..
pawn Код:
new Float:x, Float:y, Float:z;
for(new ii = 1; ii <= TOTAL_VEHICULES; ii++)
{
GetCenterOfTrunk(ii, x, y, z);
CreatePickup(1239, 0, x, y, z, -1);
}
PS: What it's the "degrees", where this variable is declared ?
Thanks
Re : GetVehicleModelInfo() trunk of the vehicle -
Noliax8 - 29.01.2014
No idйa ?
Re: GetVehicleModelInfo() trunk of the vehicle -
Danyal - 29.01.2014
Hope you can get some idea from This Post:
==>Click Me Post<==
Re: GetVehicleModelInfo() trunk of the vehicle -
Kyle - 29.01.2014
Try increasing the Z height of it. It is probably hiding in the boot.
Also use the appropriate section.