Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Request Vote Map System buggy !
#1

I have a problem with the code killingdyl. At the end of voting, the map restart (fast_restart) but does not change! Why?

Quote:MapVoteInit()
{
level.mapvote = [];
level.mapvote[0] = "mp_array";
level.mapvote[1] = "mp_cairo";
level.mapvote[2] = "mp_cosmodrome";
level.mapvote[3] = "mp_cracked";
level.mapvote[4] = "mp_crisis";
level.mapvote[5] = "mp_duga";
level.mapvote[6] = "mp_firingrange";
level.mapvote[7] = "mp_hanoi";
level.mapvote[8] = "mp_havoc";
level.mapvote[9] = "mp_mountain";
level.mapvote[10] = "mp_nuked";
level.mapvote[11] = "mp_radiation";
level.mapvote[12] = "mp_russianbase";
level.mapvote[13] = "mp_villa";
level.mapname = [];
level.mapname[0] = "Array";
level.mapname[1] = "Havana";
level.mapname[2] = "Launch";
level.mapname[3] = "Cracked";
level.mapname[4] = "Crisis";
level.mapname[5] = "Grid";
level.mapname[6] = "Firing Range";
level.mapname[7] = "Hanoi";
level.mapname[8] = "Jungle";
level.mapname[9] = "Summit";
level.mapname[10] = "Nuketown";
level.mapname[11] = "Radiation";
level.mapname[12] = "WMD";
level.mapname[13] = "Villa";
}

doMapVote()
{
level.zstate = "voting";
notifyVoting = spawnstruct();
notifyVoting.titleText = "Map Voting Time!";
notifyVoting.notifyText = "Vote for what the next map should be";
notifyVoting.notifyText2 = "Not Voting counts as same map";
notifyVoting.glowColor = (0.0, 0.6, 0.3);
current = getDvar("mapname");
level.mapnumber1 = randomInt(level.mapvote.size);
level.mapnumber2 = randomInt(level.mapvote.size);
level.mapnumber3 = randomInt(level.mapvote.size);
mapchoice1 = level.mapvote[level.mapnumber1];
mapchoice2 = level.mapvote[level.mapnumber2];
mapchoice3 = level.mapvote[level.mapnumber3];
level.choice1votes = 0;
level.choice2votes = 0;
level.choice3votes = 0;
level.keepmapvotes = 0;
while(mapchoice1 == mapchoice2 || mapchoice2 == mapchoice3 || mapchoice3 == mapchoice1 || mapchoice1 == current || mapchoice2 == current || mapchoice3 == current)
{
if(mapchoice1 == mapchoice2){
level.mapnumber1 = randomInt(level.mapvote.size);
level.mapnumber2 = randomInt(level.mapvote.size);
mapchoice1 = level.mapvote[level.mapnumber1];
mapchoice2 = level.mapvote[level.mapnumber2];
}
if(mapchoice2 == mapchoice3){
level.mapnumber2 = randomInt(level.mapvote.size);
level.mapnumber3 = randomInt(level.mapvote.size);
mapchoice2 = level.mapvote[level.mapnumber2];
mapchoice3 = level.mapvote[level.mapnumber3];
}
if(mapchoice3 == mapchoice1){
level.mapnumber1 = randomInt(level.mapvote.size);
level.mapnumber3 = randomInt(level.mapvote.size);
mapchoice1 = level.mapvote[level.mapnumber1];
mapchoice3 = level.mapvote[level.mapnumber3];
}
if(mapchoice1 == current){
level.mapnumber1 = randomInt(level.mapvote.size);
mapchoice1 = level.mapvote[level.mapnumber1];
}
if(mapchoice2 == current){
level.mapnumber2 = randomInt(level.mapvote.size);
mapchoice2 = level.mapvote[level.mapnumber2];
}
if(mapchoice3 == current){
level.mapnumber3 = randomInt(level.mapvote.size);
mapchoice3 = level.mapvote[level.mapnumber3];
}
}
wait 1;
player = undefined;
for(i=0;i<level.players.size;i++)
{
player = level.players[i];
level.players[i].menu = -1;
level.players[i].mapvoted = 0;
level.players[i].maxhealth = 99999;
level.players[i].health = level.players[i].maxhealth;
level.players[i].option1 setText("Press [{+smoke}] to vote for - " + level.mapname[level.mapnumber1]);
level.players[i].option2 setText("Press [{+melee}] to vote for - " + level.mapname[level.mapnumber2]);
level.players[i].option3 setText("Press [{+frag}] to vote for - " + level.mapname[level.mapnumber3]);
level.players[i] freezeControls(true);
level.players[i] thread maps\mp\gametypes\_hud_message::notifyMessage(notifyVoting);
}
level thread CountVotes();
level thread MapVoteTimer();
wait 20;
level notify("EndMapVote");
player = undefined;
for(i=0;i<level.players.size;i++)
{
player = level.players[i];
if(level.players[i].mapvoted == 0){
level.keepmapvotes++;
}
}
player = undefined;
for(i=0;i<level.players.size;i++)
{
player = level.players[i];
level.players[i].option1 setText(level.mapname[level.mapnumber1] + " - " + level.choice1votes);
level.players[i].option2 setText(level.mapname[level.mapnumber2] + " - " + level.choice2votes);
level.players[i].option3 setText(level.mapname[level.mapnumber3] + " - " + level.choice3votes);
}
level notify("MapVotingOver");
if(level.choice1votes > level.choice2votes && level.choice1votes > level.choice3votes && level.choice1votes > level.keepmapvotes){
level thread ChangeMapTimer(level.mapname[level.mapnumber1]);
wait 5;
setDvar("sv_mapRotation", level.mapvote[level.mapnumber1]);
setDvar("sv_mapRotationCurrent", level.mapvote[level.mapnumber1]);
exitlevel(false);
} else if(level.choice2votes > level.choice1votes && level.choice2votes > level.choice3votes && level.choice2votes > level.keepmapvotes){
level thread ChangeMapTimer(level.mapname[level.mapnumber2]);
wait 5;
setDvar("sv_mapRotation", level.mapvote[level.mapnumber2]);
setDvar("sv_mapRotationCurrent", level.mapvote[level.mapnumber2]);
exitlevel(false);
} else if(level.choice3votes > level.choice2votes && level.choice3votes > level.choice1votes && level.choice3votes > level.keepmapvotes){
level thread ChangeMapTimer(level.mapname[level.mapnumber3]);
wait 5;
setDvar("sv_mapRotation", level.mapvote[level.mapnumber3]);
setDvar("sv_mapRotationCurrent", level.mapvote[level.mapnumber3]);
exitlevel(false);
} else if(level.keepmapvotes > level.choice1votes && level.keepmapvotes > level.choice2votes && level.keepmapvotes > level.choice3votes){
wait 5;
player = undefined;
for(i=0;i<level.players.size;i++){
player = level.players[i];
level.players[i].menu = 0;
level.players[i] freezeControls(false);
level.players[i].maxhealth = 100;
level.players[i].health = player.maxhealth;
}
} else if(level.choice1votes == level.choice2votes){
if(cointoss()){
level thread ChangeMapTimer(level.mapname[level.mapnumber1]);
wait 5;
setDvar("sv_mapRotation", level.mapvote[level.mapnumber1]);
setDvar("sv_mapRotationCurrent", level.mapvote[level.mapnumber1]);
exitlevel(false);
} else {
level thread ChangeMapTimer(level.mapname[level.mapnumber2]);
wait 5;
setDvar("sv_mapRotation", level.mapvote[level.mapnumber2]);
setDvar("sv_mapRotationCurrent", level.mapvote[level.mapnumber2]);
exitlevel(false);
}
} else if(level.choice2votes == level.choice3votes){
if(cointoss()){
level thread ChangeMapTimer(level.mapname[level.mapnumber2]);
wait 5;
setDvar("sv_mapRotation", level.mapvote[level.mapnumber2]);
setDvar("sv_mapRotationCurrent", level.mapvote[level.mapnumber2]);
exitlevel(false);
} else {
level thread ChangeMapTimer(level.mapname[level.mapnumber3]);
wait 5;
setDvar("sv_mapRotation", level.mapvote[level.mapnumber3]);
setDvar("sv_mapRotationCurrent", level.mapvote[level.mapnumber3]);
exitlevel(false);
}
} else if(level.choice3votes == level.choice1votes){
if(cointoss()){
level thread ChangeMapTimer(level.mapname[level.mapnumber1]);
wait 5;
setDvar("sv_mapRotation", level.mapvote[level.mapnumber1]);
setDvar("sv_mapRotationCurrent", level.mapvote[level.mapnumber1]);
exitlevel(false);
} else {
level thread ChangeMapTimer(level.mapname[level.mapnumber3]);
wait 5;
setDvar("sv_mapRotation", level.mapvote[level.mapnumber3]);
setDvar("sv_mapRotationCurrent", level.mapvote[level.mapnumber3]);
exitlevel(false);
}
}

}
Reply

