ColAndreas v1.4.0
Adds 4 new natives:
CA_RayCastLineID(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z);
CA_RayCastLineExtraID(type, Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z);
CA_SetObjectExtraID(index, type, data);
CA_GetObjectExtraID(index, type);
CA_RayCastLineID
- Instead of returning the model ID of the collided object, this will return the ColAndreas index.
CA_RayCastLineExtraID
- Instead of returning the model ID of the collided object, this will return the extra data stored at the
type
parameter. The 'type's are set byCA_SetObjectExtraID
. - Returns '-1' when an invalid
type
was specified (something outside of 0 through 9).
CA_SetObjectExtraID
- This sets the extra data stored at
type
of the specified ColAndreas object.
CA_GetObjectExtraID
- This returns the extra data stored at
type
of the specified ColAndreas object.
Along with these also comes a set of new definitions labeled CA_EXTRA_1
through CA_EXTRA_10
. These are just example definitions and can easily be defined by the user in there script. They are just numbers from 0 to 9, which are the valid 'type's of extra data. For example, if a user needed to know the streamer ID of a collided object they could do this:
// Before anything
#define CA_STREAMER_ID 0
new testObj;
// Creating the object
testObj = CA_CreateDynamicObject_DC(3095, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0);
CA_SetObjectExtraID(testObj, CA_STREAMER_ID, CA_ObjectList[testObj][ObjectID]);
// Later, with a ray cast
new streamerID = CA_RayCastLineExtraID(CA_STREAMER_ID, 0.0, 0.0, 20.0, 0.0, 0.0, 0.0, sX, sY, sZ);