[ H3LP ] Getting from Array?
Hello, how to get direct values from a Array? For example, I want do a "filter" into the Array and only get items that can have "number" 1 or only 2.
Code:
|
Re: [ H3LP ] Getting from Array?
You can't. Just retrieve the array, and check afterward.
|
Re: [ H3LP ] Getting from Array?
Ok, I think its possible skip the loop if the number of weapon dont is equal what I need.
|
Re: [ H3LP ] Getting from Array?
PHP Code:
|
Re: [ H3LP ] Getting from Array?
Maybe there's a better way of doing things here.
As long as you provide an example that is not describing your actual code accurately there's nothing we can do. A good way to avoid loops is using custom entity values which could point to a more specific data point or even an array handle. Perhaps there's a better way of organizing the data in the arrays to make it more accessable. Dynamic arrays within dynamic arrays sounds like a stupid idea but can be very clever in some cases. Tries can be used with "custom pointers" so you don't have to search. But it all depends on what you're doing. Also, there's no point of avoiding loops if your action is reacting to, for example, a chat command which is not frequently called. |
Re: [ H3LP ] Getting from Array?
Hmm, Ok then, I wil do some tests, after I tell the result.
|
Re: [ H3LP ] Getting from Array?
Solved.
|
| All times are GMT -4. The time now is 17:52. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.