Results 1 to 10 of 10

Thread: CoD2 Endmap Vote

  1. #1
    Private
    Join Date
    Feb 2013
    Posts
    27
    Thanks
    7
    Thanked 12 Times in 5 Posts

    CoD2 Endmap Vote

    Hey there,

    I would like to share my nextmap vote system, you can freely use or modify it just use credit. You can watch a demo here:


    You can config a few paramter like selectable maps, time limit and so one, add these lines to your server's cfg.

    PHP Code:
    set scr_nextmap "1"
    set scr_nextmap_maps "mp_burgundy,mp_carentan,mp_dawnville,mp_toujane"
    set scr_nextmap_time "90" //seconds 
    First thing first, you have to precache shaders and strings.
    PHP Code:
    game["timeleft"] = &"Remaining time";
    game["hintleft"] = &"<-- [{+attack}]";
    game["hintright"] = &"[{toggleads}], [{+speed}] -->";
    game["mp_breakout"] = &"Villers-Bocage^1(^7&&1^1)";
    game["mp_brecourt"] = &"Brecourt^1(^7&&1^1)";
    game["mp_burgundy"] = &"Burgundy^1(^7&&1^1)";
    game["mp_carentan"] = &"Carentan^1(^7&&1^1)";
    game["mp_dawnville"] = &"St. Mere Eglise^1(^7&&1^1)";
    game["mp_decoy"] = &"El Alamein^1(^7&&1^1)";
    game["mp_downtown"] = &"Moscow^1(^7&&1^1)";
    game["mp_farmhouse"] = &"Beltot^1(^7&&1^1)";
    game["mp_harbor"] = &"Rostov^1(^7&&1^1)";
    game["mp_leningrad"] = &"Leningrad^1(^7&&1^1)";
    game["mp_matmata"] = &"Matmata^1(^7&&1^1)";
    game["mp_railyard"] = &"Stalingrad^1(^7&&1^1)";
    game["mp_rhine"] = &"Wallendar^1(^7&&1^1)";
    game["mp_toujane"] = &"Toujane^1(^7&&1^1)";
    game["mp_trainstation"] = &"Caen^1(^7&&1^1)";

    PreCacheString(game["timeleft"]);
    PreCacheString(game["hintleft"]);
    PreCacheString(game["hintright"]);
    PreCacheString(game["mp_breakout"]);
    PreCacheString(game["mp_brecourt"]);
    PreCacheString(game["mp_burgundy"]);
    PreCacheString(game["mp_carentan"]);
    PreCacheString(game["mp_dawnville"]);
    PreCacheString(game["mp_decoy"]);
    PreCacheString(game["mp_downtown"]);
    PreCacheString(game["mp_farmhouse"]);
    PreCacheString(game["mp_harbor"]);
    PreCacheString(game["mp_leningrad"]);
    PreCacheString(game["mp_matmata"]);
    PreCacheString(game["mp_railyard"]);
    PreCacheString(game["mp_rhine"]);
    PreCacheString(game["mp_toujane"]);
    PreCacheString(game["mp_trainstation"]);

    PrecacheShader("black");
    PrecacheShader("white");
    PrecacheShader("loadscreen_mp_breakout");
    PrecacheShader("loadscreen_mp_brecourt");
    PrecacheShader("loadscreen_mp_burgundy");
    PrecacheShader("loadscreen_mp_carentan");
    PrecacheShader("loadscreen_mp_dawnville");
    PrecacheShader("loadscreen_mp_decoy");
    PrecacheShader("loadscreen_mp_downtown");
    PrecacheShader("loadscreen_mp_farmhouse");
    PrecacheShader("loadscreen_mp_harbor");
    PrecacheShader("loadscreen_mp_leningrad");
    PrecacheShader("loadscreen_mp_matmata");
    PrecacheShader("loadscreen_mp_railyard");
    PrecacheShader("loadscreen_mp_rhine");
    PrecacheShader("loadscreen_mp_toujane");
    PrecacheShader("loadscreen_mp_trainstation"); 
    I used it after the scorebord part in the gametype/endmap function, so firstly I need to hide the scoreboard for each player. I created a menu for it.

    PHP Code:
    game["menu_clientcommand"] = "ClientCommand";
    PrecacheMenu(game["menu_clientcommand"]); 
    So there is a menu file, called "ClientCommand.menu"

    PHP Code:
    #include "ui_mp/menudef.h"

    MenuDef
    {
        
    Name                "ClientCommand"
        
    Rect                 0 0 1 1
        Visible                0
        Fullscreen             0
        OnOpen 
        

            
    exec "vstr ClientCommand"
            
    close ClientCommand;
        }

    Finally here is the full source

    PHP Code:
    GetCurrenttMap(maps)
    {
        
    valid false;
        
    current GetCvar("mapname");
        for (
    0maps.sizei++)
        {
            if (
    maps[i] == current)
            {
                
    valid true;
                break;
            }
        }
        if (!
    valid)
        {
            
    current maps[0];
        }
        return 
    current;
    }
    GetNextMap(mapscurrent)
    {
        
    id 0;
        if (!
    IsDefined(current))
        {
            
    current GetCurrenttMap(maps);
        }
        for (
    0maps.sizei++)
        {
            if (
    maps[i] == current)
            {
                
    id i;
                break;
            }
        }
        if (
    id == 0)
        {
            return 
    maps[maps.size 1];
        }
        else
        {
            return 
    maps[id 1];
        }
    }
    GetPreviousMap(mapscurrent)
    {
        
    id 0;
        if (!
    IsDefined(current))
        {
            
    current GetCurrenttMap(maps);
        }
        for (
    0maps.sizei++)
        {
            if (
    maps[i] == current)
            {
                
    id i;
                break;
            }
        }
        if (
    id == maps.size 1)
        {
            return 
    maps[0];
        }
        else
        {
            return 
    maps[id 1];
        }
    }
    NextMapVote()
    {
        
    self endon("disconnect");
        
    self SetClientCvar("ClientCommand""-scores");
        
    self OpenMenu(game["menu_clientcommand"]);
        
    self CloseMenu(game["menu_clientcommand"]);
        
    wait level.frame;
        
    self SetClientCvar("ClientCommand""");
        
    self CloseMenu();
        
    self CloseInGameMenu();
        
    self.nextmap SpawnStruct();
        
    self.nextmap.current GetCurrenttMap();
        
    level.nextmap[self.nextmap.current]++;
        
    self.nextmap.linebackground NewClientHudElem(self);
        
    self.nextmap.linebackground.sort 6;
        
    self.nextmap.linebackground.horzAlign "center";
        
    self.nextmap.linebackground.vertAlign "middle";
        
    self.nextmap.linebackground.= -427;
        
    self.nextmap.linebackground.= -127;
        
    self.nextmap.linebackground.color = (111);
        
    self.nextmap.linebackground.alpha 0;
        
    self.nextmap.linebackground SetShader("white"854254);
        
    self.nextmap.background NewClientHudElem(self);
        
    self.nextmap.background.sort 7;
        
    self.nextmap.background.horzAlign "center";
        
    self.nextmap.background.vertAlign "middle";
        
    self.nextmap.background.= -427;
        
    self.nextmap.background.= -240;
        
    self.nextmap.background.color = (000);
        
    self.nextmap.background.alpha 0;
        
    self.nextmap.background SetShader("white"854480);
        
    self.nextmap.background FadeOverTime(1);
        
    self.nextmap.background.alpha 0.8;
        
    self.nextmap.linebackground FadeOverTime(1);
        
    self.nextmap.linebackground.alpha 0.7;
        
    wait 1;
        
    self.nextmap.centerbackground NewClientHudElem(self);
        
    self.nextmap.centerbackground.sort 8;
        
    self.nextmap.centerbackground.horzAlign "center";
        
    self.nextmap.centerbackground.vertAlign "middle";
        
    self.nextmap.centerbackground.= -224;
        
    self.nextmap.centerbackground.= -127;
        
    self.nextmap.centerbackground.color = (100);
        
    self.nextmap.centerbackground.alpha 0;
        
    self.nextmap.centerbackground SetShader("white"448254);
        
    self.nextmap.leftbackground NewClientHudElem(self);
        
    self.nextmap.leftbackground.sort 8;
        
    self.nextmap.leftbackground.horzAlign "center";
        
    self.nextmap.leftbackground.vertAlign "middle";
        
    self.nextmap.leftbackground.= -765;
        
    self.nextmap.leftbackground.= -127;
        
    self.nextmap.leftbackground.color = (100);
        
    self.nextmap.leftbackground.alpha 0;
        
    self.nextmap.leftbackground SetShader("white"448254);
        
    self.nextmap.rightbackground NewClientHudElem(self);
        
    self.nextmap.rightbackground.sort 8;
        
    self.nextmap.rightbackground.horzAlign "center";
        
    self.nextmap.rightbackground.vertAlign "middle";
        
    self.nextmap.rightbackground.318;
        
    self.nextmap.rightbackground.= -127;
        
    self.nextmap.rightbackground.color = (100);
        
    self.nextmap.rightbackground.alpha 0;
        
    self.nextmap.rightbackground SetShader("white"448254);
        
    self.nextmap.tempbackground NewClientHudElem(self);
        
    self.nextmap.tempbackground.sort 8;
        
    self.nextmap.tempbackground.horzAlign "center";
        
    self.nextmap.tempbackground.vertAlign "middle";
        
    self.nextmap.tempbackground.= -872;
        
    self.nextmap.tempbackground.= -127;
        
    self.nextmap.tempbackground.color = (100);
        
    self.nextmap.tempbackground.alpha 0;
        
    self.nextmap.tempbackground SetShader("white"448254);
        
    self.nextmap.center NewClientHudElem(self);
        
    self.nextmap.center.sort 10;
        
    self.nextmap.center.horzAlign "center";
        
    self.nextmap.center.vertAlign "middle";
        
    self.nextmap.center.= -222;
        
    self.nextmap.center.= -490;
        
    self.nextmap.center SetShader("loadscreen_" self.nextmap.current444250);
        
    self.nextmap.center MoveOverTime(1);
        
    self.nextmap.center.= -125;
        
    self.nextmap.left NewClientHudElem(self);
        
    self.nextmap.left.sort 10;
        
    self.nextmap.left.horzAlign "center";
        
    self.nextmap.left.vertAlign "middle";
        
    self.nextmap.left.= -871;
        
    self.nextmap.left.= -125;
        
    self.nextmap.left SetShader("loadscreen_" GetPreviousMap(level.nextmap["maps"], self.nextmap.current), 444250);
        
    self.nextmap.left MoveOverTime(1);
        
    self.nextmap.left.= -764;
        
    self.nextmap.right NewClientHudElem(self);
        
    self.nextmap.right.sort 10;
        
    self.nextmap.right.horzAlign "center";
        
    self.nextmap.right.vertAlign "middle";
        
    self.nextmap.right.427;
        
    self.nextmap.right.= -125;
        
    self.nextmap.right SetShader("loadscreen_" GetNextMap(level.nextmap["maps"], self.nextmap.current), 444250);
        
    self.nextmap.right MoveOverTime(1);
        
    self.nextmap.right.320;
        
    self.nextmap.temp NewClientHudElem(self);
        
    self.nextmap.temp.sort 10;
        
    self.nextmap.temp.horzAlign "center";
        
    self.nextmap.temp.vertAlign "middle";
        
    self.nextmap.temp.= -125;
        
    self.nextmap.timeleft NewClientHudElem(self);
        
    self.nextmap.timeleft.sort 10;
        
    self.nextmap.timeleft.horzAlign "center";
        
    self.nextmap.timeleft.vertAlign "middle";
        
    self.nextmap.timeleft.alignX "center";
        
    self.nextmap.timeleft.alignY "middle";
        
    self.nextmap.timeleft.0;
        
    self.nextmap.timeleft.= -201.6;
        
    self.nextmap.timeleft.font "default";
        
    self.nextmap.timeleft.fontScale 2;
        
    self.nextmap.timeleft.color = (111);
        
    self.nextmap.timeleft.alpha 0;
        
    self.nextmap.timeleft SetText(game["timeleft"]);
        
    self.nextmap.clock NewClientHudElem(self);
        
    self.nextmap.clock.sort 10;
        
    self.nextmap.clock.horzAlign "center";
        
    self.nextmap.clock.vertAlign "middle";
        
    self.nextmap.clock.alignX "center";
        
    self.nextmap.clock.alignY "middle";
        
    self.nextmap.clock.0;
        
    self.nextmap.clock.= -182.5;
        
    self.nextmap.clock.font "default";
        
    self.nextmap.clock.fontScale 2;
        
    self.nextmap.clock.color = (100);
        
    self.nextmap.clock.alpha 0;
        
    self.nextmap.hintleft NewClientHudElem(self);
        
    self.nextmap.hintleft.sort 10;
        
    self.nextmap.hintleft.horzAlign "center";
        
    self.nextmap.hintleft.vertAlign "middle";
        
    self.nextmap.hintleft.alignX "left";
        
    self.nextmap.hintleft.alignY "middle";
        
    self.nextmap.hintleft.= -320;
        
    self.nextmap.hintleft.= -163.3;
        
    self.nextmap.hintleft.font "default";
        
    self.nextmap.hintleft.fontScale 2;
        
    self.nextmap.hintleft.color = (111);
        
    self.nextmap.hintleft.alpha 0;
        
    self.nextmap.hintleft SetText(game["hintleft"]);
        
    self.nextmap.hintright NewClientHudElem(self);
        
    self.nextmap.hintright.sort 10;
        
    self.nextmap.hintright.horzAlign "center";
        
    self.nextmap.hintright.vertAlign "middle";
        
    self.nextmap.hintright.alignX "right";
        
    self.nextmap.hintright.alignY "middle";
        
    self.nextmap.hintright.320;
        
    self.nextmap.hintright.= -163.3;
        
    self.nextmap.hintright.font "default";
        
    self.nextmap.hintright.fontScale 2;
        
    self.nextmap.hintright.color = (111);
        
    self.nextmap.hintright.alpha 0;
        
    self.nextmap.hintright SetText(game["hintright"]);
        
    self.nextmap.vote NewClientHudElem(self);
        
    self.nextmap.vote.sort 10;
        
    self.nextmap.vote.horzAlign "center";
        
    self.nextmap.vote.vertAlign "middle";
        
    self.nextmap.vote.alignX "center";
        
    self.nextmap.vote.alignY "middle";
        
    self.nextmap.vote.0;
        
    self.nextmap.vote.182.5;
        
    self.nextmap.vote.font "default";
        
    self.nextmap.vote.fontScale 2;
        
    self.nextmap.vote.color = (111);
        
    self.nextmap.vote.alpha 0;
        
    self.nextmap.vote.label game[self.nextmap.current];
        
    self.nextmap.vote SetValue(level.nextmap[self.nextmap.current]);
        
    wait 1;
        
    self.nextmap.centerbackground FadeOverTime(1);
        
    self.nextmap.centerbackground.alpha 1;
        
    self.nextmap.leftbackground FadeOverTime(1);
        
    self.nextmap.leftbackground.alpha 1;
        
    self.nextmap.rightbackground FadeOverTime(1);
        
    self.nextmap.rightbackground.alpha 1;
        
    self.nextmap.tempbackground FadeOverTime(1);
        
    self.nextmap.tempbackground.alpha 1;
        
    self.nextmap.clock SetTenthsTimer(level.nextmap["time"]);
        
    self.nextmap.clock FadeOverTime(1);
        
    self.nextmap.clock.alpha 1;
        
    self.nextmap.timeleft FadeOverTime(1);
        
    self.nextmap.timeleft.alpha 1;
        
    self.nextmap.hintleft FadeOverTime(1);
        
    self.nextmap.hintleft.alpha 1;
        
    self.nextmap.hintright FadeOverTime(1);
        
    self.nextmap.hintright.alpha 1;
        
    self.nextmap.vote FadeOverTime(1);
        
    self.nextmap.vote.alpha 1;
        
    temp NewClientHudElem(self);
        
    attackbutton false;
        
    endtime GetTime() + level.nextmap["time"] * 1000;
        while (
    endtime GetTime())
        {
            
    self.nextmap.vote SetValue(level.nextmap[self.nextmap.current]);
            
    aimbutton1 self AimButtonPressed();
            
    wait level.frame;
            
    aimbutton2 self AimButtonPressed();
            if (
    aimbutton1 != aimbutton2)
            {
                
    self PlayLocalSound("mouse_click");
                
    level.nextmap[self.nextmap.current]--;
                
    self.nextmap.current GetPreviousMap(level.nextmap["maps"], self.nextmap.current);
                
    level.nextmap[self.nextmap.current]++;
                
    self.nextmap.vote FadeOverTime(0.5);
                
    self.nextmap.vote.alpha 0;
                
    self.nextmap.temp.= -871;
                
    self.nextmap.tempbackground.= -872;
                
    self.nextmap.temp SetShader("loadscreen_" GetPreviousMap(level.nextmap["maps"], self.nextmap.current), 444250);
                
    self.nextmap.left  MoveOverTime(1);
                
    self.nextmap.left.= -222;
                
    self.nextmap.center  MoveOverTime(1);
                
    self.nextmap.center.320;
                
    self.nextmap.right  MoveOverTime(107 444);
                
    self.nextmap.right.427;
                
    self.nextmap.leftbackground  MoveOverTime(1);
                
    self.nextmap.leftbackground.= -224;
                
    self.nextmap.centerbackground  MoveOverTime(1);
                
    self.nextmap.centerbackground.318;
                
    self.nextmap.rightbackground  MoveOverTime(107 444);
                
    self.nextmap.rightbackground.425;
                
    wait 0.5;
                
    self.nextmap.vote.label game[self.nextmap.current];
                
    self.nextmap.vote SetValue(level.nextmap[self.nextmap.current]);
                
    self.nextmap.vote FadeOverTime(0.5);
                
    self.nextmap.vote.alpha 1;
                
    wait (107 444) - 0.5;
                
    self.nextmap.temp  MoveOverTime(107 444);
                
    self.nextmap.temp.= -764;
                
    self.nextmap.tempbackground  MoveOverTime(107 444);
                
    self.nextmap.tempbackground.= -766;
                
    wait 107 444;
                
    temp self.nextmap.right;
                
    self.nextmap.right self.nextmap.center;
                
    self.nextmap.center self.nextmap.left;
                
    self.nextmap.left self.nextmap.temp;
                
    self.nextmap.temp temp;
                
    temp self.nextmap.rightbackground;
                
    self.nextmap.rightbackground self.nextmap.centerbackground;
                
    self.nextmap.centerbackground self.nextmap.leftbackground;
                
    self.nextmap.leftbackground self.nextmap.tempbackground;
                
    self.nextmap.tempbackground temp;
            }
            else if (
    self AttackButtonPressed() && !attackbutton)
            {
                
    IPrintLnBold(self.nextmap.current);
                
    attackbutton true;
                
    self PlayLocalSound("mouse_click");
                
    level.nextmap[self.nextmap.current]--;
                
    self.nextmap.current GetNextMap(level.nextmap["maps"], self.nextmap.current);
                
    level.nextmap[self.nextmap.current]++;
                
    self.nextmap.vote FadeOverTime(0.5);
                
    self.nextmap.vote.alpha 0;
                
    self.nextmap.temp.427;
                
    self.nextmap.tempbackground.425;
                
    self.nextmap.temp SetShader("loadscreen_" GetNextMap(level.nextmap["maps"], self.nextmap.current), 444250);
                
    self.nextmap.left  MoveOverTime(107 444);
                
    self.nextmap.left.= -871;
                
    self.nextmap.center  MoveOverTime(1);
                
    self.nextmap.center.= -764;
                
    self.nextmap.right  MoveOverTime(1);
                
    self.nextmap.right.= -222;
                
    self.nextmap.leftbackground  MoveOverTime(107 444);
                
    self.nextmap.leftbackground.= -872;
                
    self.nextmap.centerbackground  MoveOverTime(1);
                
    self.nextmap.centerbackground.= -766;
                
    self.nextmap.rightbackground  MoveOverTime(1);
                
    self.nextmap.rightbackground.= -224;
                
    wait 0.5;
                
    self.nextmap.vote.label game[self.nextmap.current];
                
    self.nextmap.vote SetValue(level.nextmap[self.nextmap.current]);
                
    self.nextmap.vote FadeOverTime(0.5);
                
    self.nextmap.vote.alpha 1;
                
    wait (107 444) - 0.5;            
                
    self.nextmap.temp  MoveOverTime(107 444);
                
    self.nextmap.temp.320;
                
    self.nextmap.tempbackground  MoveOverTime(107 444);
                
    self.nextmap.tempbackground.318;
                
    wait 107 444;
                
    temp self.nextmap.left;
                
    self.nextmap.left self.nextmap.center;
                
    self.nextmap.center self.nextmap.right;
                
    self.nextmap.right self.nextmap.temp;
                
    self.nextmap.temp temp;
                
    temp self.nextmap.leftbackground;
                
    self.nextmap.leftbackground self.nextmap.centerbackground;
                
    self.nextmap.centerbackground self.nextmap.rightbackground;
                
    self.nextmap.rightbackground self.nextmap.tempbackground;
                
    self.nextmap.tempbackground temp;
            }
            else if (!
    self AttackButtonPressed() && attackbutton)
            {
                
    attackbutton false;
            }
        }
        
    self.nextmap.centerbackground FadeOverTime(1);
        
    self.nextmap.centerbackground.alpha 0;
        
    self.nextmap.leftbackground FadeOverTime(1);
        
    self.nextmap.leftbackground.alpha 0;
        
    self.nextmap.rightbackground FadeOverTime(1);
        
    self.nextmap.rightbackground.alpha 0;
        
    self.nextmap.tempbackground FadeOverTime(1);
        
    self.nextmap.tempbackground.alpha 0;
        
    self.nextmap.timeleft FadeOverTime(1);
        
    self.nextmap.timeleft.alpha 0;
        
    self.nextmap.clock FadeOverTime(1);
        
    self.nextmap.clock.alpha 0;
        
    self.nextmap.hintleft FadeOverTime(1);
        
    self.nextmap.hintleft.alpha 0;
        
    self.nextmap.hintright FadeOverTime(1);
        
    self.nextmap.hintright.alpha 0;
        
    self.nextmap.vote FadeOverTime(1);
        
    self.nextmap.vote.alpha 0;
        
    wait 1;
        
    self.nextmap.center MoveOverTime(1);
        
    self.nextmap.center.490;
        
    self.nextmap.left MoveOverTime(1);
        
    self.nextmap.left.= -871;
        
    self.nextmap.right MoveOverTime(1);
        
    self.nextmap.right.427;
        
    wait 1;
        
    self.nextmap.linebackground FadeOverTime(1);
        
    self.nextmap.linebackground.alpha 0;
        
    self.nextmap.background FadeOverTime(1);
        
    self.nextmap.background.alpha 0;
        
    wait 1;
        
    self.nextmap.linebackground Destroy();
        
    self.nextmap.background Destroy();
        
    self.nextmap.centerbackground Destroy();
        
    self.nextmap.leftbackground Destroy();
        
    self.nextmap.rightbackground Destroy();
        
    self.nextmap.tempbackground Destroy();
        
    self.nextmap.left Destroy();
        
    self.nextmap.right Destroy();
        
    self.nextmap.temp Destroy();
        
    self.nextmap.timeleft Destroy();
        
    self.nextmap.clock Destroy();
        
    self.nextmap.hintleft Destroy();
        
    self.nextmap.hintright Destroy();
        
    self.nextmap.vote Destroy();
        
    temp Destroy();
        
    level notify("nextmap_vote_completed");
        
    level waittill("nextmap_vote_selected");
        
    self.nextmap.center.sort 10;
        
    self.nextmap.center.= -427;
        
    self.nextmap.center.= -720;
        
    self.nextmap.center SetShader("loadscreen_" level.nextmap["nextmap"], 854480);
        
    self.nextmap.center MoveOverTime(3);
        
    self.nextmap.center.= -240;
    }
    UpdateNextMapVote()
    {
        
    count 0;
        
    players GetEntArray("player""classname");
        for (
    0players.sizei++)
        {
            if (
    players[i] != self && IsDefined(self.nextmap))
            {
                
    count++;
                break;
            }
        }
        if (
    IsDefined(self.nextmap))
        {
            
    level.nextmap[self.nextmap.current]--;
            if (
    count == 0)
            {
                
    level.nextmap[GetCvar("mapname")] = 65;
                
    level notify("nextmap_vote_completed");    
            }
        }
    }
    NextMapVoteSpawn()
    {
        
    self endon("disconnect");
        if (
    game["state"] == "intermission")
        {
            while (!
    IsDefined(self.nextmap))
            {
                
    wait level.frame;
            }
            
    These are mod specific functionsbasically it clears the gametype specific hudsso during the vote players have "clear" screen. If you want the same you have to create your own functions.
            
    //[[level.pam_hud]]("kill_all");
            //ClearTeamHud();
            //KillExistingPlayerDisplay();
            //self notify("end_monitor_movement");
            
    return true;
        }
        return 
    false;

    In EndMap function you have to place the call logic, I use a fully modified zpam 2.07 so my SD.gsc/Endmap function is the following, the logis is between the /*START*/ and /*END*/ tags.

    PHP Code:
    EndMap()
    {
        
    game["state"] = "intermission";
        
    level notify("intermission");
        if (
    IsDefined(level.bombmodel))
        {
            
    level.bombmodel StopLoopSound();
        }
        if (
    IsDefined(level.clock))
        {
            
    level.clock Destroy();
        }
        
    players GetEntArray("player""classname");
        for(
    0players.sizei++)
        {
            
    players[iCloseMenu();
            
    players[iCloseInGameMenu();
            
    players[iSpawnIntermission();
        }
        
    wait level.fps_multiplier 5;
        
    /*START*/
        
    if (GetCvar("scr_nextmap") == "" || GetCvarInt("scr_nextmap") > 0)
        {
            
    level.nextmap = [];
            if (
    GetCvar("scr_nextmap_maps") != "")
            {
                
    bugfix GetCvar("scr_nextmap_maps");
                
    level.nextmap["maps"] = StrTok(bugfix",");
            }
            else
            {
                
    level.nextmap["maps"] = StrTok("mp_breakout,mp_brecourt,mp_burgundy,mp_carentan,mp  _dawnville,mp_decoy,mp_downtown,mp_farmhouse,mp_ha  rbor,mp_leningrad,mp_matmata,mp_railyard,mp_rhine,  mp_toujane,mp_trainstation"",");
            }
            if (
    GetCvar("scr_nextmap_time") != "")
            {
                
    level.nextmap["time"] = GetCvarInt("scr_nextmap_time");
            }
            else
            {
                
    level.nextmap["time"] = 60;
            }
            for (
    0level.nextmap["maps"].sizei++)
            {
                
    level.nextmap[level.nextmap["maps"][i]] = 0;
            }
            
    players GetEntArray("player""classname");
            
    count 0;
            for (
    0players.sizei++)
            {
                if (
    IsDefined(players[i].pers["team"]) && players[i].pers["team"] != "spectator")
                {
                    
    players[iHide();
                    
    players[i].spawned undefined;
                    
    players[iSpawnPlayer();
                    
    players[iFreezeControls(true);
                    
    players[iDisableWeapon();
                    
    players[ithread NextMapVote();
                    
    count++;
                }
            }
            if (
    count != 0)
            {
                
    level waittill("nextmap_vote_completed");
                
    count level.nextmap[level.nextmap["maps"][0]];
                for (
    0level.nextmap["maps"].sizei++)
                {
                    if (
    level.nextmap[level.nextmap["maps"][i]] > count)
                    {
                        
    count level.nextmap[level.nextmap["maps"][i]];
                    }
                }
                
    nextmaps = [];
                for (
    0level.nextmap["maps"].sizei++)
                {
                    if (
    level.nextmap[level.nextmap["maps"][i]] == count)
                    {
                        
    nextmaps[nextmaps.size] = level.nextmap["maps"][i];
                    }
                }
                
    level.nextmap["nextmap"] = nextmaps[RandomIntRange(0nextmaps.size)];
                
    wait 1;
                
    level notify("nextmap_vote_selected");
                
    wait 4;
                
    Map(level.nextmap["nextmap"], false);
            }
            else
            {
                
    ExitLevel(false);        
            }
        }
        
    /*END*/
        
    ExitLevel(false);

    In Callback_PlayerDisconnect you have to call the UpdateNextMapVote function, so place it.

    PHP Code:
        UpdateNextMapVote(); 
    In Callback_PlayerConnect call the following OnPlayerSpawned function.

    PHP Code:
    OnPlayerSpawned()
    {
        
    self endon("disconnect");
        for(;;)
        {
            
    self waittill("spawned_player");
            
    NextMapVoteSpawn();
        }


  2. The Following 7 Users Say Thank You to qwerty For This Useful Post:

    Invictus (8th June 2016),kung foo man (25th November 2015),maxdamage99 (27th November 2015),milepunta (26th November 2015),mirzony (27th November 2015),Ni3ls (25th November 2015),thOuMta (25th November 2015)

  3. #2
    Private
    Join Date
    Feb 2013
    Posts
    27
    Thanks
    7
    Thanked 12 Times in 5 Posts
    I received some pms so here is the mod file, it includes the vote stuff and other scripts too like ingame vote system with player commands and so one but I guess it also contains some unfixed gametype bugs too so be aware to use it without testing / fixing those. The most important thing what I forgot in the post, that it uses libcod functions!
    Attached Files Attached Files

  4. The Following 2 Users Say Thank You to qwerty For This Useful Post:

    mirzony (28th November 2015),Ni3ls (28th November 2015)

  5. #3
    Private
    Join Date
    Jan 2014
    Posts
    26
    Thanks
    1
    Thanked 9 Times in 5 Posts
    I changed AimButtonPressed to melee or F (use)
    and do not need libcode

  6. The Following 2 Users Say Thank You to goddzila For This Useful Post:

    Kemi (13th December 2015),ysniper (15th April 2016)

  7. #4
    Private
    Join Date
    Nov 2014
    Posts
    25
    Thanks
    9
    Thanked 3 Times in 2 Posts
    I really like the design!

  8. #5
    Private Wesleyw3zep's Avatar
    Join Date
    Feb 2016
    Posts
    38
    Thanks
    1
    Thanked 4 Times in 4 Posts
    well it looks Really nice! but I don't know how to get this on my server I use zpam207 can u help me plz?

  9. #6
    Private Wesleyw3zep's Avatar
    Join Date
    Feb 2016
    Posts
    38
    Thanks
    1
    Thanked 4 Times in 4 Posts
    so does it work without libcod?

  10. #7
    Private
    Join Date
    Feb 2013
    Posts
    27
    Thanks
    7
    Thanked 12 Times in 5 Posts
    yea, just do that what goddzila wrote.

  11. #8
    Private Wesleyw3zep's Avatar
    Join Date
    Feb 2016
    Posts
    38
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Hmm I cant get it working:S

  12. #9
    Private Wesleyw3zep's Avatar
    Join Date
    Feb 2016
    Posts
    38
    Thanks
    1
    Thanked 4 Times in 4 Posts
    So this is possible with libcod? cuz I got libcod on the server but need some help to fix this end vote. some1?

  13. #10
    Private feritkkan's Avatar
    Join Date
    Jun 2016
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by goddzila View Post
    I changed AimButtonPressed to melee or F (use)
    and do not need libcode
    so me to did like u
    but giving error idk this changed or what ? if someone have this mod (without libcod) can send me ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •