Example #1
0
int CVehicleNatives::GetRotation(SQVM * pVM)
{
	CVehicle * pVehicle = sq_tovehicle(pVM, 2);

	if(pVehicle)
	{
		CVector3 vecPos;
		pVehicle->GetRotation(vecPos);
		sq_pushvector3(pVM, &vecPos);
	}
	else
		sq_pushnull(pVM);

	return 1;
}
// getVehicleRotation(vehicleid)
CVector3 CVehicleModuleNatives::GetRotation(EntityId vehicleId)
{
    if(g_pVehicleManager->DoesExist(vehicleId))
    {
        CVehicle * pVehicle = g_pVehicleManager->GetAt(vehicleId);

        if(pVehicle)
        {
            CVector3 vecRotation;
            pVehicle->GetRotation(vecRotation);
            return vecRotation;
        }
    }

    return CVector3();
}