-
Notifications
You must be signed in to change notification settings - Fork 47
Functions
Nexius edited this page Aug 12, 2021
·
9 revisions
- Returns:
- 0 when there is no data loaded (ex. when you don't have the data file)
- 1 when loaded map successfully or was already loaded
- Parameters:
modelid: The model to be removedFloat:x, Float:y, Float:z: The coordinates in which the objects will be removedFloat:radius: The radius around the specified point to remove from- Returns:
- 0 when the map is already initialized
- 1 when successfully removed
- Remarks:
- You must use this function before using
CA_Init
- Parameters:
modelid: The model to be restoredFloat:x, Float:y, Float:z: The coordinates in which the objects will be restoredFloat:radius: The radius around the specified point to restored from- Returns:
- 0 when the map is not initialized
- 1 when successfully restored
- Remarks:
- You must use this function after using
CA_Init
- Parameters:
Float:StartX, Float:StartY, Float:StartZ: The beginning point of the rayFloat:EndX, Float:EndY, Float:EndZ: The ending point of the ray&Float:x, &Float:y, &Float:z: The point that the ray collided- Returns:
- 0 if the ray didn't collide with anything
- WATER_OBJECT if the ray collided with water
- The model of the object the ray collided
- Parameters:
Float:StartX, Float:StartY, Float:StartZ: The beginning point of the rayFloat:EndX, Float:EndY, Float:EndZ: The ending point of the ray&Float:x, &Float:y, &Float:z: The point that the ray collided- Returns:
- -1 if the ray collided with a static object or water
- 0 if the ray didn't collide with anything
- The index of the object the ray collided
- Remarks:
- This only works with objects created with
addenabled inCA_CreateObject, such as the objects created by the "_DC" functions
- Parameters:
type: The extra ID indexFloat:StartX, Float:StartY, Float:StartZ: The beginning point of the rayFloat:EndX, Float:EndY, Float:EndZ: The ending point of the ray&Float:x, &Float:y, &Float:z: The point that the ray collided- Returns:
- -1 if the ray collided with a static object or water
- -1 if the extra ID is unmodified
- 0 if the ray didn't collide with anything
- The index of the object the ray collided
- Remarks:
- This only works with objects created with
addenabled inCA_CreateObject, such as the objects created by the "_DC" functions
- Parameters:
Float:StartX, Float:StartY, Float:StartZ: The beginning point of the rayFloat:EndX, Float:EndY, Float:EndZ: The ending point of the rayFloat:retx[], Float:rety[], Float:retz[]: The points that the ray collidedFloat:retdist[]: The distances between the beginning point and the point collidedModelIDs[]: The object models that the ray collidedsize = sizeof(retx): The maximum number of points to collide- Returns:
- -1 if the ray collided with more points than than permitted by the
sizeparameter- 0 if the ray didn't collide with anything
- The number of points collided
- Remarks:
- Currently doesn't order points in order of collision (you can still use the distances to sort them)
- Parameters:
Float:StartX, Float:StartY, Float:StartZ: The beginning point of the rayFloat:EndX, Float:EndY, Float:EndZ: The ending point of the ray&Float:x, &Float:y, &Float:z: The point that the ray collided&Float:rx, &Float:ry, &Float:rz: The rotation of the face that the ray collided- Returns:
- 0 if the ray didn't collide with anything
- WATER_OBJECT if the ray collided with water
- The model of the object the ray collided
- Parameters:
Float:StartX, Float:StartY, Float:StartZ: The beginning point of the rayFloat:EndX, Float:EndY, Float:EndZ: The ending point of the ray&Float:x, &Float:y, &Float:z: The point that the ray collided&Float:nx, &Float:ny, &Float:nz: The reflection vector of the face that the ray collided- Returns:
- 0 if the ray didn't collide with anything
- WATER_OBJECT if the ray collided with water
- The model of the object the ray collided
- Parameters:
Float:StartX, Float:StartY, Float:StartZ: The beginning point of the rayFloat:EndX, Float:EndY, Float:EndZ: The ending point of the ray&Float:x, &Float:y, &Float:z: The point that the ray collided&Float:nx, &Float:ny, &Float:nz: The surface normal of the face that the ray collided- Returns:
- 0 if the ray didn't collide with anything
- WATER_OBJECT if the ray collided with water
- The model of the object the ray collided
- Parameters:
modelid: The object model to be testedFloat:x, Float:y, Float:z: The object position to testFloat:rx, Float:ry, Float:rz: The object rotation to test- Returns:
- 0 if the object model doesn't collide with the world with the specified
- 1 otherwise
- Parameters:
Float:rx, Float:ry, Float:rz: GTA euler rotations to be converted&Float:x, &Float:y, &Float:z, &Float:w: The quaternion angles returned- Returns:
- Always 1
- Parameters:
&Float:x, &Float:y, &Float:z, &Float:w: The quaternion angles to be convertedFloat:rx, Float:ry, Float:rz: GTA euler rotations returned- Returns:
- Always 1
- Parameters:
modelid: The object model&Float:offx, &Float:offy, &Float:offz: The offset of the model's bounding sphere&Float:radius: The radius of the model's bounding sphere- Returns:
- 0 if the model is invalid
- 1 otherwise
- Parameters:
modelid: The object model&Float:minx, &Float:miny, &Float:minz: The "minimum" point of the model's bounding box&Float:maxx, &Float:maxy, &Float:maxz: The "maximum" point of the model's bounding box- Returns:
- 0 if the model is invalid
- 1 otherwise
- Parameters:
index: The index of the ColAndreas objecttype: The index of the extra ID to be set (from 0 to 9)data: The data stored in the extra ID- Returns:
- Always 1 (which needs to be changed to be like CA_GetObjectExtraID's returns...)
- Parameters:
index: The index of the ColAndreas objecttype: The index of the extra ID to be set- Returns:
- -1 if the index or type is invalid
- The data stored in the extra ID
- Parameters:
Float:StartX, Float:StartY, Float:StartZ: The beginning point of the rayFloat:EndX, Float:EndY, Float:EndZ: The ending point of the ray&Float:x, &Float:y, &Float:z: The point that the ray collided&Float:rx, &Float:ry, &Float:rz, &Float:rw: The quaternion rotation of the object that the ray collided&Float:cx, &Float:cy, &Float:cz: The position of the object that the ray collided- Returns:
- 0 if the ray didn't collide with anything
- WATER_OBJECT if the ray collided with water
- The model of the object the ray collided
- Parameters:
Float:StartX, Float:StartY, Float:StartZ: The beginning point of the rayFloat:EndX, Float:EndY, Float:EndZ: The ending point of the ray&Float:x, &Float:y, &Float:z: The point that the ray collided&Float:rx, &Float:ry, &Float:rz: The rotation of the face that the ray collided&Float:ocx, &Float:ocy, &Float:ocz: The position of the object that the ray collided&Float:orx, &Float:ory, &Float:orz: The rotation of the object that the ray collided- Returns:
- 0 if the ray didn't collide with anything
- WATER_OBJECT if the ray collided with water
- The model of the object the ray collided
- Parameters:
newid: Custom model id to be added to col. pooldffFileName: Dff file path you want to load its collision- Returns:
- -1 if plugin couldn't find/open file (related to permissions or wrong path)
- 0 if dff file had no collision or corrupted data
- 1 if loading dff file and reading collision data was successful objects)
- Remarks:
- Loads collision from given dff file to support SA-MP 0.3DL custom models.
- Parameters:
modelid: The collision model to createFloat:x, Float:y, Float:z: The position in which to create the collision modelFloat:rx, Float:ry, Float:rz: The rotation of the collision modelbool:add = false: Whether or not to store this objects index for manual management- Returns:
- -1 if the specified model has no collision (should be changed to -2, to avoid confusion with unmanaged objects)
- -1 if
addis false- The index of the created collision object
- Remarks:
- ONLY CREATES THE COLLISION, NOT THE IN-GAME OBJECT
- Parameters:
index: The index of the object to be destroyed- Returns:
- -1 if the specified model has no collision (should be changed to -2, to avoid confusion with unmanaged objects)
- -1 if
addis false- The index of the created collision object
- Parameters:
index: Checks if an object with the ID provided exists- Returns:
- -1 if the specified model has no collision
- 0 if the object does not exist
- 1 if the object exists
- Parameters:
index: The index of the object to be movedFloat:x, Float:y, Float:z: The new position- Returns:
- 0 if the object doesn't exist
- 1 if the new position was set successfully
- Parameters:
index: The index of the object to be movedFloat:rx, Float:ry, Float:rz: The new rotation- Returns:
- 0 if the object doesn't exist
- 1 if the new rotation was set successfully
- Parameters:
modelid: The model to createFloat:x, Float:y, Float:z: The position in which to create the objectFloat:rx, Float:ry, Float:rz: The rotation of the objectFloat:drawdistance = 300.0: Whether or not to store this objects index for manual management- Returns:
- -1 if the object couldn't be created
- -1 if there are too many "DC" objects
- The "DC" index of the created object
- Remarks:
- The index returned by this function can only be used by "DC" functions
- Parameters:
index: The DC index of the object to destroy- Returns:
- -1 if the index is invalid
- -1 if the object doesn't exist
- 1 or next interator index if the object was destroyed
- Parameters:
index: The DC index of the object to be movedFloat:x, Float:y, Float:z: The new position- Returns:
- -1 if the index is invalid
- -1 if the object doesn't exist
- 1 if the new position was set successfully
- Parameters:
index: The DC index of the object to be movedFloat:rx, Float:ry, Float:rz: The new rotation- Returns:
- -1 if the index is invalid
- -1 if the object doesn't exist
- 1 if the new rotation was set successfully
- Remarks:
- Destroys all DC objects
- Remarks:
- The ColAndreas alternative for MapAndreas's entire function
- This function does everything MapAndreas is capable of doing, and without the ground limit
- Returns:
- Every collided point as an array
- Remarks:
- Explode ray casts in every direction
- Parameters:
playerid: The playerid to checkFloat:tolerance = 1.5: The distance to check for the ground- Returns:
- 0 if the player is not on the ground
- 1 if the player is on the ground
- Parameters:
vehicleid: The vehicleid to checkFloat:tolerance = 1.5: The distance to check for the ground- Returns:
- 0 if the vehicle is not on the ground
- 1 if the vehicle is on the ground
- Returns:
- Always 1
- Remarks:
- Removes all of the barrier object collisions
- You must use this function before using
CA_Init
- Returns:
- Always 1
- Remarks:
- Removes all of the breakable object collisions
- You must use this function before using
CA_Init
- Parameters:
playerid: The playerid to check&Float:depth: The lowest collision point found&Float:playerdepth: How deep the player is below the surface- Returns:
- 0 if the player is not in water
- 1 if the player is in water
- Parameters:
vehicleid: The vehicleid to check&Float:depth: The lowest collision point found&Float:vehicledepth: How deep the vehicle is below the surface- Returns:
- 0 if the vehicle is not in water
- 1 if the vehicle is in water
- Parameters:
playerid: The playerid to checkFloat:dist = 3.0: The distance to check for waterFloat:height = 3.0: The height the player can be from the water- Returns:
- 0 if the player is not near water
- 1 if the player is near water
- Remarks:
- Checks for water all around the player
- Parameters:
vehicleid: The vehicleid to checkFloat:dist = 3.0: The distance to check for waterFloat:height = 3.0: The height the vehicle can be from the water- Returns:
- 0 if the vehicle is not near water
- 1 if the vehicle is near water
- Remarks:
- Checks for water all around the vehicle
- Parameters:
playerid: The playerid to checkFloat:dist = 3.0: The distance to check for waterFloat:height = 3.0: The height the player can be from the water- Returns:
- 0 if the player is not facing water
- 1 if the player is facing water
- Remarks:
- Checks for water only in front of the player
- Parameters:
vehicleid: The vehicleid to checkFloat:dist = 3.0: The distance to check for waterFloat:height = 3.0: The height the vehicle can be from the water- Returns:
- 0 if the vehicle is not facing water
- 1 if the vehicle is facing water
- Remarks:
- Checks for water only in front of the vehicle
- Parameters:
playerid: The playerid to checkFloat:dist = 1.5: The distance to check for a wallFloat:height = 0.5: The height the wall can be from the ground- Returns:
- 0 if the player is not blocked
- 1 if the player is blocked
- Parameters:
vehicleid: The vehicleid to checkFloat:dist = 1.5: The distance to check for a wallFloat:height = 0.5: The height the wall can be from the ground- Returns:
- 0 if the vehicle is not blocked
- 1 if the vehicle is blocked
- Parameters:
Float:x, Float:y, Float:z: A point in the area to be checked- Returns:
- 0.0 if there is either no floor or no ceiling
- The distance from the ceiling to the floor
- Parameters:
Float:x, Float:y, Float:z: A point in the area to be checked&Float:m_x, &Float:m_y: The center X and Y of the area- Returns:
- -1.0 if there isn't enough collisions to determine the center
- The radius of the circle formed by the test
- CA_Init
- CA_RemoveBuilding
- CA_RestoreBuilding
- CA_RayCastLine
- CA_RayCastLineID
- CA_RayCastLineExtraID
- CA_RayCastMultiLine
- CA_RayCastLineAngle
- CA_RayCastReflectionVector
- CA_RayCastLineNormal
- CA_ContactTest
- CA_EulerToQuat
- CA_QuatToEuler
- CA_GetModelBoundingSphere
- CA_GetModelBoundingBox
- CA_SetObjectExtraID
- CA_GetObjectExtraID
- CA_RayCastLineEx
- CA_RayCastLineAngleEx
- CA_LoadFromDff
- CA_CreateObject
- CA_DestroyObject
- CA_IsValidObject
- CA_SetObjectPos
- CA_SetObjectRot
- CA_CreateObject_DC
- CA_DestroyObject_DC
- CA_SetObjectPos_DC
- CA_SetObjectRot_DC
- CA_DestroyAllObjects_DC
- CA_FindZ_For2DCoord
- CA_RayCastExplode
- CA_IsPlayerOnSurface
- CA_IsVehicleOnSurface
- CA_RemoveBarriers
- CA_RemoveBreakableBuildings
- CA_IsPlayerInWater
- CA_IsVehicleInWater
- CA_IsPlayerNearWater
- CA_IsVehicleNearWater
- CA_IsPlayerFacingWater
- CA_IsVehicleFacingWater
- CA_IsPlayerBlocked
- CA_IsVehicleBlocked
- CA_GetRoomHeight
- CA_GetRoomCenter
Credits:
Pottus, Chris420, and Slice - Original ColAndreas Plugin
uint32 - Linux and other build fixes, fixed SA-MP object support
codectile - Helped with stuff
Crayder - New functions, water planes fix, future support