-
Notifications
You must be signed in to change notification settings - Fork 46
Home
Visit the Instructions page for information on building or installing the plugin.
Visit the Functions page for a list of function provided by this include and plugin, as well as parameter, syntax, and return information.
There are two main functions in this entire library that handle the San Andreas native map, CA_Init
and CA_RemoveBuilding
. They are both really easy to use as long as you are using them in the right order.
The SA map is not loaded by default, you must use CA_Init
to do that. That is all the function does.
If you remove buildings from the SA map and there collision should not be loaded, you must use CA_RemoveBuilding
before loading the map with CA_Init
.
There's also CA_RemoveBarriers
to remove all of the native SA barriers (that block the bridges and other areas) and CA_RemoveBreakableBuildings
to remove fences, haystacks, and other breakable objects. ColAndreas can't detect when these objects are broken, so you must use this function if you don't want floating collisions when they break.
Notice, in the include there wrapper functions for creating _SC
and _DC
objects. These functions represent the object manager provided by the include. These are NOT REQUIRED for creating the collisions! These are simply wrapper functions for CA_CreateObject
, SA-MP's CreateObject
, and Streamer's CreateDynamicObject
.
I will explain the difference between CA_CreateObject
, CA_CreateObject_DC
, CA_CreateObject_SC
, CA_CreateDynamicObject_DC
, and CA_CreateDynamicObject_SC
.
-
- This function creates ONLY the ColAndreas collision. When using this function, ColAndreas will add the specified model's mesh to it's map.
- Important note, this functions
add
parameter controls whether the ColAndreas collision will be stored with an accessible ID or not.- When set to true, you can store the collision's index and use that to delete, move, or access information from the collision.
- When false, the collision is added to the ColAndreas and cannot be removed. This would be used for example when the object is not going to be moved or deleted like the SA map when loaded by
CA_Init
.
-
- These all use the object manager provided in the include.
-
CA_CreateObject_DC and CA_CreateDynamicObject_DC
- These functions create either a regular SA-MP object or Streamer object, as well as the ColAndreas collision.
- Since these functions are appended by
_DC
, the collisions are created with theadd
parameter being true. - These collisions and objects can be destroyed and accessed like regular objects.
-
- These functions work just like the
_DC
functions, however... - Since these are appended by
_SC
, the collisions are created with theadd
parameter being false. - These return the objects ID, but the collision is not managed with the object. If you destroy these objects, the collision will remain in the ColAndreas map.
- As mentioned before, this would be for objects that you do not plan on moving or destroying. Like CA_Init.
- These functions work just like the
- 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