I'm working on gather script and its almost done but it needs map voting system.
I've searched on google for vote/poll systems but none of them really helps me. Mainly because they were simple yes/no scripts.
System needs to work this way:
- It has a file with all allowed maps you can vote for.
- When voting starts gather players can use command !vote <mapname> ( Reading allowed maps from file ) this would increase vote count for the map.
- It needs to keep count of all voted maps with their names and votes
- Voting will be stopped IF one option gets most votes ( maxplayers / 2 + 1 )
My question is how this can be done? I'm not saying that anyone should do it for me i just need some ideas what would be the best way to do this. But if someone is up for scripting it i wouldn't mind a bit.
Thanks.
EDIT: Managed to do something like this with hash tables and bubble sort type of thing to sort the votes. I'm wondering if there's a better way.