Skip to content
Corey Iles edited this page Apr 14, 2019 · 18 revisions

Welcome to the ColAndreas wiki!

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.

San Andreas Map

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.

Object Manager

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.
  • ColAndreas Object Manager Functions

    • 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 the add parameter being true.
      • These collisions and objects can be destroyed and accessed like regular objects.
    • CA_CreateObject_SC and CA_CreateDynamicObject_SC

      • These functions work just like the _DC functions, however...
      • Since these are appended by _SC, the collisions are created with the add 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.