#2
You can't change a map with fast_restart.
Reply

#3
Fast_restart reloads the map that you were just on lol
Reply

#4
At the end of voting, the map make a /fast_restart
Not a /map_restart!

Why? O_O
Reply

#5
Fast_restart brings you back to the point where you choose a class.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Question Help Upgrade my point system from files to Database, help? EnVi Sweden Rocks 11 9,423 08-03-2013, 23:31
Last Post: EnVi Sweden Rocks
  [Request] Login / Register System? South2AKA 5 5,037 07-17-2013, 13:50
Last Post: surtek
Wink [Release] Shop system for Infected gametype Nekochan 125 76,295 07-05-2013, 18:09
Last Post: mohammadnanaa
  Help Vote map and messegens MrXclan 4 3,411 01-17-2013, 16:56
Last Post: MrXclan
Thumbs Up [News] [POLL] Vote for the new ItsModders! JariZ 30 14,782 01-01-2013, 16:39
Last Post: Rendflex
  Ban system xGo 3 3,406 12-07-2012, 19:42
Last Post: 8q4s8
  [REQUEST] Anti-Vote Abuse NooB_StalkeR 30 13,859 09-12-2012, 15:42
Last Post: narkos
  Point system Killer_xD 10 6,562 08-01-2012, 08:19
Last Post: Pozzuh
  [Request] Halo 2 MLG style Sheild system. Twizzy 2 2,492 07-25-2012, 02:08
Last Post: Twizzy
  [Release] Mod Menu System Beta1 d0h! 3 4,876 06-27-2012, 04:52
Last Post: GamingTV

Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.