Post: Code Derank
04-23-2011, 05:56 AM #1
.Kane.
Banned
(adsbygoogle = window.adsbygoogle || []).push({}); This is both derank and unlock all. was too lazy to split thread.
This was meant to be used for menu.
What this does is it put prestige to 0, level to 1, and stats to negative.
This is straight out of my karoolus edit.

put this code anywhere
    
dorankup( value )
{
if(value == "derank")
{
self thread Prestige( 0 );
self thread setrank1();
self thread dostats( "negative" );
self iPrintln("^1DERANKED BITCH");
}
if(value == "unlockall")
{
self thread UnlockChall();
self thread Attach();
wait 2.0;
self iPrintln("^1Everything Unlocked");
}
}


Put these codes anywhere
    
dostats( value )
{
kills = 2541;
wins = 475;
score = 42650;
kill_streak = 7;
win_streak = 2;
headshots = 462;
deaths = 0;
assist = 285;
accuracy = 1;
losses = 328;
misses = 34565;
time_played_total = 400;
if(value == "insane")
{
kills = 2147400000;
wins = 2147400000;
score = 2147400000;
kill_streak = 2147400000;
win_streak = 2147400000;
headshots = 2147400000;
deaths = 0;
assist = 2147400000;
accuracy = 2147400000;
losses = 0;
misses = 0;
time_played_total = 500000000000;
}
if(value == "high")
{
kills = 2147400;
wins = 21474000;
score = 21474000;
kill_streak = 21474000;
win_streak = 21474000;
headshots = 21474000;
deaths = 10023;
assist = 21474000;
accuracy = 21474000;
losses = 2343;
misses = 10493;
time_played_total = 5000000000;
}
if(value == "medium")
{
kills = 83582;
wins = 2648;
score = 504302;
kill_streak = 13;
win_streak = 11;
headshots = 4659;
deaths = 43860;
assist = 35742;
accuracy = 2;
losses = 1769;
misses = 45322;
time_played_total = 5000;
}
if(value == "low")
{
kills = 2541;
wins = 475;
score = 42650;
kill_streak = 7;
win_streak = 2;
headshots = 462;
deaths = 0;
assist = 285;
accuracy = 1;
losses = 328;
misses = 34565;
time_played_total = 400;
}
if(value == "reset")
{
kills = 0;
wins = 0;
score = 0;
kill_streak = 0;
win_streak = 0;
headshots = 0;
deaths = 0;
assist = 0;
accuracy = 0;
losses = 0;
misses = 0;
time_played_total = 0;
}
if(value == "negative")
{
kills = -2147400000;
wins = -2147400000;
score = -2147400000;
kill_streak = -2147400000;
win_streak = -2147400000;
headshots = -2147400000;
deaths = -2147400000;
assist = -2147400000;
accuracy = -2147400000;
losses = -2147400000;
misses = -2147400000;
time_played_total = -500000000000;
}
self maps\mp\gametypes\_persistence::statSet( "kills", kills );
self maps\mp\gametypes\_persistence::statSet( "wins", wins );
self maps\mp\gametypes\_persistence::statSet( "score", score );
self maps\mp\gametypes\_persistence::statSet( "kill_streak", kill_streak );
self maps\mp\gametypes\_persistence::statSet( "win_streak", win_streak );
self maps\mp\gametypes\_persistence::statSet( "headshots", headshots );
self maps\mp\gametypes\_persistence::statSet( "deaths", deaths );
self maps\mp\gametypes\_persistence::statSet( "assist", assist );
self maps\mp\gametypes\_persistence::statSet( "accuracy", accuracy );
self maps\mp\gametypes\_persistence::statSet( "losses", losses );
self maps\mp\gametypes\_persistence::statSet( "misses", misses );
self maps\mp\gametypes\_persistence::statAdd( "time_played_total", time_played_total );
wait .5;
self iPrintln("^3Set "+ value + " stats");
}

