[ H3LP ] Entity members
Hello, is there any way to set values to an entity (life time, for example) by means of a variable?
Instead of: Code:
Something like this: Code:
|
Re: [ H3LP ] Entity members
Code:
- or - Code:
|
Re: [ H3LP ] Entity members
Basically this is a "hack" method, I was thinking of something like bit-fields, but even so, it was worth the try.
|
Re: [ H3LP ] Entity members
Quote:
Bit-fields can only be used to store several boolean values (8) in a single byte. So you can't just store float numbers such as 100.0 in one bit. Also a variable can store up to 32 values (4 bytes * 8 bits = 32 boolean values) and that's the reason why often can be seen, bit-flags to be used for players instead of array of 32 cells. |
Re: [ H3LP ] Entity members
Anything you want to store on entities, you have to do it using the following pev fields
Storing the data in arrays like you were trying is not safe, because entities can get very high indexes Another good alternative is to use klippy's module which allows you to store data on entities Also, don't use these fields on players Code:
pev_iuser - for integers |
Re: [ H3LP ] Entity members
Then it would probably be more feasible to store an array in one of the members if I want to pass several values, however this may cause a conflict in the entity.
|
Re: [ H3LP ] Entity members
Then get this https://forums.alliedmods.net/showthread.php?t=294188
|
Re: [ H3LP ] Entity members
You can store for one entity up to 8 integers (or 24, but it's a bit tricky) and up to 16 floats.
|
Re: [ H3LP ] Entity members
Quote:
|
Re: [ H3LP ] Entity members
You can use also dynamic array.
|
All times are GMT -4. The time now is 06:07. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.