[ H3LP ] Position by votes
Hello. Could someone show me a hud example of how can i order strings by number of votes? I need that for a plugin that I'm working on and I tried my best, but I failed doing it and can't find any tuts on how to do it. Any help would be appreciated. Thanks !
|
Re: [ H3LP ] Position by votes
How do you handle votes and strings?
|
Re: [ H3LP ] Position by votes
Quote:
Here is what I did so far Code:
|
Re: [ H3LP ] Position by votes
Any ideas anyone?
|
Re: [ H3LP ] Position by votes
Have you searched for the various search algorithms? I know that there are threads that discuss sorting around here.
|
Re: [ H3LP ] Position by votes
Quote:
|
Re: [ H3LP ] Position by votes
Quote:
|
Re: [ H3LP ] Position by votes
Quote:
|
Re: [ H3LP ] Position by votes
A basic way of sorting an array is:
PHP Code:
Ideally you would have an array that contains both the votes and the map name, by using an enum. Then you sort the array by the points and on the first/last slot(depending on how you sort) will be the most voted map name. |
Re: [ H3LP ] Position by votes
Quote:
Code:
|
| All times are GMT -4. The time now is 23:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.