GSC GSC Functions by RGH Danny

RGH Danny

Modder
Messages
67
Points
118
Hello and thank you for reading this thread.
In this thread you can see some useful GSC Codes for
Call of Duty: Black Ops II (Multiplayer-Mode only)
I don't need to get any credits. Have fun.




Simple

Code:
self iPrintln("string " + self.name); //Prints a text on the bottom left "string <YOUR NAME>"
self iPrintlnbold("stringBIG " + self.name); //Prints a text in the center "stringBIG <YOUR NAME>"

// self means, only you will see this text
Code:
WelcomeMessage(Line1, Line2, Time)
{
    notifyData = spawnstruct();
    notifyData.titleText = Line1; //Line 1
    notifyData.notifyText = Line2; //Line 2
    notifyData.glowColor = (2.55, 0, 0); //RGB Color array divided by 100
    notifyData.Color = (1, 1, 1);
    notifyData.duration = Time; //Change Duration
    notifyData.font = "objective"; //font
    notifyData.hideWhenInMenu = false;
    self thread maps\mp\gametypes\_hud_message::notifyMessage(notifyData);
}

Standard

Code:
GodMode()
{
    if(self.godmode == false)
    {
        self enableInvulnerability();  //ON
        self iPrintln("God Mode [^2ON^7]");
        self.godmode = true;
    }
    else
    {
        self disableInvulnerability();  //OFF
        self iPrintln("God Mode [^1OFF^7]");
        self.godmode = false;
    }
}
Code:
Toggle_unlimitedammo()
{
    if(self.unlimitedammo == false)
    {
        self.unlimitedammo = true;
        self iPrintln("Unlimited Ammo [^2ON^7]");
        self thread unlimited_ammo();
    }
    else
    {
        self.unlimitedammo = false;
        self iPrintln("Unlimited Ammo [^1OFF^7]");
        self notify("stop_unlimitedammo");
    }
}

unlimited_ammo()
{
    self endon("stop_unlimitedammo");
    for(;;)
    {
        wait 0.1;

        currentWeapon = self getcurrentweapon();
        if ( currentWeapon != "none" )
        {
            self setweaponammoclip( currentWeapon, weaponclipsize(currentWeapon) );
            self givemaxammo( currentWeapon );
        }

        currentoffhand = self getcurrentoffhand();
        if ( currentoffhand != "none" )
            self givemaxammo( currentoffhand );
    }
}
Code:
giveAllStreaks()
{
    self iPrintln("All Scorestreaks ^2Given");
    maps/mp/gametypes/_globallogic_score::_setplayermomentum(self, 9999);
}
Code:
   // !GodMode Thread is needed!
   // !GodMode Thread is needed!
   // !GodMode Thread is needed!
myTeam_God()  // FOR YOUR TEAM
{
    if(self.myTeamGod == 0)
    {
        self iPrintln("GodMode [^2ON^7] : ^2My Team");
        self.myTeamGod = 1;
        foreach(player in level.players)
        {
            if(player.team == self.team)
            {
                player.god = false;
                player thread GodMode();
            }
        }
    }
    else
    {
        self iPrintln("GodMode [^1OFF^7] : ^2My Team");
        self.myTeamGod = 0;
        foreach(player in level.players)
        {
            if(player.team == self.team)
            {
                player.god = true;
                player thread GodMode();
            }
        }
    }
}


enmyTeam_God() // FOR YOUR THE ENEMY TEAM
{
    if(self.enmyTeamGod == 0)
    {
        self iPrintln("GodMode [^2ON^7] : ^1Enemy Team");
        self.enmyTeamGod = 1;
        foreach(player in level.players)
        {
            if(player.team != self.team)
            {
                player.god = false;
                player thread GodMode();
            }
        }
    }
    else
    {
        self iPrintln("GodMode [^1OFF^7] : ^1Enemy Team");
        self.enmyTeamGod = 0;
        foreach(player in level.players)
        {
            if(player.team != self.team)
            {
                player.god = true;
                player thread GodMode();
            }
        }
    }
}

Advanced
Code:
GameModeInit()
{
    self.money = [];
    self.money["wallet"] = 200; // Edit your start money
    self.money["multiplaier"] = 1; // Edit your start multiplaier
    self.money["whenKill"] = 50; // Edit the cash when you kill somebody
    self.money["whenDie"] = 30; // Edit the money you'll lose, if you die
    self.money["loopReward"] = 20; // Edit the money you'll get, after loopTime seconds
    self.money["loopTime"] = 30; // Edit the loop Time  duration
     
    self thread moneyWhenKill();
    self thread moneyWhenDie();
    self thread moneyLoop();
    self thread moneyhealthHuD();
}
moneyLoop()
{
    for(;;)
    {
        wait self.money["loopTime"];
        self.money["wallet"] = self.money["wallet"] + (self.money["loopReward"] * self.money["multiplaier"]);
        self iPrintln("You Got ^2$" + self.money["loopReward"] + "^7! Wait Another ^1" + self.money["loopTime"] + " Seconds ^7For The Next Reward");
    }
}
moneyWhenDie()
{
    self.deathsUPDATE = self.pers["deaths"];

    for(;;)
    {
        if(self.deathsUPDATE < self.pers["deaths"])
        {
            if( self.money["wallet"] >= self.money["whenDie"] )
            {
                self.money["wallet"] = self.money["wallet"] - self.money["whenDie"];
                self iPrintln("You ^1Died^7! ^1-$" + self.money["whenDie"] + " ^7Money Remaining: ^2$" + self.money["wallet"]);
                self.deathsUPDATE = self.pers["deaths"];
            }
            else
            {
                self.wallet = self.money["wallet"];
                self.money["wallet"] = self.money["wallet"] - self.money["wallet"]; // this is, that the moneywallet won't get under 0
                self iPrintln("You ^1Died^7! ^1-$" + self.wallet + " ^7Money Remaining: ^2$" + self.money["wallet"]);
                self.deathsUPDATE = self.pers["deaths"];
            }
        }
        wait .1;
    }
}
moneyWhenKill()
{
    self.killsUPDATE = self.pers["kills"];

    for(;;)
    {
        if(self.killsUPDATE < self.pers["kills"])
        {
            self.money["wallet"] = self.money["wallet"] + (self.money["whenKill"] * self.money["multiplaier"]);
            self iPrintln("You ^2Killed ^7Another Player! ^2+$" + self.money["whenKill"] + " ^7Money Remainin: ^2$" + self.money["wallet"]);
 
            self.killsUPDATE = self.pers["kills"];
        }
        wait .1;
    }
}
moneyhealthHuD()
{
    storeMoneyHuD = self createFontString("default", 2);
    storeMoneyHuD setPoint("LEFT", "LEFT", 0, 0);
    StoreMoneyHuD.glowAlpha = 1;

    storeHealthHuD = self createFontString("default", 2);
    storeHealthHuD setPoint("LEFT", "LEFT", 0, 30);
    storeHealthHuD.glowColor = (2.55, 0, 0);
    StoreHealthHuD.glowAlpha = 1;

    if(self.money["wallet"] >= 0)
    {
          storeMoneyHuD setText("Money: $" + self.money["wallet"]);
        StoreMoneyHuD.glowColor = (0, 2.55, 0);
    }
    else
    {
        storeMoneyHuD setText("Money: -$" + (self.money["wallet"] * -1));
        StoreMoneyHuD.glowColor = (2.55, 0, 0);
    }
    storeHealthHuD setText("Health: " + self.health + "/" + self.maxhealth);

    self.update["money"] = self.money["wallet"];
    self.update["health"] = self.health;
    self.update["maxhealth"] = self.maxhealth;

    for(;;)
    {
        if(self.money["wallet"] != self.update["money"]) // To prevent overflows
        {
            if(self.money["wallet"] >= 0)
            {
                storeMoneyHuD setText("Money: $" + self.money["wallet"]);
                StoreMoneyHuD.glowColor = (0, 2.55, 0);
            }
            else
            {
                storeMoneyHuD setText("Money: -$" + (self.money["wallet"] * -1));
                StoreMoneyHuD.glowColor = (2.55, 0, 0);
            }
            self.update["money"] = self.money["wallet"];
        }
        if(self.health != self.update["health"] || self.maxhealth != self.update["maxhealth"]) // To prevent overflows
        {
            storeHealthHuD setText("Health: " + self.health + "/" + self.maxhealth);
            self.update["health"] = self.health;
            self.update["maxhealth"] = self.maxhealth;
        }
        wait .2;
    }
}

REST IS COMING SOON!
 
Last edited:

The Dark Side

Former Staff Member
Messages
1,006
Points
568
Looks like you just ripped the money management from sharks zombie land and I have no words for the others.
If he's posting how to do iPrints... maybe he knows he's appealing to an audience who knows 0 to nothing about gsc. This is to help them with the simplest of the simple. No need to use that high horse attitude here. Be nice... :/
 

RGH Danny

Modder
Messages
67
Points
118
Looks like you just ripped the money management from sharks zombie land and I have no words for the others.
No, I swear to god this money-system is 100% selfmade, please compare these two sources, you will see, the system is not like the system from Shark. And the other functions are just the beginning, I'll update this, but Im really ill since last saturday, so there were no updates.
 

Top