diff --git a/omp_npc.inc b/omp_npc.inc index 1c5ff99..d396cc1 100644 --- a/omp_npc.inc +++ b/omp_npc.inc @@ -491,7 +491,7 @@ native Float:NPC_GetArmour(npcid); /** * omp_npc */ -native NPC_SetInvulnerable(npcid, bool:toggle); +native NPC_SetInvulnerable(npcid, bool:toggle = true); /** * omp_npc @@ -525,7 +525,7 @@ native NPC_SetWeapon(npcid, WEAPON:weaponid); /** * omp_npc */ -native NPC_GetWeapon(npcid); +native WEAPON:NPC_GetWeapon(npcid); /** * omp_npc @@ -560,7 +560,7 @@ native NPC_GetKeys(npcid, &upAnddown, &leftandRight, &keys); /** * omp_npc */ -native bool:NPC_MeleeAttack(npcid, time, bool:secondaryAttack = false); +native bool:NPC_MeleeAttack(npcid, time = -1, bool:secondaryAttack = false); /** * omp_npc @@ -580,12 +580,12 @@ native NPC_SetFightingStyle(npcid, FIGHT_STYLE:style); /** * omp_npc */ -native NPC_GetFightingStyle(npcid); +native FIGHT_STYLE:NPC_GetFightingStyle(npcid); /** * omp_npc */ -native bool:NPC_EnableReloading(npcid, bool:enable); +native bool:NPC_EnableReloading(npcid, bool:enable = true); /** * omp_npc @@ -600,7 +600,7 @@ native bool:NPC_IsReloading(npcid); /** * omp_npc */ -native bool:NPC_EnableInfiniteAmmo(npcid, bool:enable); +native bool:NPC_EnableInfiniteAmmo(npcid, bool:enable = true); /** * omp_npc @@ -610,7 +610,7 @@ native bool:NPC_IsInfiniteAmmoEnabled(npcid); /** * omp_npc */ -native NPC_GetWeaponState(npcid); +native WEAPONSTATE:NPC_GetWeaponState(npcid); /** * omp_npc @@ -642,7 +642,7 @@ native NPC_SetWeaponState(npcid, WEAPONSTATE:weaponState); * * */ -native NPC_Shoot(npcid, WEAPON:weaponid, hitId, hitType, Float:endPointX, Float:endPointY, Float:endPointZ, Float:offsetX, Float:offsetY, Float:offsetZ, bool:isHit, NPC_ENTITY_CHECK:checkInBetweenFlags = NPC_ENTITY_CHECK_ALL); +native NPC_Shoot(npcid, WEAPON:weaponid, hitId, hitType, Float:endPointX, Float:endPointY, Float:endPointZ, Float:offsetX = 0.0, Float:offsetY = 0.0, Float:offsetZ = 0.0, bool:isHit = true, NPC_ENTITY_CHECK:checkInBetweenFlags = NPC_ENTITY_CHECK_ALL); /** * omp_npc @@ -652,12 +652,12 @@ native bool:NPC_IsShooting(npcid); /** * omp_npc */ -native NPC_AimAt(npcid, Float:pointX, Float:pointY, Float:pointZ, bool:shoot, shootDelay, bool:updateAngle, Float:offsetFromX, Float:offsetFromY, Float:offsetFromZ, NPC_ENTITY_CHECK:checkInBetweenFlags = NPC_ENTITY_CHECK_ALL); +native NPC_AimAt(npcid, Float:pointX, Float:pointY, Float:pointZ, bool:shoot = false, shootDelay = -1, bool:updateAngle = true, Float:offsetFromX = 0.0, Float:offsetFromY = 0.0, Float:offsetFromZ = 0.0, NPC_ENTITY_CHECK:checkInBetweenFlags = NPC_ENTITY_CHECK_ALL); /** * omp_npc */ -native NPC_AimAtPlayer(npcid, playerid, bool:shoot, shootDelay, bool:updateAngle, Float:offsetX, Float:offsetY, Float:offsetZ, Float:offsetFromX, Float:offsetFromY, Float:offsetFromZ, NPC_ENTITY_CHECK:checkInBetweenFlags = NPC_ENTITY_CHECK_ALL); +native NPC_AimAtPlayer(npcid, playerid, bool:shoot = false, shootDelay = -1, bool:updateAngle = true, Float:offsetX = 0.0, Float:offsetY = 0.0, Float:offsetZ = 0.0, Float:offsetFromX = 0.0, Float:offsetFromY = 0.0, Float:offsetFromZ = 0.0, NPC_ENTITY_CHECK:checkInBetweenFlags = NPC_ENTITY_CHECK_ALL); /** * omp_npc @@ -862,7 +862,7 @@ native NPC_GetVehicleHydraThrusters(npcid); /** * omp_npc */ -native NPC_SetVehicleGearState(npcid, gearState); +native NPC_SetVehicleGearState(npcid, LANDING_GEAR_STATE:gearState); /** * omp_npc @@ -919,7 +919,7 @@ native NPC_SetSpecialAction(npcid, SPECIAL_ACTION:actionid); /** * omp_npc */ -native NPC_GetSpecialAction(npcid); +native SPECIAL_ACTION:NPC_GetSpecialAction(npcid); /* native # Playback(); @@ -931,12 +931,12 @@ native /** * omp_npc */ -native bool:NPC_StartPlayback(npcid, const recordName[], bool:autoUnload, Float:startX, Float:startY, Float:startZ, Float:rotX, Float:rotY, Float:rotZ); +native bool:NPC_StartPlayback(npcid, const recordName[], bool:autoUnload = false, Float:startX = 0.0, Float:startY = 0.0, Float:startZ = 0.0, Float:rotX = 0.0, Float:rotY = 0.0, Float:rotZ = 0.0); /** * omp_npc */ -native bool:NPC_StartPlaybackEx(npcid, recordId, bool:autoUnload, Float:startX, Float:startY, Float:startZ, Float:rotX, Float:rotY, Float:rotZ); +native bool:NPC_StartPlaybackEx(npcid, recordId, bool:autoUnload = false, Float:startX = 0.0, Float:startY = 0.0, Float:startZ = 0.0, Float:rotX = 0.0, Float:rotY = 0.0, Float:rotZ = 0.0); /** * omp_npc @@ -946,7 +946,7 @@ native bool:NPC_StopPlayback(npcid); /** * omp_npc */ -native bool:NPC_PausePlayback(npcid, bool:paused); +native bool:NPC_PausePlayback(npcid, bool:paused = true); /** * omp_npc @@ -1072,7 +1072,7 @@ native NPC_GetPathCount(); /** * omp_npc */ -native bool:NPC_AddPointToPath(pathid, Float:x, Float:y, Float:z, Float:stopRange); +native bool:NPC_AddPointToPath(pathid, Float:x, Float:y, Float:z, Float:stopRange = 0.2); /** * omp_npc @@ -1092,7 +1092,7 @@ native NPC_GetPathPointCount(pathid); /** * omp_npc */ -native bool:NPC_GetPathPoint(pathid, pointIndex, &Float:x, &Float:y, &Float:z, &Float:stopRange); +native bool:NPC_GetPathPoint(pathid, pointIndex, &Float:x, &Float:y, &Float:z, &Float:stopRange = 0.2); /** * omp_npc diff --git a/omp_vehicle.inc b/omp_vehicle.inc index 7c99bae..c703b6b 100644 --- a/omp_vehicle.inc +++ b/omp_vehicle.inc @@ -579,9 +579,9 @@ native bool:SetVehiclePos(vehicleid, Float:x, Float:y, Float:z); * The ID of the vehicle to get the z angle of * A float variable in which to store the z rotation, passed by reference * - * * * + * * * * 1: The function executed successfully.
@@ -599,20 +599,8 @@ native bool:GetVehicleZAngle(vehicleid, &Float:angle); * A float variable in which to store the third quaternion angle, passed by reference * A float variable in which to store the fourth quaternion angle, passed by reference * - * - * To euler:
- * - * // GetVehicleRotation Created by IllidanS4
- * stock GetVehicleRotation(vehicleid, &Float:rx, &Float:ry, &Float:rz)
- * {
- * new Float:qw, Float:qx, Float:qy, Float:qz;
- * GetVehicleRotationQuat(vehicleid, qw, qx, qy, qz);
- * rx = asin((2 * qy * qz) - (2 * qx * qw));
- * ry = -atan2((qx * qz) + (qy * qw), 0.5 - (qx * qx) - (qy * qy));
- * rz = -atan2((qx * qy) + (qz * qw), 0.5 - (qx * qx) - (qz * qz));
- * } - *
- *
+ * + * * There is no 'set' variation of this function; you can not SET a vehicle's rotation (apart * from the z angle) * This function may return incorrect values for unoccupied vehicles. The reason is that the @@ -625,6 +613,49 @@ native bool:GetVehicleZAngle(vehicleid, &Float:angle); */ native bool:GetVehicleRotationQuat(vehicleid, &Float:w, &Float:x, &Float:y, &Float:z); +/** + * omp_vehicle + * Gets the actual rotation matrix of the vehicle. + * The ID of the vehicle + * A float variable in which to store the rightX coordinate, passed by reference + * A float variable in which to store the rightY coordinate, passed by reference + * A float variable in which to store the rightZ coordinate, passed by reference + * A float variable in which to store the upX coordinate, passed by reference + * A float variable in which to store the upY coordinate, passed by reference + * A float variable in which to store the upZ coordinate, passed by reference + * A float variable in which to store the atX coordinate, passed by reference + * A float variable in which to store the atY coordinate, passed by reference + * A float variable in which to store the atZ coordinate, passed by reference + * + * + * 1: The function executed successfully.
+ * 0: The function failed to execute. This means the vehicle specified does not exist. + *
+ */ +native bool:GetVehicleMatrix(vehicleid, &Float:rightX, &Float:rightY, &Float:rightZ, &Float:upX, &Float:upY, &Float:upZ, &Float:atX, &Float:atY, &Float:atZ); + +/** + * omp_vehicle + * Returns a vehicle's rotation as euler. + * The ID of the vehicle to get the rotation of + * A float variable in which to store the X axis angle, passed by reference + * A float variable in which to store the Y axis angle, passed by reference + * A float variable in which to store the Z axis angle, passed by reference + * + * + * + * There is no 'set' variation of this function; you can not SET a vehicle's rotation (apart + * from the z angle) + * This function may return incorrect values for unoccupied vehicles. The reason is that the + * third row of the vehicle's internal rotation matrix gets corrupted if it gets updated while unoccupied. + * + * + * 1: The function executed successfully.
+ * 0: The function failed to execute. This means the vehicle specified does not exist. + *
+ */ +native bool:GetVehicleRotation(vehicleid, &Float:x, &Float:y, &Float:z); + /** * omp_vehicle * This function can be used to calculate the distance (as a float) between a vehicle and another