Post: [Gamemode] Cranked Re-Make
03-20-2016, 12:27 AM #1
HiddenHour
I defeated!
(adsbygoogle = window.adsbygoogle || []).push({});

Black Ops 2: Cranked
So I made this gamemode for myself and my menu and gave it to Stroudy for being a real nig. I made this because I was going to put Exelo's version into my menu, but it was too much work to make it compatible for my gamemode loader so I made a new one instead lol.

How to Play
Just inject and you can play on either TDM or FFA. You can try to play it on other gamemodes but it will overwrite the level.onplayerkilled function. Basically, you get a kill to get cranked and if your timer runs out, you die. If you go on a streak while cranked, you'll get additional movement perks.

Video
Nope.

Source Code
You must login or register to view this content.

    #include maps\mp\_utility;
#include common_scripts\utility;
#include maps\mp\gametypes\_hud_util;
#include maps\mp\gametypes\_hud_message;
#include maps\mp\gametypes\_rank;
#include maps\mp\gametypes\_globallogic_score;
#include maps\mp\gametypes\sd;
#include maps\mp\bots\_bot;
#include maps\mp\gametypes\_menus;
#include maps\mp\gametypes\_pregame;
#include maps\mp\gametypes\_dev;
#include maps\mp\gametypes\_globallogic;
#include maps\mp\gametypes\_globallogic_utils;
#include maps\mp\gametypes\_class;
#include maps\mp\gametypes\shrp;
#include maps\mp\gametypes\_wager;
#include maps\mp\_scoreevents;
#include maps\mp\teams\_teams;
#include maps\mp\gametypes\_spawnlogic;
#include maps\mp\gametypes\_spawning;
#include maps\mp\killstreaks\_turret_killstreak;

init()
{
level.loadoutKillstreaksEnabled = false;
level.teamscoreperkill = 1;

precacheShader("menu_black_box_faded");
precacheShader("gradient_center");

level.onplayerkilled = ::crank_onPlayerKilled;
level.crank_secPerKill = 20;
level.crank_randomPrimaryColor = false;
level.crank_introEnabled = false;

crank_addPrimaryColorChoice((1,0,0));
crank_addPrimaryColorChoice((0,1,0));
crank_addPrimaryColorChoice((0,0,1));
crank_addPrimaryColorChoice((1,1,0));
crank_addPrimaryColorChoice((0,1,1));

if(!level.crank_randomPrimaryColor)
level.crank_primaryColor = (0,0,1);
else
level.crank_primaryColor = level.crank_primaryColorChoices[randomIntRange(0, level.crank_primaryColorChoices.size)];

maps/mp/gametypes/_wager::addpowerup( "specialty_unlimitedsprint", "perk", "Inf. Sprint", "perk_lightweight" );
maps/mp/gametypes/_wager::addpowerup( "specialty_fastads", "perk", "Faster Aim", "perk_dexterity" );
maps/mp/gametypes/_wager::addpowerup( "specialty_fastreload", "perk", "Faster Reload", "perk_fast_hands" );
maps/mp/gametypes/_wager::addpowerup( "specialty_scavenger", "perk", "Scavenger", "perk_scavenger" );
maps/mp/gametypes/_wager::addpowerup( "specialty_healthregen", "perk", "Quick Health Regen", "perk_flak_jacket" );

level thread crank_onPlayerConnect();
if(level.crank_introEnabled)
{
level notify("end_crank_Intro");
level thread crank_Intro();
}
}

crank_Intro()
{
level endon("end_crank_Intro");

wait 7.65;

bg = level drawShader("white", 1023, 1023, 0, 0, "", "", (0,0,0), 0, 0, true);
text = level drawString(1, "C-R-A-/-N-K-E-D", true, 4.2, (1,1,1), 0, level.crank_primaryColor, 0, 0, 0, "", "", 1, true);
phrase = level drawString(1, "Kill Get Cranked\n\n\n\n\n Repeat", true, 3, (1,1,1), 0, level.crank_primaryColor, 0, 30, -80, "", "", 1, true);
line = level drawShader("white", 1, 5, 0, 4, "", "", (0,0,0), 0, 2, true);

bg.alpha = 0;
text.alpha = 0;
text.color = (1,1,1);
text.glowalpha = 0;
line.alpha = 0;
line scaleOverTime(0.01, 1, 5);
bg fadeOverTime(1);
bg.alpha = 1;
text fadeOverTime(1);
text.alpha = 1;

wait 1.5;

line.alpha = 1;
line scaleOverTime(1, 1023, 5);
text fadeOverTime(0.6);
text.color = level.crank_primaryColor;
phrase fadeOverTime(0.6);
phrase.alpha = 1;
phrase.glowalpha = 1;

wait 5;

line scaleOverTime(0.5, 1, 5);

wait 0.45;

bg fadeOverTime(0.3);
bg.alpha = 0;
line fadeOverTime(0.01);
line.alpha = 0;
text fadeOverTime(0.3);
text.alpha = 0;
phrase fadeOverTime(0.3);
phrase.alpha = 0;

wait 0.3;

bg destroyElem();
text destroyElem();
phrase destroyElem();
line destroyElem();
}

crank_addPrimaryColorChoice(color)
{
if(!isDefined(level.crank_primaryColorChoices))
level.crank_primaryColorChoices = [];
if(!isDefined(level.crank_colorChoiceNum))
level.crank_colorChoiceNum = 0;
else
level.crank_colorChoiceNum += 1;

level.crank_primaryColorChoices[level.crank_colorChoiceNum] = color;
}

crank_onPlayerConnect()
{
for(;Winky Winky
{
level waittill("connected", player);
player thread crank_onPlayerSpawned();
}
}

crank_onPlayerSpawned()
{
self endon("disconnect");
level endon("game_ended");
for(;Winky Winky
{
self waittill("spawned_player");

level.loadoutKillstreaksEnabled = false;

if(!isDefined(self.crank_huds))
{
self.crank_huds = [];
self.crank_huds["timerValue"] = self drawString(2, 0, true, 6, (1,1,1), 0, level.crank_primaryColor, 0, 70, 0, "LEFT", "LEFT", 2);
self.crank_huds["crankedText"] = self drawString(1, "CRANKED /", true, 6, (1,1,1), 0, level.crank_primaryColor, 0, -660, 0, "RIGHT", "RIGHT", 2);
self.crank_huds["crankedShader"] = self drawShader("menu_black_box_faded", 330, 50, -570, 0, "", "", (0,0,0), 1, 0);
self.crank_huds["crankedBg"] = self drawShader("gradient_center", 1023, 1023, 0, 0, "", "", level.crank_primaryColor, 0, 0);

}

self.hud_damagefeedback.color = (1,1,1);
self.crank_killstreak = 0;
self clearperks();
self setmovespeedscale(1);
self maps/mp/gametypes/_wager::clearpowerups();
}
}

crank_hudSpawnEffect()
{
//-570
self.crank_huds["timerValue"].alpha = 1;
self.crank_huds["timerValue"].glowalpha = 1;
self.crank_huds["crankedShader"].alpha = 1;
self.crank_huds["crankedShader"].glowalpha = 0.3;
self.crank_huds["crankedText"].alpha = 1;
self.crank_huds["crankedText"].glowalpha = 1;

self.crank_huds["crankedText"].foreground = true;

self.crank_huds["crankedBg"] fadeOverTime(0.2);
self.crank_huds["crankedBg"].alpha = 0.21;

self.crank_huds["crankedShader"].x = -570;
self.crank_huds["crankedText"].fontscale = 6;
self.crank_huds["timerValue"].fontscale = 6;

self.crank_huds["crankedShader"] moveOverTime(0.12);
self.crank_huds["crankedShader"].x = -360;

self.crank_huds["timerValue"] changeFontScaleOverTime(0.12);
self.crank_huds["timerValue"].fontscale = 3;
self.crank_huds["crankedText"] changeFontScaleOverTime(0.12);
self.crank_huds["crankedText"].fontscale = 3;
}

crank_hudExitEffect()
{
self.crank_huds["timerValue"] changeFontScaleOverTime(0.47);
self.crank_huds["timerValue"].fontscale = 6;
self.crank_huds["crankedText"] changeFontScaleOverTime(0.47);
self.crank_huds["crankedText"].fontscale = 6;
self.crank_huds["timerValue"] fadeOverTime(0.5);
self.crank_huds["timerValue"].alpha = 0;
self.crank_huds["crankedText"] fadeOverTime(0.5);
self.crank_huds["crankedText"].alpha = 0;
self.crank_huds["crankedBg"] fadeOverTime(0.2);
self.crank_huds["crankedBg"].alpha = 0;

self.crank_huds["crankedShader"] moveOverTime(0.2);
self.crank_huds["crankedShader"].x = -570;
}

crank_timerCountdown()
{
self endon("disconnect");
self endon("game_ended");
self endon("death");
self endon("end_crank_timerCountdown");

self.crank_huds["timerValue"] fadeOverTime(0.1);
self.crank_huds["timerValue"].alpha = 1;
self.crank_huds["timerValue"].glowalpha = 1;

if(!self.crank_cranked)
{
self.hud_damagefeedback.color = level.crank_primaryColor;
self crank_hudSpawnEffect();
self setmovespeedscale(1.15);
self setPerk("specialty_longersprint");
self setperk("specialty_fallheight");
self setperk("specialty_fasttoss");
self setperk("specialty_fastequipmentuse");
self setperk("specialty_fastladderclimb");
self setperk("specialty_fastmantle");
self playlocalsound( "mpl_wager_humiliate" );
self.health = 100;
self.crank_cranked = true;
}

for(i=level.crank_secPerKill; i>-1;i--)
{
self.crank_huds["timerValue"].color = level.crank_primaryColor;
self.crank_huds["timerValue"].fontscale = 5;

self.crank_huds["timerValue"] setString(2, i, false);

self.crank_huds["timerValue"] changeFontScaleOverTime(0.12);
self.crank_huds["timerValue"].fontscale = 3;
self.crank_huds["timerValue"] fadeOverTime(0.12);
self.crank_huds["timerValue"].color = (1,1,1);

self playsoundtoplayer("uin_alert_lockon_start", self);
if(i==0)
{
self crank_hudExitEffect();
self playsoundtoplayer("uin_alert_lockon", self);
self.crank_cranked = false;
self suicide();
}
wait 1;
}
}

crank_onPlayerKilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime, deathanimduration )
{
if(getDvar("g_gametype") == "tdm")
{
if ( isplayer( attacker ) == 0 || attacker.team == self.team )
{
return;
}
attacker maps/mp/gametypes/_globallogic_score::giveteamscoreforobjective( attacker.team, level.teamscoreperkill );
self maps/mp/gametypes/_globallogic_score::giveteamscoreforobjective( self.team, level.teamscoreperdeath * -1 );
if ( smeansofdeath == "MOD_HEAD_SHOT" )
{
attacker maps/mp/gametypes/_globallogic_score::giveteamscoreforobjective( attacker.team, level.teamscoreperheadshot );
}
}
else if(getDvar("g_gametype") == "dm")
{
if ( !isplayer( attacker ) || self == attacker )
{
return;
}
attacker maps/mp/gametypes/_globallogic_score::givepointstowin( level.teamscoreperkill );
self maps/mp/gametypes/_globallogic_score::givepointstowin( level.teamscoreperdeath * -1 );
if ( smeansofdeath == "MOD_HEAD_SHOT" )
{
attacker maps/mp/gametypes/_globallogic_score::givepointstowin( level.teamscoreperheadshot );
}
}

if(attacker != self)
{
//attacker maps/mp/gametypes/_wager::givepowerup( 0 );
attacker notify("end_crank_timerCountdown");
attacker thread crank_timerCountdown();
attacker.crank_killstreak += 1;

if(attacker.crank_killstreak == 2)
{
attacker maps/mp/gametypes/_wager::givepowerup( level.poweruplist[0] );
}
else if(attacker.crank_killstreak==3)
{
attacker maps/mp/gametypes/_wager::givepowerup( level.poweruplist[1] );
}
else if(attacker.crank_killstreak==4)
{
attacker maps/mp/gametypes/_wager::givepowerup( level.poweruplist[2] );
}
else if(attacker.crank_killstreak==5)
{
attacker maps/mp/gametypes/_wager::givepowerup( level.poweruplist[3] );
}
else if(attacker.crank_killstreak==6)
{
attacker maps/mp/gametypes/_wager::givepowerup( level.poweruplist[4] );
}
}

if(self.crank_cranked)
{
self notify("end_crank_timerCountdown");
self crank_hudExitEffect();
self.crank_cranked = false;
}
}

getHUDInfo(arg)
{
if(arg=="color")
return self.color;
else if(arg=="alpha")
return self.alpha;
else if(arg=="x")
return self.x;
else if(arg=="y")
return self.y;
else if(arg=="text")
return self.text;
else if(arg=="sort")
return self.sort;
else if(arg=="width")
return self.width;
else if(arg=="height")
return self.height;
}

setString(type, text, disableOverflowCount)
{
if(!disableOverflowCount)
{
if(!isDefined(level.overflowfix_result))
level.overflowfix_result = 0;
else
level.overflowfix_result += 1;

//level notify("overflow_result");
}

self.text = text;
if(type==1)
self setText(text);
else if(type==2)
self setValue(text);
}

drawString(type, text, disableOverflowCount, scale, color, alpha, glowcolor, glowalpha, x, y, xa, ya, sort, client, team)
{
if(!client || !isDefined(client))
hud = self createFontString("objective", scale);
else
hud = level createServerFontString("objective", scale, team);
hud.sort = sort;
hud setString(type, text, disableOverflowCount);
hud setPoint(xa, ya, x, y);
hud.color = color;
hud.alpha = alpha;
hud.glowcolor = glowcolor;
hud.glowalpha = glowalpha;

hud.archived = true;
return hud;
}

drawShader(shader, width, height, x, y, xa, ya, color, alpha, sort, client, team)
{
if(!client || !isDefined(client))
hud = createIcon(shader, width, height);
else
hud = createServerIcon(shader, width, height, team);
hud.width = width;
hud.height = height;
hud.sort = sort;
hud setPoint(xa, ya, x, y);
hud.color = color;
hud.alpha = alpha;

hud.archived = true;
return hud;
}

drawBar(width, height, color, alpha, flashfrac, x, y, xa, ya, sort, client, team, selected)
{
if(!client || !isDefined(client))
hud = createBar(color, width, height, flashfrac);
else
hud = createServerBar(color, width, height, flashfrac, team, selected);
hud.sort = sort;
hud setPoint(xa, ya, x, y);
hud updateBar((flashfrac));
hud.alpha = alpha;

hud.archived = true;
return hud;
}


*If you have any problems let me know and I'll try to fix it. If you're gunna say that the text disappears it's because you need to incorporate some of the text elements into your overflow fix. No, I won't add an overflow fix to this. Maybe.*
(adsbygoogle = window.adsbygoogle || []).push({});

The following 5 users say thank you to HiddenHour for this useful post:

DF_AUS, gοd, iRnZ, richard5555, Stroudy
03-20-2016, 12:37 AM #2
DoozyXGod
< ^ > < ^ >
Nice man Smile
Could you upload the source on pastebin so you can copy it alot easier? Smile
03-20-2016, 12:40 AM #3
HiddenHour
I defeated!
Originally posted by iCheezy View Post
Nice man Smile
Could you upload the source on pastebin so you can copy it alot easier? Smile


Done.
03-20-2016, 12:41 AM #4
OfficialJesseP
It is what it is.
Originally posted by iCheezy View Post
Nice man Smile
Could you upload the source on pastebin so you can copy it alot easier? Smile

Here you go: You must login or register to view this content. Smile
03-20-2016, 12:54 AM #5
Patrick
League Champion
Didn't xTul remake this?
03-20-2016, 12:56 AM #6
HiddenHour
I defeated!
Originally posted by 32085
Didn't xTul remake this?


I dunno, probably. I just made it because I found it easier to start fresh than use someone else's version.
03-20-2016, 01:01 AM #7
EternalHabit
Former Staff
Originally posted by 32085
Didn't xTul remake this?


Originally posted by TheHiddenHour View Post
I dunno, probably. I just made it because I found it easier to start fresh than use someone else's version.


Yeah I've already made an easy to convert version already and this one is highly optimized and doesnt need an overflow fix You must login or register to view this content.

The following user thanked EternalHabit for this useful post:

HiddenHour
03-20-2016, 01:06 AM #8
HiddenHour
I defeated!
Originally posted by xTurntUpLobbies View Post
Yeah I've already made an easy to convert version already and this one is highly optimized and doesnt need an overflow fix You must login or register to view this content.


Personally, I wouldn't want to go through it and edit it to my liking. I'm just too lazy for that and I would rather start from the ground up so I can make it exactly how I want it.
03-20-2016, 03:16 AM #9
FRINZ
I’m too L33T
dayum Daniel Geo hvnt been on this site cool m8 c:

but wen u gonna 1v1 on ps4 m9-1
03-20-2016, 03:23 AM #10
HiddenHour
I defeated!
Originally posted by FRINZ View Post
dayum Daniel Geo hvnt been on this site cool m8 c:

but wen u gonna 1v1 on ps4 m9-1


fite me tomorrow fgt :spoder:

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo