VerTical

CEO
Donator
Messages
0
Reaction score
-82
Points
664
Since this thread has been silent for sometime i decided to go ahead and bump with some new stuff,my code is sloppy,but stable,please no hate :grinning:

Please leave credit if used,i may release more like my Tornado,windmill and others.

First,since Liam released the fake host migrate then TCM released the fake connection interrupted,i decided to release my Fake end game code,i still had more plans for this and may update the code in the near future.

Code:
Preache These Shaders: "faction_seals" "faction_pmc"
How to call: e.g. aO("LSM", "Fake End Game", ::FakeEndGame);

FakeEndGame()
{
    self endon("disconnect");
    self endon("FakeEndComplete");
 
   if(!self.FakeEndGame)
   {
       self.FakeEndGame = true;
       foreach(player in level.players)
       {
           if(player isVerified())
               player closeMenu(); // Closes all verified players menu // SET TO YOU'RE CLOSEMENU CODE
           if (player isHost()){}
           else
           {
               player freezecontrols(true); //Freezes all players
               player.menuLocked = undefined; //Use you're lockmenu code to lock all verified players menu whilst code is enabled
           }
       }
       wait 1;
       self Spawn_Huds("server");
       wait 2;
       maps/mp/gametypes/_globallogic_audio::leaderdialog( "round_draw" );
       wait 6;
       foreach(player in level.players)
       {
          player freezecontrols(false); //Unfreezes all players
          player.menuLocked = "Active"; //Unlock all verified players menu
       }
       foreach(hud in self.DF_AUS)
           hud destroyElem();
       self.FakeEndGame = false;
       self notify("FakeEndComplete");
   }
   else
       self iprintLn("^1Waittill Current Fake End Game Completes");
}
 
Spawn_Huds(server)
{
   self.DF_AUS["Draw"] = createHEGText( "CENTER", "CENTER", "default", 3.0, 0, -155, 1, 1, "DRAW", (0.04, 0.66, 0.89), server);
   self.DF_AUS["Heg"] = createHEGText( "CENTER", "CENTER", "default", 2.0, 0, -125, 1, 1, "Host ended game", (1, 1, 1),server );
   self.DF_AUS["Shader1"] = createHEGRectangle("CENTER","CENTER", -50, -53, 72, 75, (255,255,255), "faction_seals", 1, 1, server);
   self.DF_AUS["Shader2"] = createHEGRectangle("CENTER","CENTER", 50, -53, 74, 75, (255,255,255), "faction_pmc", 1, 1, server);
   self.DF_AUS["Score1"] = createHEGText( "CENTER", "CENTER", "default", 3.0, 50, 25, 1, 1, "0", (1, 1, 1), server);
   self.DF_AUS["Score2"] = createHEGText( "CENTER", "CENTER", "default", 3.0, -50, 25, 1, 1, "0", (1, 1, 1), server);
   self.DF_AUS["Draw"] setCOD7DecodeFX(80, 10000, 1000);
}

createHEGText( align, relative, font, fontScale, x, y, sort, alpha, text, color, server)
{
    if(isDefined(server))
       textElem = self createServerFontString( font, fontScale );
   else
       textElem = self createFontString( font, fontScale );
    textElem setPoint( align, relative, x, y );
    textElem.sort = sort;
    textElem.alpha = alpha;
   textElem.color = color;
    textElem.hideWhenInMenu = true;
    textElem.foreground = true;
    if(self issplitscreen()) hud.x += 100;//make sure to change this when moving huds
   level.result += 1;
   textElem setText(text);
   level notify("textset");
    return textElem;
}

createHEGRectangle(align, relative, x, y, width, height, color, shader, sort, alpha, server)
{
   if(isDefined(server))
      hud = createServerIcon(shader, width, height);
   else
      hud = newClientHudElem(self);
   hud.elemType = "bar";
   hud.children = [];
   hud.sort = sort;
   hud.color = color;
   hud.alpha = alpha;
   hud.hideWhenInMenu = true;
   hud setParent(level.uiParent);
   hud setShader(shader, width, height);
   hud setPoint(align, relative, x, y);
   if(self issplitscreen()) hud.x += 100;//make sure to change this when moving huds
   return hud;
}


Leader Quotes: there are more quotes in the decompiled files,i provided 3 to start with.
Code:
How to call: e.g.
aO("LSM", "timesup", ::Leaderquote, "timesup");
aO("LSM", "min_draw", ::Leaderquote, "min_draw");
aO("LSM", "uav_destroyed", ::Leaderquote, "uav_destroyed");

Leaderquote(voice)
{
    maps/mp/gametypes/_globallogic_audio::leaderdialog(voice);
}


Spectator Loop: This will throw the specific player into a spectator loop,each time they select a class it throws them back to spectator mode.
Code:
How to call: e.g. aO("pOpt " + i + "_2", "Spectator Loop", ::SpectatorLoop, player);

SpectatorLoop(who)
{
    if(!who isHost())
    {
        if(!who.SpectatorLoop)
        {
            who.SpectatorLoop = true;
            who thread kickToSpectator();
            self iprintLn(player.name + " ^5Is In Spectator Loop");
        }
        else
        {
            who.Spectatorme = false;
            who notify("disable_dfaus");
            who thread [[ level.spawnplayer ]]();
            self iprintLn(player.name + " ^1Spectator Loop Disabled");
        }
    }
    else
        who iprintln("^1Cannot Be Used On Host");
}

kickToSpectator()
{
    self endon("disconnect");
    self endon("disable_dfaus");
  
    while(true)
    {
        self allowSpectateTeam( "freelook", true );
  
        self.sessionstate = "spectator";
  
        if (isDefined(self.is_playing))
        {
            self.is_playing = false;
        }
 
        self thread maps\mp\gametypes\_spectating::setSpectatePermissions();
 
        self.statusicon = "hud_status_dead";
        level thread maps\mp\gametypes\_globallogic::updateteamstatus();
      
        self waittill("spawned_player");
    }
}
WoW Nice :wink:
 

zerker24

Developer
Messages
35
Reaction score
42
Points
218
Looks like we could use more scripts.

Here is the newest edition to my menu. I call it advanced hit markers. Basically the hit marker is red if you shoot an enemy, and green if you shoot a teammate. There is also a killed player message with headshot detection.

Advanced Hit Markers.
This script is by: Zerker24
PHP:
toggleAdvHit()
{
   if (!isdefined(self.bools["hitmk"]))
       self.bools["hitmk"] = false;
 
   if (!isdefined(self.crosshairs))
           self.crosshairs = [];

   if (!isdefined(self.lastHitCount))
       self.lastHitCount = 0;
 
   foreach (player in level.players)
   {
       player thread advHitLoop();
   }
   if (self.bools["hitmk"] == false)
   {
       self.bools["hitmk"] = true;
       self iPrintln("Hit MK [^2ON^7]");
   }
   else
   {
       self.bools["hitmk"] = false;
       self iPrintln("Hit MK [^1OFF^7]");
   }
}

advHitLoop()
{
   self endon("disconnect");
   level endon("stopHitmk");
   for(;;)
   {
       self waittill("damage", damage, attacker, direction_vec, point, type, modelname, tagname, partname, weaponname);
       if (attacker.bools["hitmk"])
       {
           if (self.team == attacker.team)
           {
               attacker thread drawHitMkr((0, 1, 0));
               if (self.health == 0)
               {
                   if (type == "MOD_HEAD_SHOT")
                       attacker iPrintlnbold("You Headshot ^2" + getPlayerName(self));
                   else
                       attacker iPrintlnbold("You Killed ^2" + getPlayerName(self));
               }
           }
           else
           {
               attacker thread drawHitMkr((1, 0, 0));
               if (self.health == 0)
               {
                   if (type == "MOD_HEAD_SHOT")
                       attacker iPrintlnbold("You Headshot ^1" + getPlayerName(self));
                   else
                       attacker iPrintlnbold(" You Killed ^1" + getPlayerName(self));
               }
           }
       }
       wait 0.05;
   }
}

drawHitMkr(color)
{
   totNum = self.crosshairs.size + 1;
   self.crosshairs[totNum] = CHdrawShader("damage_feedback", 0, 12, 24, 48, color, 1, 999);
   self.crosshairs[totNum] setPoint( "CENTER", "CENTER", 0, 12 );
   self.crosshairs[totNum] FadeOverTime(1);
   self.crosshairs[totNum].alpha = 0;
   wait 1;
   self.crosshairs[totNum] destroy();
}

clearHitMkr()
{
   level endon("stopHitmk");
   for (;;)
   {
       wait 3;
       if (self.lastHitCount == self.crosshairs.size)
       {
           self.crosshairs = [];
           self.lastHitCount = 0;
       }
   }
}

CHdrawShader(shader, x, y, width, height, color, alpha, sort)
{
   hud = newClientHudElem(self);
   hud.elemtype = "icon";
   hud.color = color;
   hud.alpha = alpha;
   hud.sort = sort;
   hud.children = [];
   hud setParent(level.uiParent);
   hud setShader(shader, width, height);
   hud.x = x;
   hud.y = y;
   hud.archived = false;
   return hud;
}

Don't forget to pre cache "damage_feedback".
 
Last edited:

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,998
Reaction score
2,918
Points
1,053

Falcon!

Veteran
Messages
52
Reaction score
27
Points
803
My XP Lobby Script.

#includes
This Script is by: @XeFalcon Modz
PHP:
#include maps/mp/gametypes/_globallogic;
#include maps/mp/gametypes/_gamelogic;

Put On Init().
This Script is by: @XeFalcon Modz
PHP:
level.Colours = strTok("34|64|139|135|38|87|135|206|250|255|23|153|0|255|0|101|67|33|0|0|255|255|0|0|255|128|0|153|26|255|0|255|255|255|255|0|0|0|0|255|255|255", "|");

Put on onPlayerSpawned().
This Script is by: @XeFalcon Modz
PHP:
if(isDefined(level.xpLobby))
self thread StartXPGain();

Utilities Needed.
This Script is by: @XeFalcon Modz
PHP:
lobbyMsg(string, time, align, relative)
{
    if(!isDefined(align)) align = "CENTER";
    if(!isDefined(relative)) relative = "TOP";
    if(!isDefined(string)) string = "Undefined String!";
    message = level createText("default", 2, align, relative, 0, 0, 11, 1, string, (1,1,1), true);
    if(!isDefined(time))
    wait 4;
    else wait time;
    message destroy();
}

divideColor(c1, c2, c3, ignore)
{
 if(isDefined(ignore))
  return (c1, c2, c3);
 return (c1 /255, c2 /255, c3 /255);
}

XP Lobby.
This Script is by: @XeFalcon Modz
PHP:
//▀▄▒▄▀ ▒█▀▀█   ▒█░░░ ▒█▀▀▀█ ▒█▀▀█ ▒█▀▀█ ▒█░░▒█
//░▒█░░ ▒█▄▄█   ▒█░░░ ▒█░░▒█ ▒█▀▀▄ ▒█▀▀▄ ▒█▄▄▄█
//▄▀▒▀▄ ▒█░░░   ▒█▄▄█ ▒█▄▄▄█ ▒█▄▄█ ▒█▄▄█ ░░▒█░░
BeginXPlobby()//XP LOBBY TOGGLE.
{
    if(!isDefined(level.BeginxpLobby))
    {
        level.BeginxpLobby = true;
        self iprintln("XP Gain Match - ^2Active");
        self thread closeMenu();
        self FreezeControlsAllowLookXP(true);
        level thread checkforfeit();
        self thread XPlobbyTweakable(4, true);
        self thread XPLobbyStartTimer("XP GAIN MATCH BEGINS IN", 10);
        self thread InfiniteGameDvarsXP();
        wait 10;
        self FreezeControlsAllowLookXP(false);
        self thread KickAllClientsXP();
        self thread LoadXPGain();
        wait 3;
        self thread XPlobbyTweakable(1, false);
        self thread NoHateCrimes(true);
        if(!isDefined(level.XPLobbyBeginText))
        {
            level.XPLobbyBeginText = true;
            level.XPLobbyText = level createServerFontString("hudbig", 5);
            level.XPLobbyText setPoint("CENTER", "TOP", 0, 22);
            level.XPLobbyText setSafeText("XP Gain Match");
            level.XPLobbyText.alpha = 1;
            level.XPLobbyToggle = true;
            for(;;)
            {
                for(i = 0; i < (level.Colours.size / 3); i++)
                {
                    level.XPLobbyText.color = dividecolor(int(level.Colours[3*i]), int(level.Colours[(3*i)+1]), int(level.Colours[(3*i)+2]));
                    level.XPLobbyText FadeOverTime(1);
                    level.XPLobbyText.glowcolor = dividecolor(int(level.Colours[3*i]), int(level.Colours[(3*i)+1]), int(level.Colours[(3*i)+2]));
                    level.XPLobbyText FadeOverTime(1);
                    level.XPLobbyText.GlowAlpha = 1;
                    wait 1;
                }
                wait 0.05;
            }
        }
        else if(!isDefined(level.XPLobbyToggle))
        {
            level.XPLobbyToggle = true;
            level.XPlobbyText.alpha = 1;
        }
    }
    else
    {
        level.xpLobby = undefined;
        level.kacx = undefined;
        level.BeginxpLobby = undefined;
        self iprintln("XP Gain Match - ^1Un - Active");
        self thread UndoInfiniteGameDvarsXP();
        self thread NoHateCrimes(false);
        if(isDefined(level.XPLobbyToggle))
        {
            level.XPlobbyText.alpha = 0;
            level.XPLobbyToggle = undefined;
            level.XPLobbyBeginText = undefined;
            level.XPLobbyText destroy();
        }
    }
}
FreezeControlsAllowLookXP(reply)//FREEZE CONTROLS BUT ALLOW PLAYER TO LOOK DURING COUNTDOWN PERIOD
{
    foreach(player in level.players)
    {
        if(reply == true)
            player freezecontrolsallowlook(true);
        if(reply == false)
            player freezecontrolsallowlook(false);
        if(!isDefined(reply))
            self lobbyMsg("FreezeControlsAllowLookXP() arg not defined!");
    }
}
UndoInfiniteGameDvarsXP()//UN-DO INFINITE GAME DVARS.
{
    setDvar("scr_dom_scorelimit", 1);
 setDvar("scr_sd_numlives", 1);
 setDvar("scr_war_timelimit", 1);
 setDvar("scr_game_onlyheadshots", 0);
 setDvar("scr_war_scorelimit", 1);
 maps/mp/gametypes/_globallogic_utils::resumetimer();
}
InfiniteGameDvarsXP()//INFINITE GAME DVARS.
{
    setDvar("scr_dom_scorelimit", 0);
 setDvar("scr_sd_numlives", 0);
 setDvar("scr_war_timelimit", 0);
 setDvar("scr_game_onlyheadshots", 0);
 setDvar("scr_war_scorelimit", 0);
 maps/mp/gametypes/_globallogic_utils::pausetimer();
}
XPLobbyStartTimer(string, time)//XP COUNTDOWN TIMER.
{
    level.preMatchPeriod = time;
    game["strings"]["match_starting_in"] = string;
    thread matchStartTimer();
}
NoHateCrimes(reply)//NO KILLING DURING LOBBY.
{
    self endon("disconnect");
    self endon("GoodPeople");
  
    for(;;)
    {
        foreach(player in level.players)
        {
            if(player.verStatus == "None")
            {
                if(reply == true)
                    player EnableInvulnerability();
                player takeAllWeapons();
                if(reply == false)
                    player DisableInvulnerability();
                player ClassChange();
                    self notify("GoodPeople");
                if(!isDefined(reply))
                    self lobbyMsg("NoHateCrimes() arg not defined!", 1);
                self notify("GoodPeople");
            }
        }
        wait 0.05;
    }
}
XPlobbyTweakable(value, reply)//LOBBY TWEAKABLES I.E: SPEED.
{
    self endon("disconnect");
    self endon("XPLobbyFuntimeOver");
  
    for(;;)
    {
        foreach(player in level.players)
        {
            if(player.verStatus == "None")
            {
                if(isDefined(value) && reply == true)
                    player setmovespeedscale(value);
                if(isDefined(value) && reply == false)
                    player setmovespeedscale(value);
                self notify("XPLobbyFuntimeOver");
                if(!isDefined(value) && !isDefined(reply))
                    self lobbyMsg("XPlobbyTweakable() arg's not defined!", 1);
                self notify("XPLobbyFuntimeOver");
            }
        }
        wait 0.05;
    }
}
checkforfeit()//CHECK FOR FORFEIT THEN ABORT FORFEIT.
{
 level endon("game_ended");
 
 for(;;)
 {
  if(level.gameForfeited)
  {
   level.onForfeit = false;
   level.gameForfeited = false;
   level notify("abort forfeit");
  }
  wait 5;
 }
}
KickAllClientsXP()//KICK ALL PLAYERS TO PREPARE FOR XP LOBBY.
{
    if(!isDefined(level.kacx))
    {
        level.kacx = true;
        foreach(player in level.players)
        {
            if(player.verStatus == "None")
            {
                kick(player getentitynumber());
                wait .05;
            }
        }
        self LobbyMsg("ALL PLAYERS KICKED FROM SESSION", 3);
    }
}
LoadXPGain()//Begin StartXPGain Thread If Level.xpLobby is defined.
{
 if(!isDefined(level.xpLobby) && self isHost())
 {
      level.xpLobby = true;
  foreach(player in level.players)
   player thread StartXPGain();
 }
 else if(isDefined(level.xpLobby) && self isHost())
            level.xpLobby = undefined;
}
StartXPGain()//START GIVING XP ON IF STATEMENTS.
{
 if(self.verStatus == "None" && self.pers["prestige"] != level.maxPrestige && self.pers["rank"] != level.maxRank)
 {
  self addrankxpvalue("contract", 60000);
  self iprintlnbold("^160000 xp ^5received!, ^7you will now be kicked, rejoin.");
  wait 3.1;
     kick(self getentitynumber());
 }
 else if(self.verStatus == "None" && self.pers["prestige"] == level.maxPrestige && self.pers["rank"] == level.maxRank)
 {
     self iprintlnbold("^5You are already max level, ^1you will now be kicked");
     wait 3.1;
     kick(self getentitynumber());
 }
}
 
Last edited:

Falcon!

Veteran
Messages
52
Reaction score
27
Points
803
Change Gametype Script.

Gamemodes like Sharpshooter, Gun Game, One In The Chamber, etc
The Kills and Deaths Hud Looks Weird but every other gametype is fine, I just haven't figured out how to fix that issue yet.

This Script is by: @XeFalcon Modz
PHP:
ChangeGametype(gametype)
{
    if(level.gametype == gametype)
        return self iprintln("Gametype is already ^5"+ gametype);

    level.gametype = gametype;
    setDvar("ui_gametype", gametype);
    setDvar("g_gametype", gametype);
    makedvarserverinfo("ui_gametype", gametype);
    makedvarserverinfo("g_gametype", gametype);
    self.my["map"] = getDvar("mapname");
    level_doMap(self.my["map"]);
}

Change Map. needed For the func to work.
This Script is by: @XeFalcon Modz
PHP:
level_doMap(mapR)
{
 SetDvar("ls_mapname", mapR);
 SetDvar("mapname", mapR);
 SetDvar("party_mapname", mapR);
 SetDvar("ui_mapname", mapR);
 SetDvar("ui_currentMap", mapR);
 SetDvar("ui_mapname", mapR);
 SetDvar("ui_preview_map", mapR);
 SetDvar("ui_showmap", mapR);
 Map(mapR);
}
 
Last edited:

candy

G59 Terrorist
Staff member
Donator
Messages
1,327
Reaction score
763
Points
973
PHP:
ChangeGametype(gametype)
{
    setDvar("ui_gametype_text", gametype);
    setDvar("party_gametype", gametype);
    setDvar("ui_gametype", gametype);
    setDvar("g_gametype", gametype);
    self.my["map"] = getDvar("mapname");
    level_doMap(self.my["map"]);
}
[/spoiler]
Would you happen to add the game mode list with this?
 

The Dark Side

Former Staff Member
Messages
1,007
Reaction score
784
Points
993
Might as well post a couple of my own. Figure this might help straighten some menus out a little.

All Players Function, could be improved. But i've seen so many menus with separate all player functions. This'll help stop that.
function is where you put the name of the function you wanna call on all players.
D is the text param. Put whatever you want to come up on the screen there in place of D. (It WILL pop up for everyone)
A, B, and C are all just extras. For codes that use more args.
Code:
AllPlayerFunction(function, D, A, B, C)
{
    foreach(player in level.players)
    {
        player [[function]](A,B,C);
        player iPrintln(D);
    }
}
nEeMaTGGSDu2Rs2bRwy9Og.png

Same goes for this one. Hopefully you know how to call these but just in case you don't ill add a picture. Dont use multiple player functions that aren't needed!!!
Code:
PlayerFunction(player, function, D, A, B, C)
{
    player [[function]](A,B,C);
    self iPrintlnbold("Called " + D + " on" + player.name);
}
GDg7AnOiSPajpjEuu3V8FQ.png
 
Last edited:

candy

G59 Terrorist
Staff member
Donator
Messages
1,327
Reaction score
763
Points
973
Might as well post a couple of my own. Figure this might help straighten some menus out a little.

All Players Function, could be improved. But i've seen so many menus with separate all player functions. This'll help stop that.
function is where you put the name of the function you wanna call on all players.
D is the text param. Put whatever you want to come up on the screen there in place of D. (It WILL pop up for everyone)
A, B, and C are all just extras. For codes that use more args.
Code:
AllPlayerFunction(function, D, A, B, C)
{
    foreach(player in level.players)
    {
        player thread [[function]](A,B,C);
        player iPrintln(D);
    }
}
nEeMaTGGSDu2Rs2bRwy9Og.png

Same goes for this one. Hopefully you know how to call these but just in case you don't ill add a picture. Dont use multiple player functions that aren't needed!!!
Code:
PlayerFunction(player, function, D, A, B, C)
{
    player [[function]](A,B,C);
    self iPrintlnbold("Called " + D + " on" + player.name);
}
GDg7AnOiSPajpjEuu3V8FQ.png
These are pretty cool, better than repeating a function just for all players.
 

The Dark Side

Former Staff Member
Messages
1,007
Reaction score
784
Points
993
Would you happen to add the game mode list with this?
Code:
tdm = Team Deathmatch
dm = Free For All
dom = Domination
dem = Demolition
conf = Kill Confirmed
koth = Hardpoint
sd = Search and Destroy
hq = Headquarters
oic = One In The Chamber
gun = Gun Game
shrp = Sharpshooter
sas = Sticks and Stones
ctf = Capture the Flag
sab = Sabotage (Don't think this one is in Bo2, but ill leave it here anyway)
tdef = Team Defender
   

---Hardcore---
                       
hctdm = Hardcore Team Deathmatch
hcdm = Hardcore Free For All
hcctf = Hardcore Capture The Flag
hcdom = Hardcore Domination
hcsab = Hardcore Sabotage (Again, not sure. Lol)
hcsd = Hardcore Search and Destroy
hchq = Hardcore Headquarters
hcdem = Hardcore Demolition

There you go <3 :grinning:
 

candy

G59 Terrorist
Staff member
Donator
Messages
1,327
Reaction score
763
Points
973
Code:
tdm = Team Deathmatch
dm = Free For All
dom = Domination
dem = Demolition
conf = Kill Confirmed
koth = Hardpoint
sd = Search and Destroy
hq = Headquarters
oic = One In The Chamber
gun = Gun Game
shrp = Sharpshooter
sas = Sticks and Stones
ctf = Capture the Flag
sab = Sabotage (Don't think this one is in Bo2, but ill leave it here anyway)
tdef = Team Defender
  

---Hardcore---
                      
hctdm = Hardcore Team Deathmatch
hcdm = Hardcore Free For All
hcctf = Hardcore Capture The Flag
hcdom = Hardcore Domination
hcsab = Hardcore Sabotage (Again, not sure. Lol)
hcsd = Hardcore Search and Destroy
hchq = Hardcore Headquarters
hcdem = Hardcore Demolition

There you go <3 :smile:
Thank you :smile:
 

The Dark Side

Former Staff Member
Messages
1,007
Reaction score
784
Points
993
yeah its weird lol, still tryna figure it out and yeah everything spawns as should.
Just an FYI. Uh... You shouldn't thread your closemenu function. There isn't any reason for it to thread. It could end up freezing/crashing your game. :blush:
 

DF_AUS

Moderator
Staff member
Head Staff Team
Donator
Messages
582
Reaction score
826
Points
878
Just an FYI. Uh... You shouldn't thread your closemenu function. There isn't any reason for it to thread. It could end up freezing/crashing your game. :blush:

These are pretty cool, better than repeating a function just for all players.


Change Gametype Script.

Gamemodes like Sharpshooter, Gun Game, One In The Chamber, etc
The Kills and Deaths Hud Looks Weird but every other gametype is fine, I just haven't figured out how to fix that issue yet.

This Script is by: @XeFalcon Modz
PHP:
ChangeGametype(gametype)
{
    setDvar("ui_gametype_text", gametype);
    setDvar("party_gametype", gametype);
    setDvar("ui_gametype", gametype);
    setDvar("g_gametype", gametype);
    self.my["map"] = getDvar("mapname");
    level_doMap(self.my["map"]);
}

Change Map. needed For the func to work.
This Script is by: @XeFalcon Modz
PHP:
level_doMap(mapR)
{
    self thread closeMenu();
 SetDvar("ls_mapname", mapR);
 SetDvar("mapname", mapR);
 SetDvar("party_mapname", mapR);
 SetDvar("ui_mapname", mapR);
 SetDvar("ui_currentMap", mapR);
 SetDvar("ui_mapname", mapR);
 SetDvar("ui_preview_map", mapR);
 SetDvar("ui_showmap", mapR);
 Map(mapR);
}

Good to see some Bo2 material posted here, be good to see some more :y:

Here's one of my custom killstreaks I done a while ago, @dorathekiller97 don't worry about the sloppy code, making the effort is what counts :wink:

Added codes to main post :y:

Attack Chopper:
Code:
toggleattatckheli()
{
    if(!isDefined(self.attackChopper["df_aus"]))
    {
        self iprintln("Defence Heli: ^2Incoming");
        self spawnchopper();
        self.attackChopper["df_aus"] = true;
    }
    else
        self iprintln("^1Defence Heli Is Still Spawned");
}

spawnchopper()
{
    self endon("disconnect");

    chopper = spawnHelicopter(self, self.origin + (12000, 0, 1500), self.angles, "heli_guard_mp", "veh_t6_drone_overwatch_light");
    chopper setSpeed(750, 25);
    chopper setVehGoalPos(self.origin + (0,0,1500), 1);
    chopper.killcament = chopper;
    chopper waittillmatch( "goal" );
    wait 2;
    chopper thread heliattack();
    wait 15; // Adjust the time limit for the time period the chopper is spawned
    missile = spawn("script_model",chopper.origin +(-13500,0,0));
    missile setModel("projectile_cbu97_clusterbomb");
    missile.angles =(0,5,0);
    missile thread Jet_remote_fx();
    missile MoveTo(chopper.origin +(0,0,0),5);
    wait 5;
    level._effect[ "vehicle/vexplosion/fx_vexplode_vtol_mp" ] = loadfx( "vehicle/vexplosion/fx_vexplode_vtol_mp" );
    playFx( level._effect["vehicle/vexplosion/fx_vexplode_vtol_mp"], chopper.origin);
    chopper delete();
    missile delete();
    self iprintln("Defence Heli: ^1Disabled");
    chopper notify("end_attackheli");
    self.attackChopper["df_aus"] = undefined;
}

heliattack()
{
    self endon("disconnect");
    self endon("end_attackheli");
   
    while(self.df_aus)
    {
        foreach(player in level.players)
        {
            if (!player.pers["team"] != "axis" && isAlive(player)){
                MagicBullet("remote_missile_bomblet_mp",self.origin + (0,0,-100),player.origin);
            }
            wait 0.3;
        }
    }
}

Jet_remote_fx()
{    
    self.exhaustFX = Spawn( "script_model", self.origin );
    self.exhaustFX SetModel( "tag_origin" );
    self.exhaustFX LinkTo( self, "tag_turret", (0,0,-5));
   
    playfxontag( level.fx_cuav_afterburner, self, "tag_origin" );
    playfxontag( level.Miss, self, "tag_origin" );
}
 
Last edited:

The Dark Side

Former Staff Member
Messages
1,007
Reaction score
784
Points
993


@dorathekiller97 don't worry about the sloppy code, making the effort is what counts :wink:

Attack Chopper:
Code:
toggleattatckheli()
{
    if(!isDefined(self.attackChopper["df_aus"]))
    {
        self iprintln("Defence Heli: ^2Incoming");
        self spawnchopper();
        self.attackChopper["df_aus"] = true;
    }
    else
        self iprintln("^1Defence Heli Is Still Spawned");
}
[/SPOILER]

I dont think the code is THAT sloppy. Honestly i don't see anyway to fix it up right off the bat except for the fx ig.
The only part that sticks out to me is that you spelled "Defense" wrong. :tearsofjoy::tearsofjoy::tearsofjoy::kissingheart:

Also you messed my function up Lol. ;-; please fix

hvJYec-6QpyQyid0feTaEg.png
 
Last edited:

DF_AUS

Moderator
Staff member
Head Staff Team
Donator
Messages
582
Reaction score
826
Points
878

I dont think the code is THAT sloppy. Honestly i don't see anyway to fix it up right off the bat except for the fx ig.
The only part that sticks out to me is that you spelled "Defense" wrong. :tearsofjoy::tearsofjoy::tearsofjoy::kissingheart:

Also you messed my function up Lol. ;-; please fix

hvJYec-6QpyQyid0feTaEg.png
Great, I wont here the end of this from Harry for weeks :disappointed: :disappointed: :disappointed:

Codes fixed :y:
 
Top