Linking an Entity to a Bool
How would I link a bool to an entity?
For example, to set the player's id with a bool, I'd do PHP Code:
I'd need something like this PHP Code:
|
Re: Linking an Entity to a Bool
Just find the range of possible values of what you are using it for. If the biggest value is 100 then you would need to dimension the array with 101.
|
Re: Linking an Entity to a Bool
I'm aware of the fact that I need to get the maximum value of what I need, but I'm unsure as to how to find it. For example, if I was trying to link this to a deagle, would I need to set the value to the maximum amount of weapons? Or would I set it to the maximum amount of deagles, etc.
|
Re: Linking an Entity to a Bool
If you mean that you need one for every deagle that has been spawned then it would need to be at least the number of deagles. But, I don't think that would work even. The entitiy number could be some huge number like 2639 (exagerated???; idk). If that was the case then you would need to dimension it very large.
Better yet, I think you should use some sort of lookup table of all the deagles that exist. This way you would only need to dimension for how many deagles exist at any one point in time. I don't know the finer details of how it would work this way but it's an idea. If you tell us what you are trying to do then there might be better hope for the best solution for you. P.S. I might not be the best person to ask either :). |
Re: Linking an Entity to a Bool
What I'm trying to do is get each pistol and set different properties to the different pistols in the map. So, what I'd probably need to do is get the amount and set the entities to have different properties using bools.
So I'd do something like PHP Code:
|
Re: Linking an Entity to a Bool
|
Re: Linking an Entity to a Bool
Quote:
|
Re: Linking an Entity to a Bool
Kinda offtopic:
You could get down to one array by using the bits of the array entries for the properties. PHP Code:
|
Re: Linking an Entity to a Bool
yea, loop from maxplayers+1 to glb_maxentities and check to see if the entity is valid and if its the weapon you are looking for. use cs_get_weapon_id to check what type of weapon the entity is; the func returns the weapon index CSW_ const
|
Re: Linking an Entity to a Bool
You should use pev values.
Code:
|
| All times are GMT -4. The time now is 07:25. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.