Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- exobjects - Extended object functions.
- kvann 2013, no rights reserved at all.
- */
- #include <a_samp>
- #if defined _exobjects_included
- #endinput
- #endif
- #define _exobjects_included
- /*
- native CountObjects();
- native DestroyAllObjects();
- */
- new exobj_biggestid = -1;
- new exobj_count;
- stock exobj_CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DrawDistance = 0.0)
- {
- new id = CreateObject(modelid, X, Y, Z, rX, rY, rZ, DrawDistance);
- if (id > exobj_biggestid) exobj_biggestid = id;
- exobj_count++;
- return 1;
- }
- #if defined _ALS_CreateObject
- #undef CreateObject
- #else
- #define _ALS_CreateObject
- #endif
- #define CreateObject exobj_CreateObject
- stock exobj_DestroyObject(objectid)
- {
- DestroyObject(objectid);
- exobj_count--;
- return 1;
- }
- #if defined _ALS_DestroyObject
- #undef DestroyObject
- #else
- #define _ALS_DestroyObject
- #endif
- #define DestroyObject exobj_DestroyObject
- stock DestroyAllObjects()
- {
- if (exobj_biggestid != -1) for (new i; i < exobj_biggestid; i++) if (IsValidObject(i)) DestroyObject(i);
- exobj_biggestid = -1;
- exobj_count = 0;
- return 1;
- }
- stock CountObjects() return exobj_count;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement