Release [GSC] Zombies Gun Game

MrFawkes1337

Member
Messages
11
Points
8
Basic bit of code, taken from Zeiiken's Gr3zz v4.1 and updated to BO3. Threading randomize from array_shared didnt seem to work, however copying the function loads it fine.

Code:
C++:
function randomize2( array )
{
    for ( i = 0; i < array.size; i++ )
    {
        j = RandomInt( array.size );
        temp = array[ i ];
        array[ i ] = array[ j ];
        array[ j ] = temp;
    }

    return array;
}

function doGunGame()
{
        self thread ZombieKill();
        self thread RoundEdit(15);
        foreach(player in level.players)
        {
                player thread GunGame();
                player iPrintlnBold("^1G^7un ^1G^7ame");
                wait 2;
                player iPrintlnBold("^1H^7ave ^1F^7un !");
        }
}
function GunGame()
{
        self endon("death");
        self endon("disconnect");
        wait 5;
        keys=GetArrayKeys(level.zombie_weapons);
        weaps = randomize2(keys);
        self TakeAllWeapons();
        self GiveWeapon(weaps[0]);
        self SwitchToWeapon(weaps[0]);
        for(i=1;i <= weaps.size-1;i++)
        {
                self waittill("zom_kill");
                self iPrintlnBold("New Weapon ^2Given. ^7Kills ^2"+i);
                self TakeAllWeapons();
                self GiveWeapon(weaps[i]);
                self SwitchToWeapon(weaps[i]);
        }
}

function RoundEdit(round)
{
    self thread zm_utility::zombie_goto_round(round);
    self iprintln("Round Set To: "+round);
}

function ZombieKill()
{
        z=GetAITeamArray(level.zombie_team);
        level.zombie_total=0;
        if(isDefined(z))
        {
                for(i=0;i<z.size;i++)
                {
                        z[i] dodamage(z[i].health * 5000,(0,0,0),self);
                        wait 0.05;
                }
                self iPrintln("All Zombies ^1Eliminated");
        }
}
enjoy!
 
Last edited:

Top