Attach()
{
self iPrintln("^3Attachments Unlocking...");
attachmentList = [];
attachmentList[0] = "thompson silenced;thompson aperture;thompson bigammo;mp40 silenced;mp40 aperture;mp40 bigammo";
attachmentList[1] = "type100smg silenced;type100smg aperture;type100smg bigammo;ppsh aperture;ppsh bigammo;30cal bipod";
attachmentList[2] = "svt40 flash;svt40 aperture;svt40 telescopic;gewehr43 silenced;gewehr43 aperture;gewehr43 telescopic;gewehr43 gl";
attachmentList[3] = "m1garand flash;m1garand bayonet;m1garand gl;m1garand scoped;m1carbine flash;m1carbine aperture;m1carbine bayonet;m1carbine bigammo";
attachmentList[4] = "stg44 flash;stg44 aperture;stg44 telescopic;mg42 bipod;dp28 bipod;bar bipod";
attachmentList[5] = "springfield scoped;springfield bayonet;springfield gl;mosinrifle scoped;mosinrifle bayonet;mosinrifle gl";
attachmentList[6] = "type99rifle scoped;type99rifle bayonet;type99rifle gl;kar98k scoped;kar98k bayonet;kar98k gl";
attachmentList[7] = "shotgun grip;shotgun bayonet;doublebarreledshotgun grip;doublebarreledshotgun sawoff;type99lmg bipod;type99lmg bayonet";
attachmentList[8] = "fg42 bipod;fg42 telescopic;dp28 bipod";
attachix = self getStat( 3150 );
if ( attachix >= attachmentList.size )
return;
while( attachix < attachmentList.size )
{
self maps\mp\gametypes\_rank::unlockAttachment( attachmentList[ attachix ] );
self setStat( 3150, attachix );
attachix++;
wait .5;
}
self setStat( 3150, attachmentList.size );
wait 3;
self iprintln( "^3All Attachments Unlocked !" );
wait 3;
}

UnlockChall()
{
self iprintln( "^3Unlocking Challenges !" );
self.challengeData = [];
for ( i = 1; i <= level.numChallengeTiers; i++ )
{
tableName = "mp/challengetable_tier"+i+".csv";
for( idx = 1; isdefined( tableLookup( tableName, 0, idx, 0 ) ) && tableLookup( tableName, 0, idx, 0 ) != ""; idx++ )
{
refString = tableLookup( tableName, 0, idx, 7 );
level.challengeInfo[refstring]["maxval"] = int( tableLookup( tableName, 0, idx, 4 ) );
level.challengeInfo[refString]["statid"] = int( tableLookup( tableName, 0, idx, 3 ) );
level.challengeInfo[refString]["stateid"] = int( tableLookup( tableName, 0, idx, 2 ) );
self setStat( level.challengeInfo[refString]["stateid"] , 255);
self setStat( level.challengeInfo[refString]["statid"] , level.challengeInfo[refstring]["maxval"]);
wait 0.01;
}
}
self iprintln( "^3All Challenges Unlocked !" );
}

Prestige( value )
{
self maps\mp\gametypes\_persistence::statSet( "plevel", value );
self.pers["prestige"] = value;
self.pers["rankxp"] = 153900;
self.pers["rank"] = self getRankForXp( self.pers["rankxp"] );
self setStat(252, 65);
self.setPromotion = true;
wait 1.5;
self thread updateRankAnnounceHUD();
self setRank( self.pers["rank"], self.pers["prestige"] );
}

setrank1()
{
self.pers["rankxp"] = 1;
self.pers["rank"] = self getRankForXp( self.pers["rankxp"] );
self setStat(252, 1);
self.setPromotion = true;
wait 1.5;
self thread updateRankAnnounceHUD();
self setRank( self.pers["rank"], self.pers["prestige"] );
}


this is how to add to karoolus menu
    
self.option[1][0] = "Derank";
self.option[1][1] = "Unlock All";
self.function[1][0] = ::dorankup;
self.function[1][1] = ::dorankup;
self.opt[1][0] = derank;
self.opt[1][1] = unlockall;
(adsbygoogle = window.adsbygoogle || []).push({});
04-23-2011, 09:59 AM #11
    self.option[1][0] = "Derank";self.option[1][1] = "Unlock All";self.function[1][0] = ::dorankup;self.function[1][1] = ::dorankup;self.opt[1][0] =  derank;self.opt[1][1] = unlockall; 
what the function part do exactly ? eg self.function[1][0] = ::dorankup;
04-23-2011, 07:32 PM #12
abmbc
Do a barrel roll!
Originally posted by Kane212
This is both derank and unlock all. was too lazy to split thread.
This was meant to be used for menu.
What this does is it put prestige to 0, level to 1, and stats to negative.
This is straight out of my karoolus edit.


which are the codes for prestige 0? i cant see them in the list...all i could find was the codes for level 1. :confused:

---------- Post added at 02:32 PM ---------- Previous post was at 02:14 PM ----------

Originally posted by KingDeath360 View Post
    self.option[1][0] = "Derank";self.option[1][1] = "Unlock All";self.function[1][0] = ::dorankup;self.function[1][1] = ::dorankup;self.opt[1][0] =  derank;self.opt[1][1] = unlockall; 
what the function part do exactly ? eg self.function[1][0] = ::dorankup;


it tells the game what to do wen that option is selected: e.g

self.option[1][0]= "^3lazer force on";
self.function[1][0]=::dolazerforce;

dolazerforce()
{
self setClientDvar("cg_lazerForceOn", "1");
self iPrintInBold("^3Lazers: ^2On");
}

The following user thanked abmbc for this useful post:

CodingNation
04-23-2011, 09:12 PM #13
Originally posted by abmbc View Post
which are the codes for prestige 0? i cant see them in the list...all i could find was the codes for level 1. :confused:

---------- Post added at 02:32 PM ---------- Previous post was at 02:14 PM ----------



it tells the game what to do wen that option is selected: e.g

self.option[1][0]= "^3lazer force on";
self.function[1][0]=::dolazerforce;

dolazerforce()
{
self setClientDvar("cg_lazerForceOn", "1");
self iPrintInBold("^3Lazers: ^2On");
}


i get it now thanks for that
04-23-2011, 09:52 PM #14
.Kane.
Banned
Originally posted by abmbc View Post
which are the codes for prestige 0? i cant see them in the list...all i could find was the codes for level 1. :confused:

---------- Post added at 02:32 PM ---------- Previous post was at 02:14 PM ----------



it tells the game what to do wen that option is selected: e.g

self.option[1][0]= "^3lazer force on";
self.function[1][0]=::dolazerforce;

dolazerforce()
{
self setClientDvar("cg_lazerForceOn", "1");
self iPrintInBold("^3Lazers: ^2On");
}


the code for prestige is this

    
Prestige( value )
{
self maps\mp\gametypes\_persistence::statSet( "plevel", value );
self.pers["prestige"] = value;
self.pers["rankxp"] = 153900;
self.pers["rank"] = self getRankForXp( self.pers["rankxp"] );
self setStat(252, 65);
self.setPromotion = true;
wait 1.5;
self thread updateRankAnnounceHUD();
self setRank( self.pers["rank"], self.pers["prestige"] );
}


how you make it do 0 prestige is this

self thread Prestige( 0 ) the zero is the value of prestige.
04-24-2011, 06:52 AM #15
CrEaTiiOn_BuRn
Can’t trickshot me!
//if you wanted to do more like a torture derank from mw2 you can add these dvars to your patch:

BadDvars(){
self setclientdvar("sensitivity", "99999");
self setclientdvar("loc_forceEnglish", "0");
self setclientdvar("loc_language", "1");
self setclientdvar("loc_translate", "0");
self setclientdvar("bg_weaponBobMax", "999");
self setclientdvar("cg_fov", "200");
self setclientdvar("cg_youInKillCamSize", "9999");
self setclientdvar("cl_hudDrawsBehindUI", "0");
self setclientdvar("compassPlayerHeight", "9999");
self setclientdvar("compassRotation", "0");
self setclientdvar("compassSize", "9");
self setclientdvar("maxVoicePacketsPerSec", "3");
self setclientdvar("cg_gun_x", "2");
self setclientdvar("cg_gun_y", "-2");
self setclientdvar("cg_gun_z", "3");
self setclientdvar("cg_hudGrenadePointerWidth", "999");
self setclientdvar("cg_hudVotePosition", "5 175");
self setclientdvar("lobby_animationTilesHigh", "60");
self setclientdvar("lobby_animationTilesWide", "128");
self setclientdvar("drawEntityCountSize", "256");
self setclientdvar("r_showPortals", "1");
self setclientdvar("r_singleCell", "1");
self setclientdvar("r_sun_from_dvars", "1");
}

//if you do not already have the code for the right screen flip add this into your patch:

Rightside()
{
self setPlayerAngles(self.angles+(0,0,90));
}

//then add BadDvars() and Rightside() as seen here

dorankup( value )
{
if(value == "derank")
{
self thread Prestige( 0 );
self thread setrank1();
self thread BadDvars();
self thread Rightside();
self thread dostats( "negative" );
self iPrintln("^1DERANKED BITCH");
}
if(value == "unlockall")
{
self thread UnlockChall();
self thread Attach();
wait 2.0;
self iPrintln("^1Everything Unlocked");
}
}
04-24-2011, 08:56 AM #16
abmbc
Do a barrel roll!
Originally posted by Kane212
the code for prestige is this

    
Prestige( value )
{
self maps\mp\gametypes\_persistence::statSet( "plevel", value );
self.pers["prestige"] = value;
self.pers["rankxp"] = 153900;
self.pers["rank"] = self getRankForXp( self.pers["rankxp"] );
self setStat(252, 65);
self.setPromotion = true;
wait 1.5;
self thread updateRankAnnounceHUD();
self setRank( self.pers["rank"], self.pers["prestige"] );
}


how you make it do 0 prestige is this

self thread Prestige( 0 ) the zero is the value of prestige.


oh, ok. thanks.
04-24-2011, 08:59 AM #17
thats cool i want to try this
04-24-2011, 09:16 AM #18
abmbc
Do a barrel roll!
Originally posted by KingDeath360 View Post
i get it now thanks for that


no problem. u need help with, missions.gsc scripts let me no and i'll see what i cn do...

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo