23 Feb 14, 11:26AM
(This post was last modified: 23 Feb 14, 12:11PM by RandumKiwi.)
Bro, Jamz, don't throw a hizzy! I've got your back, I just needed some time to work through this and debug:
NOTE: I worry that the sleep for (curmap 1), as commented in this script, might not always work (I'm sure it will, but there's that little bit of doubt that it might not). It would be much better, to remove the need for sleep, and instead have this run as a onMapLoad alias, if that did exist (which it doesn't).
Jpablon: Your code is overly complex.
[SELECT ALL] Code:
// Disconnect on map vote:
onVoteEnd = [ sleep 500 [
// Sleep allows the client to change map, so that (curmap 1) works properly.
disconnectmaps = [ map1 map2 ]
// Space delimited list of maps that we don't like.
n = (listlen $disconnectmaps)
// How many maps are there in the disconnectmaps alias?
loop i $n [
// Loop as many times as there are maps, as found out above.
discmapname = (at $disconnectmaps $i)
// Each loop, pull the next map from the disconnectmaps list.
if (strcmp $discmapname (curmap 1)) [
// Then, compare it to the current map.
say "Hmm, bad map choice..."; sleep 500 [ disconnect; joinservermenu ]
// then if the current map matches the list, leave the server and show the server menu.
]
]
] 1 // Required: This makes the first sleep ignore any map changes.
]
NOTE: I worry that the sleep for (curmap 1), as commented in this script, might not always work (I'm sure it will, but there's that little bit of doubt that it might not). It would be much better, to remove the need for sleep, and instead have this run as a onMapLoad alias, if that did exist (which it doesn't).
Jpablon: Your code is overly complex.