19.06.2012, 13:27
Hi guys,
I'm using JernejL MathPlugin. I'm trying to use MPProjectPointOnVehicle function, but it doesn't do what it should.
Using AttachObjectToVehicle is perfect:

But MPProjectPointOnvehicle doesn't work(object is in different pos in different angles)

Please, help someone to fix this
!
Thanks!
I'm using JernejL MathPlugin. I'm trying to use MPProjectPointOnVehicle function, but it doesn't do what it should.
pawn Код:
COMMAND:blablabla(playerid, params[])
{
if( isnull( params ) ) return SendClientMessage( playerid, 0xFF0000FF, "wrong, bla bla bla" );
new
Float:x,
Float:y,
Float:z,
Float:a,
car
;
GetPlayerFacingAngle( playerid, a );
GetPlayerPos( playerid, x, y, z );
if( IsPlayerInAnyVehicle( playerid ) )
{
DestroyVehicle( GetPlayerVehicleID( playerid ) );
RemovePlayerFromVehicle( playerid );
}
car = CreateVehicle( strval( params ), x, y, z, a, 6, 6, 1000 );
PutPlayerInVehicle( playerid, car, 0 );
/*new
obj = CreateObject( 325, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 )
;
AttachObjectToVehicle( obj, car, 0.0, -2.89, 0.0, 0.0, 0.0, 0.0 );*/
new
Float:result[ 3 ]
;
MPProjectPointOnVehicle( car, 0.0, -2.89, 0.0, result[ 0 ], result[ 1 ], result[ 2 ], 1 );
CreateObject( 325, result[ 0 ], result[ 1 ], result[ 2 ], 0.0, 0.0, 0.0 );
return 1;
}

But MPProjectPointOnvehicle doesn't work(object is in different pos in different angles)

Please, help someone to fix this

Thanks!