Author Topic: !nextmap  (Read 1827 times)

0 Members and 1 Guest are viewing this topic.

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
!nextmap
« on: April 21, 2007, 09:44:03 pm »
Sry this is my first time posting in this section so here it goes:
It would be great to have a !nextmap feature that one can type during anytime of a round and the person's count would be added to how many this vote there alreayd are.  So if like the map ctf_death is played and people don't like it 3 of them would !nextmap immediately and eventually 2 more would !nextmap and (say) 5 is needed to pass the vote.  Of course if a player leaves, his vote would be removed - and of course there's a server-defined passrate of, for example 75% or more.
Often I've played a map that most of the players disliked but the map that was voted for some didn't like either so it didn't get through.  Also, it sometimes takes a while until more people get tired of the map so they'll !nextmap and add to the vote-pool.  Plus, this is really ez to implement I'm sure...
Can't think of anything original to put here...

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: !nextmap
« Reply #1 on: April 21, 2007, 11:10:12 pm »
It's simple to make really, but unfortunately the OnleaveGame always returns an ID of 0.
So it looks like a 2.6 script.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: !nextmap
« Reply #2 on: April 22, 2007, 04:40:33 am »
you dont need the OnLeaveGame ID, just reduce the counter by 1.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: !nextmap
« Reply #3 on: April 22, 2007, 09:17:15 am »
you dont need the OnLeaveGame ID, just reduce the counter by 1.

of course only if a person who voted actually leaves...
Can't think of anything original to put here...

Offline iftach

  • Major(1)
  • Posts: 16
Re: !nextmap
« Reply #4 on: April 25, 2007, 11:15:21 am »
I fail to see the problem. You have the leaving player nickname, meaning, you can do NameToID.

here is my code:
http://forums.soldat.pl/index.php?topic=13382.0

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: !nextmap
« Reply #5 on: April 26, 2007, 03:23:44 pm »
hey yeah - honestly I don't see what the problem is either but then again, I'm not familiar with how to server-script...  In any case, I thought it would be as simple as (in simplified c++ code):

Code: [Select]
if (thisplayer.mapvoted == 0)  // if player has not already voted
  nextmapvote (thisplayer);  // call function
if (mapvote >= players * votepass)  // if enough votes for nextmap
  nextmap ();
if (player.left && player.mapvoted == 1)
  mapvote --;

function nextmapvote (playername) {
  playername.mapvoted = 1;
  mapvote += 1;
}

Don't be hatin' bout my simplificatin'
Can't think of anything original to put here...