_______________________________________
CUSTOM ENTITIES DATA
Q: Do you need to handle a large amount of data associated with entities?.
Q: Tired of always using internal entity data (pev -> iuser1, iuser2, fuser1, vuser1, etc...)? .
Q: Ran out of pevs available to use?.
A: Don't worry, here is the solution. Just use this series of functions/stocks that will make your job much easier. And the best thing is that you can work with a wide variety of data, which will be associated with the entity you want (even players [YES, YOU READ WELL, PLAYERS!]).
• WHAT IS THIS UTILITY
Custom Entities Data (CED) is based on the module of the same name published here, which, as its name suggests, allows you to manage an infinite number of data associated with a specific entity.
For example: I have an entity and I want to store the "state" data. So I would do this:
Code: Select all
CED_SetCell(entity, "state", entity_state) Code: Select all
new state
CED_GetCell(entity, "state", state)
print("the entity state is: %d", state) CELLS (they can be integers/floats/logical -> int/float/bool)
STRING
ARRAY
• HOW IS IT USED?
It has 8 main stocks for data management:
● Save/update data:
Code: Select all
CED_SetCell
CED_SetString
CED_SetArray Code: Select all
CED_GetCell
CED_GetString
CED_GetArray● Clears (deletes) all data saved in the entity
Code: Select all
CED_Clear Code: Select all
CED_Free I have never seen the source code of the module, but it is known that since it is a (*theory*) module, it is faster when performing operations (although the times we are living in, your PC will not hang for using this....)
But above all, the named module does not work well, so I found myself in need of making this stock.
• CODE
Inside the include there are several examples for handling data. I will also leave some examples
