GetVehicleModelInfo() trunk of the vehicle
#1

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(iiposArrvPos });
GetVehicleModelInfo(vInfo[ii][veh__model], VEHICLE_MODEL_INFO_WHEELSREARposArrvInfoPos } );
CreatePickup(12390, (vPos[0] + vInfoPos[0]), (vPos[1] + vInfoPos[1]), (vPos[2] + vInfoPos[2]), -1); 
How to get a better position ?
Thanks
Reply
#2

Код:
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.
Reply
#3

This is not related to SA-MP 0.3z. Please post in the correct section.
Reply
#4

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
Reply
#5

No idйa ?
Reply
#6

Hope you can get some idea from This Post: ==>Click Me Post<==
Reply
#7

Try increasing the Z height of it. It is probably hiding in the boot.

Also use the appropriate section.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)