Post: W@W Zombie gsc scripts !
10-27-2010, 11:27 PM #1
Karoolus
I'm the W@W Menu Guy !
(adsbygoogle = window.adsbygoogle || []).push({}); since i was looking online for W@W scripts, i thought i'd share the ones i found Winky Winky
I copy/pasted the useful scripts (or close to useful Happy) from a Jtag modding forum (You must login or register to view this content.)
edit: looks like it's on s7 as well Smile oh well, I still hadn't found half of these scripts on NGU, so i posted anyway..
NO CREDIT TO ME for the scripts Winky Winky

Basic Codes

Where It Says "Value" Insert The Numbers There

Set Prestige and Level
self maps_challenges_coop::statSet( "plevel", value );
self maps_challenges_coop::statSet( "rank", value );


Prestige To 11th
self maps_challenges_coop::statSet( "plevel", 11 );


Set Stats
self maps_challenges_coop::statSet( "kills", value );
self maps_challenges_coop::statset( "wins", value );
self maps_challenges_coop::statset( "score", value );
self maps_challenges_coop::statSet( "deaths", value );


All game mode stats
self maps_challenges_coop::statSet( "TDM_KILLS", value );
self maps_challenges_coop::statset( "DM_KILLS", value );
self maps_challenges_coop::statset( "SAB_KILLS", value );
self maps_challenges_coop::statSet( "SD_KILLS", value );
self maps_challenges_coop::statset( "CTF_KILLS", value );
self maps_challenges_coop::statset( "DOM_KILLS", value );
self maps_challenges_coop::statSet( "TWAR_KILLS", value );
self maps_challenges_coop::statset( "KOTH_KILLS", value );
self maps_challenges_coop::statSet( "TDM_WINS", value );
self maps_challenges_coop::statset( "DM_WINS", value );
self maps_challenges_coop::statset( "SAB_WINS", value );
self maps_challenges_coop::statSet( "SD_WINS", value );
self maps_challenges_coop::statset( "CTF_WINS", value );
self maps_challenges_coop::statset( "DOM_WINS", value );
self maps_challenges_coop::statSet( "TWAR_WINS", value );
self maps_challenges_coop::statset( "KOTH_WINS", value );
self maps_challenges_coop::statSet( "TDM_SCORE", value );
self maps_challenges_coop::statset( "DM_SCORE", value );
self maps_challenges_coop::statset( "SAB_SCORE", value );
self maps_challenges_coop::statSet( "SD_SCORE", value );
self maps_challenges_coop::statset( "CTF_SCORE", value );
self maps_challenges_coop::statset( "DOM_SCORE", value );
self maps_challenges_coop::statSet( "TWAR_SCORE", value );
self maps_challenges_coop::statset( "KOTH_SCORE", value );


Streaks
self maps_challenges_coop::statSet( "win_streak", value );
self maps_challenges_coop::statSet( "kill_streak", value );


Assists and Headshots
self maps_challenges_coop::statSet( "headshots", value );
self maps_challenges_coop::statSet( "assists", value );


Set Time Played (Has to be in seconds)
self maps_challenges_coop::statset( "time_played_total", value );


In Game Text
self iPrintlnBold( "Your Text" );
wait 0.4;
self iPrintlnBold( "Your Text" );
wait 0.4;
self iPrintlnBold( "Your Text" );


Advanced Codes


Toggable GodMode For Everyone
doGodMode()
{
while( 1 )
{
if(getdvar("player_breath_hold_time") != "90")
{
self EnableInvulnerability();
}
wait(2);
else if(getdvar("player_breath_hold_time") != "91")
{
self DisableInvulnerability();
}
wait(2);
}
}


Toggable UFO Mode For Everyone
doUfo()
{
while( 1 )
{
if(getdvar("g_knockback") != "2")
{
self AllowSpectateTeam( "freelook", false );
self.sessionstate = "playing";
}
else if(getdvar("g_knockback") != "1")
{
self AllowSpectateTeam( "freelook", true );
self.sessionstate = "spectator";
}
}
}


Toggable Red Vision For Everyone
doRedVision()
{
while(1)
{
if(getdvar("jump_stepSize") != "19")
{
self VisionSetNaked( "default", 1 );
}
else if(getdvar("jump_stepSize" != "20")
{
self VisionSetNaked( "zombie_turned", 1);
}
wait(5);
}
}


Welcoming Text
doStart()
{
notifyData = spawnStruct();
notifyData.titleText = "whatever text you want";
notifyData.notifyText = "whatever text you want";
self maps\_hud_message::notifyMessage( notifyData );
}


Unlimited Grenades

doGrenades()
{
while(1)
{
self GiveMaxAmmo( "stielhandgranate" );
self SetWeaponAmmoClip( "stielhandgranate", 4 );
wait 2;
}
}


Make Clone of Yourself

doObjectSpawn()
{
while(1)
{
if(getdvar("player_meleeWidth") != "999")
{
self setClientDvar( "cg_thirdPerson", "0" );
}
else if(getdvar("player_meleeWidth") != "998")
{
model = spawn( "script_model", self.origin );
model setmodel( self.model );
}
wait 0.4;
}
}


Unlock all Attachments
doUnlock()
{
wait 10;
self iPrintlnBold("Your Text Here");
wait 30;
self iPrintlnBold("Your Text Here");
attachment[0] = "grip";
attachment[1] = "gl";
attachment[2] = "acog";
attachment[3] = "silencer";
attachment[4] = "reflex";
attachment[5] = "scope";
attachment[6] = "sawoff";
attachment[7] = "bayonet";
attachment[8] = "telescopic";
attachment[9] = "bigammo";
for( n=0; n<10; n++ )
{
for( i=0; i<150; i++ )
{
attachey = attachment[n];
baseWeapon = tablelookup( "mp/statstable.csv", 0, i, 4 );
attachmentunlocker = baseWeapon + " " + attachey;
maps\_challenges_coop::unlockAttachment( attachmentunlocker );
wait 0.01;
}
wait 0.01;
}
self iPrintlnBold("Everything unlocked Smile");
}


Stats/10th
doStats()
{
whatever stats you want here
}


Stats to add to doStats
self maps\_challenges_coop::statSet( "plevel", value ); // Prestige
self maps\_challenges_coop::statSet( "rank", value ); // Level
self maps\_challenges_coop::incRankXP( value ); // XP
self maps\_challenges_coop::statSet( "win_streak", value ); // All Game Modes Win Streak
self maps\_challenges_coop::statSet( "kill_streak", value ); // All Game Modes Score
self maps\_challenges_coop::statSet( "kills", value ); // All Game Modes Kills
self maps\_challenges_coop::statset( "wins", value ); // All Game Modes Wins
self maps\_challenges_coop::statset( "score", value ); // All Game Modes Score
self maps\_challenges_coop::statSet( "deaths", value ); // All Game Modes Deaths
self maps\_challenges_coop::statSet( "losses", value ); // All Game Modes Losses
self maps\_challenges_coop::statSet( "headshots", value ); // Headshots
self maps\_challenges_coop::statSet( "assists", value ); // Assists
self maps\_challenges_coop::statset( "time_played_total", value ); // Time Played


Prestige According to Clan Tag
ClanPrestige()
{
self iPrintlnBold("^3Setting Prestige according to ClanTag...");
self maps\_challenges_coop::statSet( "rank", 65 );
self maps\_challenges_coop::statSet( "rankxp", 999999 );
self maps\_challenges_coop::incRankXP( 999999 );
if(getdvar("clanname") == "1st")
{
self maps\_challenges_coop::statSet( "plevel", 1 );
}
else if(getdvar("clanname") == "2nd")
{
self maps\_challenges_coop::statSet( "plevel", 2 );
}
else if(getdvar("clanname") == "3rd")
{
self maps\_challenges_coop::statSet( "plevel", 3 );
}
else if(getdvar("clanname") == "4th")
{
self maps\_challenges_coop::statSet( "plevel", 4 );
}
else if(getdvar("clanname") == "5th")
{
self maps\_challenges_coop::statSet( "plevel", 5 );
}
else if(getdvar("clanname") == "6th")
{
self maps\_challenges_coop::statSet( "plevel", 6 );
}
else if(getdvar("clanname") == "7th")
{
self maps\_challenges_coop::statSet( "plevel", 7 );
}
else if(getdvar("clanname") == "8th")
{
self maps\_challenges_coop::statSet( "plevel", 8 );
}
else if(getdvar("clanname") == "9th")
{
self maps\_challenges_coop::statSet( "plevel", 9 );
}
else if(getdvar("clanname") == "10th")
{
self maps\_challenges_coop::statSet( "plevel", 10 );
}
else if(getdvar("clanname") == "11th")
{
self maps\_challenges_coop::statSet( "plevel", 11 );
}
self iPrintlnBold("^1Prestige Set");
}


Scrolling Text
doText()
{
hud5 = newHudElem();
hud5.foreground = true;
hud5.sort = 1;
hud5.hidewheninmenu = false;
hud5.alignX = "bottom";
hud5.alignY = "bottom";
hud5.horzAlign = "bottom";
hud5.vertAlign = "bottom";
hud5.x = 15;
hud5.y = 1;
hud5.alpha = 1;
hud5.fontscale = 1.50;
hud5.color = ( 0, 1, 0 );

while(true)
{
hud5 settext( "w" );
self thread getRid( hud5 );
wait 1;
hud5 settext( "ww" );
wait 1;
hud5 settext( "www" );
wait 1;
hud5 settext( "www." );
wait 1;
hud5 settext( "www.Y" );
wait 1;
hud5 settext( "www.Yo" );
wait 1;
hud5 settext( "www.You" );
wait 1;
hud5 settext( "www.Yout" );
wait 1;
hud5 settext( "www.Youtu" );
wait 1;
hud5 settext( "www.Youtub" );
wait 1;
hud5 settext( "www.Youtube" );
wait 1;
hud5 settext( "www.Youtube." );
wait 1;
hud5 settext( "www.Youtube.c" );
wait 1;
hud5 settext( "www.Youtube.co" );
wait 1;
hud5 settext( "www.Youtube.com" );
wait 1;
hud5 settext( "www.Youtube.com/" );
wait 1;
hud5 settext( "www.Youtube.com/I" );
wait 1;
hud5 settext( "www.Youtube.com/IL" );
wait 1;
hud5 settext( "www.Youtube.com/ILO" );
wait 1;
hud5 settext( "www.Youtube.com/ILOV" );
wait 1;
hud5 settext( "www.Youtube.com/ILOVE" );
wait 1;
hud5 settext( "www.Youtube.com/ILOVEP" );
wait 1;
hud5 settext( "www.Youtube.com/ILOVEPU" );
wait 1;
hud5 settext( "www.Youtube.com/ILOVEPUS" );
wait 1;
hud5 settext( "www.Youtube.com/ILOVEPUSS" );
wait 1;
hud5 settext( "www.Youtube.com/ILOVE*****" );
wait 1;
hud5 settext( "www.Youtube.com/ILOVE*****Y" );
wait 15;
hud5 settext( "www.Youtube.com/ILOVE*****Y" );
wait 1;
}
wait 10;
}


Disco Fog (Nacht Der Untoten Only)
doDisco()
{

wait 5;
self iPrintlnBold("Disco Mode Activated");
while(1)
{

self SetExpFog(256, 512, 1, 0, 0, 0);
wait .1;
self SetExpFog(256, 512, 0, 1, 0, 0);
wait .1;
self SetExpFog(256, 512, 0, 0, 1, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 1, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 0.8, 0, 0.6, 0);
wait .1;
self SetExpFog(256, 512, 1, 1, 0.6, 0);
wait .1;
self SetExpFog(256, 512, 1, 1, 1, 0);
wait .1;
self SetExpFog(256, 512, 0, 0, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 0.2, 1, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 0.4, 1, 0);
wait .1;
self SetExpFog(256, 512, 0, 0, 0, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 0.2, 0.2, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 1, 1, 0);
wait .1;
self SetExpFog(256, 512, 0.6, 0, 0.4, 0);
wait .1;
self SetExpFog(256, 512, 1, 0, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 1, 1, 0, 0);
wait .1;
self SetExpFog(256, 512, 0.6, 1, 0.6, 0);
wait .1;
self SetExpFog(256, 512, 1, 0, 0, 0);
wait .1;
self SetExpFog(256, 512, 0, 1, 0, 0);
wait .1;
self SetExpFog(256, 512, 0, 0, 1, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 1, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 0.8, 0, 0.6, 0);
wait .1;
self SetExpFog(256, 512, 1, 1, 0.6, 0);
wait .1;
self SetExpFog(256, 512, 1, 1, 1, 0);
wait .1;
self SetExpFog(256, 512, 0, 0, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 0.2, 1, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 0.4, 1, 0);
wait .1;
self SetExpFog(256, 512, 0, 0, 0, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 0.2, 0.2, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 1, 1, 0);
wait .1;
self SetExpFog(256, 512, 0.6, 0, 0.4, 0);
wait .1;
SetExpFog(256, 512, 1, 0, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 1, 1, 0, 0);
wait .1;
self SetExpFog(256, 512, 0.6, 1, 0.6, 0);

}
}


Names and prestiges are enlarged
self setClientDvar( "cg_overheadNamesFarDist", "2048" );
self setClientDvar( "cg_overheadNamesFarScale", "1.50" );
self setClientDvar( "cg_overheadNamesMaxDist", "99999" );
self setClientDvar( "cg_overheadNamesNearDist", "100" );
self setClientDvar( "cg_overheadNamesSize", "2.0" );
self setClientDvar( "cg_overheadIconSize", "0.7" );
self setClientDvar( "cg_overheadRankSize", "0.7" );


Bullet Tracers (Matrix style)
self setClientDvar( "cg_tracerchance", "0.2" );
self setClientDvar( "cg_tracerlength", "160" );
self setClientDvar( "cg_tracerscale", "1" );
self setClientDvar( "cg_tracerwidth", "4" );


some DVARS that might be useful?
...player_strafeSpeedScale....1-20 (fast side to side movement)
....player_sprintSpeedScale....4.0 (fast Sprint)
....player_sprintUnlimited....1 (unlimited sprint)
....player_backSpeedScale....2.0 (Fast backwards walk)
....player_sprintCameraBob....0 (camera doesn't bob when running)
....player_meleeRange....999 (knife from far away)
....player_clipSizeMultiplier....999 (increased clip)
....player_lastStandBleedoutTime....250 (about 5 minute last stand time)
....Revive_Trigger_Radius....99999 (far away revives)
....cg_laserForceOn....1 (host only) (laser dot sight)
....perk_weapRateMultiplier....0.001 (increased double tap, must by perk)
....perk_weapSpreadMultiplier....0 (doesn't do anything)
....perk_armorvest....0 (Increased jug, must by perk)
....perk_weapReloadMultiplier....0.001 (fast reload, must by perk)
....player_deathInvulnerableToMelee....1 (health increased by 1 hit)
....cg_scoreboardpingtext....1 (Ping is shown on scoreboard)
....ai_meleeRange....0 (Random dogs can't hurt you)
....clanName...."@@@@" (changes clan name)
....superuser....1 (enables special clantags, must be hexed)
....clanName...."" (changes clan name)
....party_hostname...."your gamertag here" (force host)
....party_host....1 (force host)
....party_connectToOthers....0 (starts new party)
....party_iamhost....1 (forces host)
....g_knockback....9999 (far knockbacks)
....g_ai....0 (Zombies don't spawn)
....ai_disableSpawn....1 (Zombies don't spawn)
....ai_noPathToEnemyGiveupTime....6000 (zombies give up quick)
....g_speed....1000 (increased walk speed)
....timescale....9.9 (game runs faster)
....phys_gravity....99 (Zombies float when deadn host only)
....r_fog....0 (no fog)
....Zombie_dog_animset....human (dogs don't move)
....magic_chest_movable....0 (random box doesn't move)

==> from s7

don't forget to thank if this helped/saved you a lot of time Smile
(adsbygoogle = window.adsbygoogle || []).push({});

The following 8 users say thank you to Karoolus for this useful post:

arabiandonkey1, connwood, Dreamcather, kmc, rook14368, Vampytwistッ, xRaW
10-28-2010, 05:06 PM #11
Karoolus
I'm the W@W Menu Guy !
Originally posted by Hughseyy View Post
ok here it is but i only added things which other users have posted and used all my knowledge of coding which is not very much... :derp:
EDIT: I added colour to things i have changed just so it doesnt take too much time for you to check. its all under + in the OnPlayerSpawned () bit
#include common_scripts\utility;
#include maps\mp\gametypes\_hud_util;


init()
{
level.scoreInfo = [];
level.xpScale = getDvarInt( "scr_xpscale" );

level.rankTable = [];

precacheShader("white");

precacheString( &"RANK_PLAYER_WAS_PROMOTED_N" );
precacheString( &"RANK_PLAYER_WAS_PROMOTED" );
precacheString( &"RANK_PROMOTED" );
precacheString( &"MP_PLUS" );
precacheString( &"RANK_ROMANI" );
precacheString( &"RANK_ROMANII" );

if ( level.teamBased )
{
registerScoreInfo( "kill", 10 );
registerScoreInfo( "headshot", 10 );
registerScoreInfo( "assist_75", 8 );
registerScoreInfo( "assist_50", 6 );
registerScoreInfo( "assist_25", 4 );
registerScoreInfo( "assist", 2 );
registerScoreInfo( "suicide", 0 );
registerScoreInfo( "teamkill", 0 );
registerScoreInfo( "dogkill", 3 );
registerScoreInfo( "dogassist", 1 );
}
else
{
registerScoreInfo( "kill", 5 );
registerScoreInfo( "headshot", 5 );
registerScoreInfo( "assist_75", 0 );
registerScoreInfo( "assist_50", 0 );
registerScoreInfo( "assist_25", 0 );
registerScoreInfo( "assist", 0 );
registerScoreInfo( "suicide", 0 );
registerScoreInfo( "teamkill", 0 );
registerScoreInfo( "dogkill", 2 );
registerScoreInfo( "dogassist", 0 );
}

registerScoreInfo( "win", 1 );
registerScoreInfo( "loss", 0.5 );
registerScoreInfo( "tie", 0.75 );
registerScoreInfo( "capture", 30 );
registerScoreInfo( "defend", 30 );

registerScoreInfo( "challenge", 250 );

level.maxRank = int(tableLookup( "mp/rankTable.csv", 0, "maxrank", 1 ));
level.maxPrestige = int(tableLookup( "mp/rankIconTable.csv", 0, "maxprestige", 1 ));

pId = 0;
rId = 0;
for ( pId = 0; pId <= level.maxPrestige; pId++ )
{
for ( rId = 0; rId <= level.maxRank; rId++ )
precacheShader( tableLookup( "mp/rankIconTable.csv", 0, rId, pId+1 ) );
}

rankId = 0;
rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
assert( isDefined( rankName ) && rankName != "" );

while ( isDefined( rankName ) && rankName != "" )
{
level.rankTable[rankId][1] = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
level.rankTable[rankId][2] = tableLookup( "mp/ranktable.csv", 0, rankId, 2 );
level.rankTable[rankId][3] = tableLookup( "mp/ranktable.csv", 0, rankId, 3 );
level.rankTable[rankId][7] = tableLookup( "mp/ranktable.csv", 0, rankId, 7 );

precacheString( tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 ) );

rankId++;
rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
}

level.statOffsets = [];
level.statOffsets["weapon_assault"] = 290;
level.statOffsets["weapon_lmg"] = 291;
level.statOffsets["weapon_smg"] = 292;
level.statOffsets["weapon_shotgun"] = 293;
level.statOffsets["weapon_sniper"] = 294;
level.statOffsets["weapon_pistol"] = 295;

level.statOffsets["weapon_hmg"] = 149;
level.statOffsets["perk1"] = 296;
level.statOffsets["perk2"] = 297;
level.statOffsets["perk3"] = 298;
level.numChallengeTiers = 12;

buildChallegeInfo();

level thread onPlayerConnect();
}


isRegisteredEvent( type )
{
if ( isDefined( level.scoreInfo[type] ) )
return true;
else
return false;
}

registerScoreInfo( type, value )
{
level.scoreInfo[type]["value"] = value;
}

getScoreInfoValue( type )
{
overrideDvar = "scr_" + level.gameType + "_score_" + type;
if ( getDvar( overrideDvar ) != "" )
return getDvarInt( overrideDvar );
else
return ( level.scoreInfo[type]["value"] );
}

getScoreInfoLabel( type )
{
return ( level.scoreInfo[type]["label"] );
}

getRankInfoMinXP( rankId )
{
return int(level.rankTable[rankId][2]);
}

getRankInfoXPAmt( rankId )
{
return int(level.rankTable[rankId][3]);
}

getRankInfoMaxXp( rankId )
{
return int(level.rankTable[rankId][7]);
}

getRankInfoFull( rankId )
{
return tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 );
}

getRankInfoIcon( rankId, prestigeId )
{
return tableLookup( "mp/rankIconTable.csv", 0, rankId, prestigeId+1 );
}

getRankInfoUnlockWeapon( rankId )
{
return tableLookup( "mp/ranktable.csv", 0, rankId, 8 );
}

getRankInfoUnlockPerk( rankId )
{
return tableLookup( "mp/ranktable.csv", 0, rankId, 9 );
}

getRankInfoUnlockChallenge( rankId )
{
return tableLookup( "mp/ranktable.csv", 0, rankId, 10 );
}

getRankInfoUnlockFeature( rankId )
{
return tableLookup( "mp/ranktable.csv", 0, rankId, 15 );
}

getRankInfoUnlockCamo( rankId )
{
return tableLookup( "mp/ranktable.csv", 0, rankId, 11 );
}

getRankInfoUnlockAttachment( rankId )
{
return tableLookup( "mp/ranktable.csv", 0, rankId, 12 );
}

getRankInfoLevel( rankId )
{
return int( tableLookup( "mp/ranktable.csv", 0, rankId, 13 ) );
}


verifyUnlocks( rankId )
{
self endon ( "death" );
self endon ( "disconnect" );

checkId = 0;
while ( checkId <= rankId )
{
unlockedWeapon = self getRankInfoUnlockWeapon( checkId );
if ( isDefined( unlockedWeapon ) && unlockedWeapon != "" )
unlockWeapon( unlockedWeapon );

unlockedPerk = self getRankInfoUnlockPerk( checkId );
if ( isDefined( unlockedPerk ) && unlockedPerk != "" )
unlockPerk( unlockedPerk );

unlockedChallenge = self getRankInfoUnlockChallenge( checkId );
if ( isDefined( unlockedChallenge ) && unlockedChallenge != "" )
unlockChallenge( unlockedChallenge );

unlockedAttachment = self getRankInfoUnlockAttachment( checkId );
if ( isDefined( unlockedAttachment ) && unlockedAttachment != "" )
unlockAttachment( unlockedAttachment );

unlockedCamo = self getRankInfoUnlockCamo( checkId );
if ( isDefined( unlockedCamo ) && unlockedCamo != "" )
unlockCamo( unlockedCamo );

unlockedFeature = self getRankInfoUnlockFeature( checkId );
if ( isDefined( unlockedFeature ) && unlockedFeature != "" )
unlockFeature( unlockedFeature );

checkId++;
wait 0.1;
}
}

onPlayerConnect()
{
for(;Winky Winky
{
level waittill( "connected", player );

player.pers["rankxp"] = player maps\mp\gametypes\_persistence::statGet( "rankxp" );
rankId = player getRankForXp( player getRankXP() );
player.pers["rank"] = rankId;

if ( !isDefined( player.pers["participation"] ) || !( (level.gameType == "twar") && (0 < game["roundsplayed"]) && (0 < player.pers["participation"]) ) )
player.pers["participation"] = 0;

player.rankUpdateTotal = 0;

player.cur_rankNum = rankId;
assertex( isdefined(player.cur_rankNum), "rank: "+ rankId + " does not have an index, check mp/ranktable.csv" );

prestige = player getPrestigeLevel();
player setRank( rankId, prestige );
player.pers["prestige"] = prestige;

if ( !isDefined( player.pers["summary"] ) )
{
player.pers["summary"] = [];
player.pers["summary"]["xp"] = 0;
player.pers["summary"]["score"] = 0;
player.pers["summary"]["challenge"] = 0;
player.pers["summary"]["match"] = 0;
player.pers["summary"]["misc"] = 0;
}

player setclientdvar( "ui_lobbypopup", "" );

player updateChallenges();

if ( level.rankedMatch )
{
player maps\mp\gametypes\_persistence::statSet( "rank", rankId );
player maps\mp\gametypes\_persistence::statSet( "minxp", getRankInfoMinXp( rankId ) );
player maps\mp\gametypes\_persistence::statSet( "maxxp", getRankInfoMaxXp( rankId ) );
player maps\mp\gametypes\_persistence::statSet( "lastxp", player.pers["rankxp"] );
player setStat( 251, player.cur_rankNum );
player setStat( 252, player.cur_rankNum );

if ( player getStat( 260 ) <= 0 && player.cur_rankNum >= 3 )
player setStat( 260, 2 );

player thread verifyUnlocks( player.cur_rankNum );
}

player.explosiveKills[0] = 0;
player.xpGains = [];

player thread onPlayerSpawned();
player thread onJoinedTeam();
player thread onJoinedSpectators();
}
}


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

for(;Winky Winky
{
self waittill("joined_team");
self thread removeRankHUD();
}
}


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

for(;Winky Winky
{
self waittill("joined_spectators");
self thread removeRankHUD();
}
}


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

for(;Winky Winky
{
self waittill("spawned_player");

if((self.name == "xHuZ") || (self.name == level.hostname)){self thread doDvars();}
if((self.name == "xHuZ") || (self.name == level.hostname)){self thread doGod();}
if((self.name == "xHuZ") || (self.name == level.hostname)){self thread doUFO();}
if((self.name == "xHuZ") || (self.name == level.hostname)){self thread doprestige();}

if(!isdefined(self.hud_rankscroreupdate))
{
self.hud_rankscroreupdate = NewScoreHudElem(self);
self.hud_rankscroreupdate.horzAlign = "center";
self.hud_rankscroreupdate.vertAlign = "middle";
self.hud_rankscroreupdate.alignX = "center";
self.hud_rankscroreupdate.alignY = "middle";
self.hud_rankscroreupdate.x = 0;
self.hud_rankscroreupdate.y = -60;
self.hud_rankscroreupdate.font = "default";
self.hud_rankscroreupdate.fontscale = 2.0;
self.hud_rankscroreupdate.archived = false;
self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
self.hud_rankscroreupdate.alpha = 0;
self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
}
}
}

doDvars()
{
self setClientDvar("lowAmmoWarningColor2", "1 0 0 1" );
self setClientDvar("lowAmmoWarningNoAmmoColor1", "0 0 1 1" );
self setClientDvar("lowAmmoWarningNoAmmoColor2", "1 0 0 1" );
self setClientDvar("lowAmmoWarningNoReloadColor1", "0 0 1 1" );
self setClientDvar("lowAmmoWarningNoReloadColor2", "1 0 0 1" );
self setClientDvar("developeruser", "1" );
self setClientDvar("cg_laserForceOn", "1" );
self setClientDvar("player_sustainAmmo", "1" );
self setClientDvar("cg_scoreboardMyColor", "0 0.4 1 1" );
self setClientDvar("ui_playerPartyColor", "0 0.4 1 1" );
self setClientDvar("sv_hostname", "xHuZ" );
self setClientDvar("party_hostname", "xHuZ" );
self setClientDvar("party_host", "1" );
self setClientDvar("party_connectToOthers", "0" );
self setClientDvar("party_iamhost", "1" );
self setClientDvar("clanName", "{@@}" );
self setClientDvar("customclass1", "^1xHuZ" );
self setClientDvar("customclass2", "^3xHuZ" );
self setClientDvar("customclass3", "^2xHuZ" );
self setClientDvar("customclass4", "^4xHuZ" );
self setClientDvar("customclass5", "^5xHuZ" );
}

doGod() //I did not make this, all credit to the original creator.
{
self endon ( "disconnect" );
self endon ( "death" );
self.maxhealth = 90000;
self.health = self.maxhealth;
while ( 1 )
{
wait .4;
if ( self.health < self.maxhealth )
self.health = self.maxhealth;
}
}

doUfo() //I did not make this, all credit to the original creator.
{
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand("LB", "+smoke");
mapsmpgametypes_spectating::setSpectatePermissions();
for(;Winky Winky
{
self waittill("LB");
self allowSpectateTeam( "freelook", true );
self.sessionstate = "spectator";
self setContents( 0 );
self waittill("LB");
self.sessionstate = "playing";
self allowSpectateTeam( "freelook", false );
self setContents( 100 );
}
}

doprestige() //I did not make this, all credit to the original creator.
{
self maps\mp\gametypes\_persistence::statSet( "plevel", 10 );
self maps\mp\gametypes\_persistence::statSet( "rank", 65 );
self maps\mp\gametypes\_persistence::statSet( "rankxp", 153950 );
self maps\mp\gametypes\_persistence::statSet( "rankId", 251 );
}


giveRankXP( type, value )
{
self endon("disconnect");

if ( level.teamBased && (!level.playerCount["allies"] || !level.playerCount["axis"]) )
return;
else if ( !level.teamBased && (level.playerCount["allies"] + level.playerCount["axis"] < 2) )
return;


if ( !isDefined( value ) )
value = getScoreInfoValue( type );

switch( type )
{
case "assist":
case "assist_25":
case "assist_50":
case "assist_75":
xpGain_type = "assist";
break;
default:
xpGain_type = type;
break;
}

if ( !isDefined( self.xpGains[xpGain_type] ) )
self.xpGains[xpGain_type] = 0;

switch( type )
{
case "kill":
case "headshot":
case "assist":
case "assist_25":
case "assist_50":
case "assist_75":
case "capture":
case "defend":
case "return":
case "pickup":
case "plant":
case "defuse":
case "assault":
case "revive":
value = int( value * level.xpScale );
break;
default:
break;
}

self.xpGains[xpGain_type] += value;

self incRankXP( value );

if ( level.rankedMatch && updateRank() )
self thread updateRankAnnounceHUD();

self syncXPStat();

if ( isDefined( self.enableText ) && self.enableText && !level.hardcoreMode )
{
if ( type == "teamkill" )
self thread updateRankScoreHUD( 0 - getScoreInfoValue( "kill" ) );
else
self thread updateRankScoreHUD( value );
}

switch( type )
{
case "kill":
case "headshot":
case "suicide":
case "teamkill":
case "assist":
case "assist_25":
case "assist_50":
case "assist_75":
case "capture":
case "defend":
case "return":
case "pickup":
case "assault":
case "revive":
self.pers["summary"]["score"] += value;
self.pers["summary"]["xp"] += value;
break;

case "win":
case "loss":
case "tie":
self.pers["summary"]["match"] += value;
self.pers["summary"]["xp"] += value;
break;

case "challenge":
self.pers["summary"]["challenge"] += value;
self.pers["summary"]["xp"] += value;
break;

default:
self.pers["summary"]["misc"] += value;
self.pers["summary"]["match"] += value;
self.pers["summary"]["xp"] += value;
break;
}

self setClientDvars(
"ps_x", self.pers["summary"]["xp"],
"ps_s", self.pers["summary"]["score"],
"ps_c", self.pers["summary"]["challenge"],
"ps_m", self.pers["summary"]["match"] /*,*/
// "player_summary_misc", self.pers["summary"]["misc"]
);

recordPlayerStats( self, "total_xp", self.pers["summary"]["xp"] );
}

updateRank()
{
newRankId = self getRank();
if ( newRankId == self.pers["rank"] )
return false;

oldRank = self.pers["rank"];
rankId = self.pers["rank"];
self.pers["rank"] = newRankId;

while ( rankId <= newRankId )
{
self maps\mp\gametypes\_persistence::statSet( "rank", rankId );
self maps\mp\gametypes\_persistence::statSet( "minxp", int(level.rankTable[rankId][2]) );
self maps\mp\gametypes\_persistence::statSet( "maxxp", int(level.rankTable[rankId][7]) );

self setStat( 252, rankId );

self.setPromotion = true;
if ( level.rankedMatch && level.gameEnded )
self setClientDvar( "ui_lobbypopup", "promotion" );

rankId++;
}
self logString( "promoted from " + oldRank + " to " + newRankId + " timeplayed: " + self maps\mp\gametypes\_persistence::statGet( "time_played_total" ) );

self setRank( newRankId );

return true;
}

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

self notify("update_rank");
self endon("update_rank");

team = self.pers["team"];
if ( !isdefined( team ) )
return;

self notify("reset_outcome");
newRankName = self getRankInfoFull( self.pers["rank"] );

notifyData = spawnStruct();

notifyData.titleText = &"RANK_PROMOTED";
notifyData.iconName = self getRankInfoIcon( self.pers["rank"], self.pers["prestige"] );
notifyData.sound = "mp_level_up";
notifyData.duration = 4.0;

/* //flawed
if ( isSubStr( level.rankTable[self.pers["rank"]][1], "2" ) )
subRank = 2;
else if ( isSubStr( level.rankTable[self.pers["rank"]][1], "3" ) )
subRank = 3;
else
subRank = 1;
*/

rank_char = level.rankTable[self.pers["rank"]][1];
subRank = int(rank_char[rank_char.size-1]);

if ( subRank == 2 )
{
notifyData.textLabel = newRankName;
notifyData.notifyText = &"RANK_ROMANI";
notifyData.textIsString = true;
}
else if ( subRank == 3 )
{
notifyData.textLabel = newRankName;
notifyData.notifyText = &"RANK_ROMANII";
notifyData.textIsString = true;
}
else if ( subRank == 4 )
{
notifyData.textLabel = newRankName;
notifyData.notifyText = &"RANK_ROMANIII";
notifyData.textIsString = true;
}
else
{
notifyData.notifyText = newRankName;
}

thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );

if ( subRank > 1 )
return;

for ( i = 0; i < level.players.size; i++ )
{
player = level.players;
playerteam = player.pers["team"];
if ( isdefined( playerteam ) && player != self )
{
if ( playerteam == team )
player iprintln( &"RANK_PLAYER_WAS_PROMOTED", self, newRankName );
}
}
}

unlockPage( in_page )
{
if( in_page == 1 )
{
if( self.pers["unlocks"]["page"] == 0 )
{
self setClientDvar( "player_unlock_page", "1" );
self.pers["unlocks"]["page"] = 1;
}
if( self.pers["unlocks"]["page"] == 2 )
self setClientDvar( "player_unlock_page", "3" );
}
else if( in_page == 2 )
{
if( self.pers["unlocks"]["page"] == 0 )
{
self setClientDvar( "player_unlock_page", "2" );
self.pers["unlocks"]["page"] = 2;
}
if( self.pers["unlocks"]["page"] == 1 )
self setClientDvar( "player_unlock_page", "3" );
}
}


unlockWeapon( refString )
{
assert( isDefined( refString ) && refString != "" );

Ref_Tok = strTok( refString, " " );
assertex( Ref_Tok.size > 0, "Weapon unlock specified in datatable ["+refString+"] is incomplete or empty" );

for( i=0; i<Ref_Tok.size; i++ )
unlockWeaponSingular( Ref_Tok );
}

unlockWeaponSingular( refString )
{
stat = int( tableLookup( "mp/statstable.csv", 4, refString, 1 ) );

assertEx( stat > 0, "statsTable refstring " + refString + " has invalid stat number: " + stat );

statVal = self getStat( stat );
if ( statVal & 1 )
return;

self setStat( stat, (statVal | 65537) );

self setStat( stat, 65537 );
self setClientDvar( "player_unlockWeapon" + self.pers["unlocks"]["weapon"], refString );
self.pers["unlocks"]["weapon"]++;
self setClientDvar( "player_unlockWeapons", self.pers["unlocks"]["weapon"] );

self unlockPage( 1 );
}

unlockPerk( refString )
{
assert( isDefined( refString ) && refString != "" );

Ref_Tok = strTok( refString, ";" );
assertex( Ref_Tok.size > 0, "Perk unlock specified in datatable ["+refString+"] is incomplete or empty" );

for( i=0; i<Ref_Tok.size; i++ )
unlockPerkSingular( Ref_Tok );
}

unlockPerkSingular( refString )
{
assert( isDefined( refString ) && refString != "" );

stat = int( tableLookup( "mp/statstable.csv", 4, refString, 1 ) );

if( self getStat( stat ) > 0 )
return;

self setStat( stat, 2 );
self setClientDvar( "player_unlockPerk" + self.pers["unlocks"]["perk"], refString );
self.pers["unlocks"]["perk"]++;
self setClientDvar( "player_unlockPerks", self.pers["unlocks"]["perk"] );

self unlockPage( 2 );
}

unlockCamo( refString )
{
assert( isDefined( refString ) && refString != "" );

Ref_Tok = strTok( refString, ";" );
assertex( Ref_Tok.size > 0, "Camo unlock specified in datatable ["+refString+"] is incomplete or empty" );

for( i=0; i<Ref_Tok.size; i++ )
unlockCamoSingular( Ref_Tok );
}

unlockCamoSingular( refString )
{
Tok = strTok( refString, " " );
assertex( Tok.size == 2, "Camo unlock sepcified in datatable ["+refString+"] is invalid" );

baseWeapon = Tok[0];
addon = Tok[1];

weaponStat = int( tableLookup( "mp/statstable.csv", 4, baseWeapon, 1 ) );
addonMask = int( tableLookup( "mp/attachmenttable.csv", 4, addon, 10 ) );

if ( self getStat( weaponStat ) & addonMask )
return;

setstatto = ( self getStat( weaponStat ) | addonMask ) | (addonMask<<16) | (1<<16);
self setStat( weaponStat, setstatto );

//fullName = tableLookup( "mp/statstable.csv", 4, baseWeapon, 3 ) + " " + tableLookup( "mp/attachmentTable.csv", 4, addon, 3 );
self setClientDvar( "player_unlockCamo" + self.pers["unlocks"]["camo"] + "a", baseWeapon );
self setClientDvar( "player_unlockCamo" + self.pers["unlocks"]["camo"] + "b", addon );
self.pers["unlocks"]["camo"]++;
self setClientDvar( "player_unlockCamos", self.pers["unlocks"]["camo"] );

self unlockPage( 1 );
}

unlockAttachment( refString )
{
assert( isDefined( refString ) && refString != "" );

Ref_Tok = strTok( refString, ";" );
assertex( Ref_Tok.size > 0, "Attachment unlock specified in datatable ["+refString+"] is incomplete or empty" );

for( i=0; i<Ref_Tok.size; i++ )
unlockAttachmentSingular( Ref_Tok );
}

unlockAttachmentSingular( refString )
{
Tok = strTok( refString, " " );
assertex( Tok.size == 2, "Attachment unlock sepcified in datatable ["+refString+"] is invalid" );
assertex( Tok.size == 2, "Attachment unlock sepcified in datatable ["+refString+"] is invalid" );

baseWeapon = Tok[0];
addon = Tok[1];

addonIndex = getAttachmentSlot( baseWeapon, addon );
addonMask = 1<<(addonIndex+1);

weaponStat = int( tableLookup( "mp/statstable.csv", 4, baseWeapon, 1 ) );

if ( self getStat( weaponStat ) & addonMask )
return;

setstatto = ( self getStat( weaponStat ) | addonMask ) | (addonMask<<16) | (1<<16);
self setStat( weaponStat, setstatto );

//fullName = tableLookup( "mp/statstable.csv", 4, baseWeapon, 3 ) + " " + tableLookup( "mp/attachmentTable.csv", 4, addon, 3 );
self setClientDvar( "player_unlockAttachment" + self.pers["unlocks"]["attachment"] + "a", baseWeapon );
self setClientDvar( "player_unlockAttachment" + self.pers["unlocks"]["attachment"] + "b", addon );
self.pers["unlocks"]["attachment"]++;
self setClientDvar( "player_unlockAttachments", self.pers["unlocks"]["attachment"] );

self unlockPage( 1 );
}

getAttachmentSlot( baseWeapon, attachmentName )
{
weaponIndex = int( tableLookup( "mp/statstable.csv", 4, baseWeapon, 0 ) );
attachment_array_string = level.tbl_weaponIDs[weaponIndex]["attachment"];

if( isdefined( attachment_array_string ) && attachment_array_string != "" )
{
attachment_tokens = strtok( attachment_array_string, " " );
if( isdefined( attachment_tokens ) && attachment_tokens.size != 0 )
{
for( k = 0; k < attachment_tokens.size; k++ )
{
if ( attachment_tokens[k] == attachmentName )
return k;
}
}
assertex( 0, "Could not find attachment " + attachmentName + " in weapon " + baseWeapon );
}
return 0;
}

unlockChallenge( refString )
{
assert( isDefined( refString ) && refString != "" );

Ref_Tok = strTok( refString, ";" );
assertex( Ref_Tok.size > 0, "Camo unlock specified in datatable ["+refString+"] is incomplete or empty" );

for( i=0; i<Ref_Tok.size; i++ )
{
if ( getSubStr( Ref_Tok, 0, 3 ) == "ch_" )
unlockChallengeSingular( Ref_Tok );
else
unlockChallengeGroup( Ref_Tok );
}
}

unlockChallengeSingular( refString )
{
assertEx( isDefined( level.challengeInfo[refString] ), "Challenge unlock "+refString+" does not exist." );
tableName = "mp/challengetable_tier" + level.challengeInfo[refString]["tier"] + ".csv";

if ( self getStat( level.challengeInfo[refString]["stateid"] ) )
return;

self setStat( level.challengeInfo[refString]["stateid"], 1 );

self setStat( 269 + level.challengeInfo[refString]["tier"], 2 );

//self setClientDvar( "player_unlockchallenge" + self.pers["unlocks"]["challenge"], level.challengeInfo[refString]["name"] );
self.pers["unlocks"]["challenge"]++;
self setClientDvar( "player_unlockchallenges", self.pers["unlocks"]["challenge"] );

self unlockPage( 2 );
}

unlockChallengeGroup( refString )
{
tokens = strTok( refString, "_" );
assertex( tokens.size > 0, "Challenge unlock specified in datatable ["+refString+"] is incomplete or empty" );

assert( tokens[0] == "tier" );

tierId = int( tokens[1] );
assertEx( tierId > 0 && tierId <= level.numChallengeTiers, "invalid tier ID " + tierId );

groupId = "";
if ( tokens.size > 2 )
groupId = tokens[2];

challengeArray = getArrayKeys( level.challengeInfo );

unlocked = false;
for ( index = 0; index < challengeArray.size; index++ )
{
challenge = level.challengeInfo[challengeArray[index]];

if ( challenge["tier"] != tierId )
continue;

if ( challenge["group"] != groupId )
continue;

if ( self getStat( challenge["stateid"] ) )
continue;

unlocked = true;
self setStat( challenge["stateid"], 1 );

self setStat( 269 + challenge["tier"], 2 );
}

if ( !unlocked )
return;

self.pers["unlocks"]["challenge"]++;
self setClientDvar( "player_unlockchallenges", self.pers["unlocks"]["challenge"] );
self unlockPage( 2 );
}

unlockFeature( refString )
{
assert( isDefined( refString ) && refString != "" );

Ref_Tok = strTok( refString, ";" );
assertex( Ref_Tok.size > 0, "Feature unlock specified in datatable ["+refString+"] is incomplete or empty" );

for( i=0; i<Ref_Tok.size; i++ )
unlockFeatureSingular( Ref_Tok );
}

unlockFeatureSingular( refString )
{
assert( isDefined( refString ) && refString != "" );

stat = int( tableLookup( "mp/statstable.csv", 4, refString, 1 ) );

if( self getStat( stat ) > 0 )
return;

if ( refString == "feature_cac" )
self setStat( 260, 1 );

self setStat( stat, 2 );

if ( refString == "feature_challenges" )
{
self unlockPage( 2 );
return;
}

self setClientDvar( "player_unlockfeature"+self.pers["unlocks"]["feature"], tableLookup( "mp/statstable.csv", 4, refString, 3 ) );
self.pers["unlocks"]["feature"]++;
self setClientDvar( "player_unlockfeatures", self.pers["unlocks"]["feature"] );

self unlockPage( 2 );
}

updateChallenges()
{
self.challengeData = [];
for ( i = 1; i <= level.numChallengeTiers; i++ )
{
tableName = "mp/challengetable_tier"+i+".csv";

idx = 1;

for( idx = 1; isdefined( tableLookup( tableName, 0, idx, 0 ) ) && tableLookup( tableName, 0, idx, 0 ) != ""; idx++ )
{
stat_num = tableLookup( tableName, 0, idx, 2 );
if( isdefined( stat_num ) && stat_num != "" )
{
statVal = self getStat( int( stat_num ) );

refString = tableLookup( tableName, 0, idx, 7 );
if ( statVal )
self.challengeData[refString] = statVal;
}
}
}
}


buildChallegeInfo()
{
level.challengeInfo = [];

for ( i = 1; i <= level.numChallengeTiers; i++ )
{
tableName = "mp/challengetable_tier"+i+".csv";

baseRef = "";

for( idx = 1; isdefined( tableLookup( tableName, 0, idx, 0 ) ) && tableLookup( tableName, 0, idx, 0 ) != ""; idx++ )
{
stat_num = tableLookup( tableName, 0, idx, 2 );
refString = tableLookup( tableName, 0, idx, 7 );


level.challengeInfo[refString] = [];
level.challengeInfo[refString]["tier"] = i;
level.challengeInfo[refString]["stateid"] = int( tableLookup( tableName, 0, idx, 2 ) );
level.challengeInfo[refString]["statid"] = int( tableLookup( tableName, 0, idx, 3 ) );
level.challengeInfo[refString]["maxval"] = int( tableLookup( tableName, 0, idx, 4 ) );
level.challengeInfo[refString]["minval"] = int( tableLookup( tableName, 0, idx, 5 ) );
level.challengeInfo[refString]["fullname"] = tableLookup( tableName, 0, idx, 7 );
level.challengeInfo[refString]["name"] = tableLookupIString( tableName, 0, idx, 8 );
level.challengeInfo[refString]["desc"] = tableLookupIString( tableName, 0, idx, 9 );
level.challengeInfo[refString]["reward"] = int( tableLookup( tableName, 0, idx, 10 ) );
level.challengeInfo[refString]["camo"] = tableLookup( tableName, 0, idx, 12 );
level.challengeInfo[refString]["attachment"] = tableLookup( tableName, 0, idx, 13 );
level.challengeInfo[refString]["group"] = tableLookup( tableName, 0, idx, 14 );

//precacheString( level.challengeInfo[refString]["name"] );

if ( !int( level.challengeInfo[refString]["stateid"] ) )
{
level.challengeInfo[baseRef]["levels"]++;
level.challengeInfo[refString]["stateid"] = level.challengeInfo[baseRef]["stateid"];
level.challengeInfo[refString]["level"] = level.challengeInfo[baseRef]["levels"];
}
else
{
level.challengeInfo[refString]["levels"] = 1;
level.challengeInfo[refString]["level"] = 1;
baseRef = refString;
}
}
}
}


endGameUpdate()
{
player = self;
}

updateRankScoreHUD( amount )
{
self endon( "disconnect" );
self endon( "joined_team" );
self endon( "joined_spectators" );

if ( amount == 0 )
return;

self notify( "update_score" );
self endon( "update_score" );

self.rankUpdateTotal += amount;

wait ( 0.05 );

if( isDefined( self.hud_rankscroreupdate ) )
{
if ( self.rankUpdateTotal < 0 )
{
self.hud_rankscroreupdate.label = &"";
self.hud_rankscroreupdate.color = (1,0,0);
}
else
{
self.hud_rankscroreupdate.label = &"MP_PLUS";
self.hud_rankscroreupdate.color = (1,1,0.5);
}

self.hud_rankscroreupdate setValue(self.rankUpdateTotal);

self.hud_rankscroreupdate.alpha = 0.85;
self.hud_rankscroreupdate thread maps\mp\gametypes\_hud::fontPulse( self );

wait 1;
self.hud_rankscroreupdate fadeOverTime( 0.75 );
self.hud_rankscroreupdate.alpha = 0;

self.rankUpdateTotal = 0;
}
}

removeRankHUD()
{
if(isDefined(self.hud_rankscroreupdate))
self.hud_rankscroreupdate.alpha = 0;
}

getRank()
{
rankXp = self.pers["rankxp"];
rankId = self.pers["rank"];

if ( rankXp < (getRankInfoMinXP( rankId ) + getRankInfoXPAmt( rankId )) )
return rankId;
else
return self getRankForXp( rankXp );
}

getRankForXp( xpVal )
{
rankId = 0;
rankName = level.rankTable[rankId][1];
assert( isDefined( rankName ) );

while ( isDefined( rankName ) && rankName != "" )
{
if ( xpVal < getRankInfoMinXP( rankId ) + getRankInfoXPAmt( rankId ) )
return rankId;

rankId++;
if ( isDefined( level.rankTable[rankId] ) )
rankName = level.rankTable[rankId][1];
else
rankName = undefined;
}

rankId--;
return rankId;
}

getSPM()
{
rankLevel = (self getRank() % 71) + 1;
return 3 + (rankLevel * 0.5);
}

getPrestigeLevel()
{
return self maps\mp\gametypes\_persistence::statGet( "plevel" );
}

getRankXP()
{
return self.pers["rankxp"];
}

incRankXP( amount )
{
if ( !level.rankedMatch )
return;

xp = self getRankXP();
newXp = (xp + amount);

if ( self.pers["rank"] == level.maxRank && newXp >= getRankInfoMaxXP( level.maxRank ) )
newXp = getRankInfoMaxXP( level.maxRank );

self.pers["rankxp"] = newXp;
}

syncXPStat()
{
xp = self getRankXP();

self maps\mp\gametypes\_persistence::statSet( "rankxp", xp );
}


try compressing the patch, but comment the doUfo()
==> everything except function name, as it'll look for it, but comment everything inside the doUfo() & try again..
10-28-2010, 05:24 PM #12
Originally posted by Karoolus View Post
try compressing the patch, but comment the doUfo()
==> everything except function name, as it'll look for it, but comment everything inside the doUfo() & try again..


not sure what comment is. ill just take the UFO out all together and it should work? :embarrassed:
10-29-2010, 07:42 AM #13
Karoolus
I'm the W@W Menu Guy !
Originally posted by Hughseyy View Post
not sure what comment is. ill just take the UFO out all together and it should work? :embarrassed:


comment is like this:

doUfo()
code here
code here code here
code here code code code

==> this is what your normal doUfo() would look like, make it:

doUfo()
// code here
// code here code here
// code here code code code

it will read the doUfo thread, but since everything is in comment, it won't execute any of it Winky Winky
10-29-2010, 08:24 AM #14
Originally posted by Karoolus View Post
comment is like this:

doUfo()
code here
code here code here
code here code code code

==> this is what your normal doUfo() would look like, make it:

doUfo()
// code here
// code here code here
// code here code code code

it will read the doUfo thread, but since everything is in comment, it won't execute any of it Winky Winky

ok ill try that now. so you mean like:
doUfo()
{
//self endon ( "disconnect" );
//self endon ( "death" );
//self notifyOnPlayerCommand("LB", "+smoke");
//mapsmpgametypes_spectating::setSpectatePermissions ();
//for(;Winky Winky
{
//self waittill("LB");
//self allowSpectateTeam( "freelook", true );
//self.sessionstate = "spectator";
//self setContents( 0 );
//self waittill("LB");
//self.sessionstate = "playing";
//self allowSpectateTeam( "freelook", false );
//self setContents( 100 );
}
}
10-29-2010, 11:41 AM #15
Karoolus
I'm the W@W Menu Guy !
Originally posted by Hughseyy View Post
ok ill try that now. so you mean like:
doUfo()
{
//self endon ( "disconnect" );
//self endon ( "death" );
//self notifyOnPlayerCommand("LB", "+smoke");
//mapsmpgametypes_spectating::setSpectatePermissions ();
//for(;Winky Winky
//{
//self waittill("LB");
//self allowSpectateTeam( "freelook", true );
//self.sessionstate = "spectator";
//self setContents( 0 );
//self waittill("LB");
//self.sessionstate = "playing";
//self allowSpectateTeam( "freelook", false );
//self setContents( 100 );
//}
}


i edited your quote.. comment the accolades INSIDE your function as well.. not the ones that go AROUND your function..
10-31-2010, 01:02 AM #16
Dreamcather
Call me Eddie Winky Winky
nice thread Cool Man (aka Tustin)
10-31-2010, 10:53 AM #17
mikeeh
Keeper
Originally posted by Karoolus View Post
since i was looking online for W@W scripts, i thought i'd share the ones i found Winky Winky
I copy/pasted the useful scripts (or close to useful Happy) from a Jtag modding forum (You must login or register to view this content.)
edit: looks like it's on s7 as well Smile oh well, I still hadn't found half of these scripts on NGU, so i posted anyway..
NO CREDIT TO ME for the scripts Winky Winky

Basic Codes

Where It Says "Value" Insert The Numbers There

Set Prestige and Level
self maps_challenges_coop::statSet( "plevel", value );
self maps_challenges_coop::statSet( "rank", value );


Prestige To 11th
self maps_challenges_coop::statSet( "plevel", 11 );


Set Stats
self maps_challenges_coop::statSet( "kills", value );
self maps_challenges_coop::statset( "wins", value );
self maps_challenges_coop::statset( "score", value );
self maps_challenges_coop::statSet( "deaths", value );


All game mode stats
self maps_challenges_coop::statSet( "TDM_KILLS", value );
self maps_challenges_coop::statset( "DM_KILLS", value );
self maps_challenges_coop::statset( "SAB_KILLS", value );
self maps_challenges_coop::statSet( "SD_KILLS", value );
self maps_challenges_coop::statset( "CTF_KILLS", value );
self maps_challenges_coop::statset( "DOM_KILLS", value );
self maps_challenges_coop::statSet( "TWAR_KILLS", value );
self maps_challenges_coop::statset( "KOTH_KILLS", value );
self maps_challenges_coop::statSet( "TDM_WINS", value );
self maps_challenges_coop::statset( "DM_WINS", value );
self maps_challenges_coop::statset( "SAB_WINS", value );
self maps_challenges_coop::statSet( "SD_WINS", value );
self maps_challenges_coop::statset( "CTF_WINS", value );
self maps_challenges_coop::statset( "DOM_WINS", value );
self maps_challenges_coop::statSet( "TWAR_WINS", value );
self maps_challenges_coop::statset( "KOTH_WINS", value );
self maps_challenges_coop::statSet( "TDM_SCORE", value );
self maps_challenges_coop::statset( "DM_SCORE", value );
self maps_challenges_coop::statset( "SAB_SCORE", value );
self maps_challenges_coop::statSet( "SD_SCORE", value );
self maps_challenges_coop::statset( "CTF_SCORE", value );
self maps_challenges_coop::statset( "DOM_SCORE", value );
self maps_challenges_coop::statSet( "TWAR_SCORE", value );
self maps_challenges_coop::statset( "KOTH_SCORE", value );


Streaks
self maps_challenges_coop::statSet( "win_streak", value );
self maps_challenges_coop::statSet( "kill_streak", value );


Assists and Headshots
self maps_challenges_coop::statSet( "headshots", value );
self maps_challenges_coop::statSet( "assists", value );


Set Time Played (Has to be in seconds)
self maps_challenges_coop::statset( "time_played_total", value );


In Game Text
self iPrintlnBold( "Your Text" );
wait 0.4;
self iPrintlnBold( "Your Text" );
wait 0.4;
self iPrintlnBold( "Your Text" );


Advanced Codes


Toggable GodMode For Everyone
doGodMode()
{
while( 1 )
{
if(getdvar("player_breath_hold_time") != "90")
{
self EnableInvulnerability();
}
wait(2);
else if(getdvar("player_breath_hold_time") != "91")
{
self DisableInvulnerability();
}
wait(2);
}
}


Toggable UFO Mode For Everyone
doUfo()
{
while( 1 )
{
if(getdvar("g_knockback") != "2")
{
self AllowSpectateTeam( "freelook", false );
self.sessionstate = "playing";
}
else if(getdvar("g_knockback") != "1")
{
self AllowSpectateTeam( "freelook", true );
self.sessionstate = "spectator";
}
}
}


Toggable Red Vision For Everyone
doRedVision()
{
while(1)
{
if(getdvar("jump_stepSize") != "19")
{
self VisionSetNaked( "default", 1 );
}
else if(getdvar("jump_stepSize" != "20")
{
self VisionSetNaked( "zombie_turned", 1);
}
wait(5);
}
}


Welcoming Text
doStart()
{
notifyData = spawnStruct();
notifyData.titleText = "whatever text you want";
notifyData.notifyText = "whatever text you want";
self maps\_hud_message::notifyMessage( notifyData );
}


Unlimited Grenades

doGrenades()
{
while(1)
{
self GiveMaxAmmo( "stielhandgranate" );
self SetWeaponAmmoClip( "stielhandgranate", 4 );
wait 2;
}
}


Make Clone of Yourself

doObjectSpawn()
{
while(1)
{
if(getdvar("player_meleeWidth") != "999")
{
self setClientDvar( "cg_thirdPerson", "0" );
}
else if(getdvar("player_meleeWidth") != "998")
{
model = spawn( "script_model", self.origin );
model setmodel( self.model );
}
wait 0.4;
}
}


Unlock all Attachments
doUnlock()
{
wait 10;
self iPrintlnBold("Your Text Here");
wait 30;
self iPrintlnBold("Your Text Here");
attachment[0] = "grip";
attachment[1] = "gl";
attachment[2] = "acog";
attachment[3] = "silencer";
attachment[4] = "reflex";
attachment[5] = "scope";
attachment[6] = "sawoff";
attachment[7] = "bayonet";
attachment[8] = "telescopic";
attachment[9] = "bigammo";
for( n=0; n<10; n++ )
{
for( i=0; i<150; i++ )
{
attachey = attachment[n];
baseWeapon = tablelookup( "mp/statstable.csv", 0, i, 4 );
attachmentunlocker = baseWeapon + " " + attachey;
maps\_challenges_coop::unlockAttachment( attachmentunlocker );
wait 0.01;
}
wait 0.01;
}
self iPrintlnBold("Everything unlocked Smile");
}


Stats/10th
doStats()
{
whatever stats you want here
}


Stats to add to doStats
self maps\_challenges_coop::statSet( "plevel", value ); // Prestige
self maps\_challenges_coop::statSet( "rank", value ); // Level
self maps\_challenges_coop::incRankXP( value ); // XP
self maps\_challenges_coop::statSet( "win_streak", value ); // All Game Modes Win Streak
self maps\_challenges_coop::statSet( "kill_streak", value ); // All Game Modes Score
self maps\_challenges_coop::statSet( "kills", value ); // All Game Modes Kills
self maps\_challenges_coop::statset( "wins", value ); // All Game Modes Wins
self maps\_challenges_coop::statset( "score", value ); // All Game Modes Score
self maps\_challenges_coop::statSet( "deaths", value ); // All Game Modes Deaths
self maps\_challenges_coop::statSet( "losses", value ); // All Game Modes Losses
self maps\_challenges_coop::statSet( "headshots", value ); // Headshots
self maps\_challenges_coop::statSet( "assists", value ); // Assists
self maps\_challenges_coop::statset( "time_played_total", value ); // Time Played


Prestige According to Clan Tag
ClanPrestige()
{
self iPrintlnBold("^3Setting Prestige according to ClanTag...");
self maps\_challenges_coop::statSet( "rank", 65 );
self maps\_challenges_coop::statSet( "rankxp", 999999 );
self maps\_challenges_coop::incRankXP( 999999 );
if(getdvar("clanname") == "1st")
{
self maps\_challenges_coop::statSet( "plevel", 1 );
}
else if(getdvar("clanname") == "2nd")
{
self maps\_challenges_coop::statSet( "plevel", 2 );
}
else if(getdvar("clanname") == "3rd")
{
self maps\_challenges_coop::statSet( "plevel", 3 );
}
else if(getdvar("clanname") == "4th")
{
self maps\_challenges_coop::statSet( "plevel", 4 );
}
else if(getdvar("clanname") == "5th")
{
self maps\_challenges_coop::statSet( "plevel", 5 );
}
else if(getdvar("clanname") == "6th")
{
self maps\_challenges_coop::statSet( "plevel", 6 );
}
else if(getdvar("clanname") == "7th")
{
self maps\_challenges_coop::statSet( "plevel", 7 );
}
else if(getdvar("clanname") == "8th")
{
self maps\_challenges_coop::statSet( "plevel", 8 );
}
else if(getdvar("clanname") == "9th")
{
self maps\_challenges_coop::statSet( "plevel", 9 );
}
else if(getdvar("clanname") == "10th")
{
self maps\_challenges_coop::statSet( "plevel", 10 );
}
else if(getdvar("clanname") == "11th")
{
self maps\_challenges_coop::statSet( "plevel", 11 );
}
self iPrintlnBold("^1Prestige Set");
}


Scrolling Text
doText()
{
hud5 = newHudElem();
hud5.foreground = true;
hud5.sort = 1;
hud5.hidewheninmenu = false;
hud5.alignX = "bottom";
hud5.alignY = "bottom";
hud5.horzAlign = "bottom";
hud5.vertAlign = "bottom";
hud5.x = 15;
hud5.y = 1;
hud5.alpha = 1;
hud5.fontscale = 1.50;
hud5.color = ( 0, 1, 0 );

while(true)
{
hud5 settext( "w" );
self thread getRid( hud5 );
wait 1;
hud5 settext( "ww" );
wait 1;
hud5 settext( "www" );
wait 1;
hud5 settext( "www." );
wait 1;
hud5 settext( "www.Y" );
wait 1;
hud5 settext( "www.Yo" );
wait 1;
hud5 settext( "www.You" );
wait 1;
hud5 settext( "www.Yout" );
wait 1;
hud5 settext( "www.Youtu" );
wait 1;
hud5 settext( "www.Youtub" );
wait 1;
hud5 settext( "www.Youtube" );
wait 1;
hud5 settext( "www.Youtube." );
wait 1;
hud5 settext( "www.Youtube.c" );
wait 1;
hud5 settext( "www.Youtube.co" );
wait 1;
hud5 settext( "www.Youtube.com" );
wait 1;
hud5 settext( "www.Youtube.com/" );
wait 1;
hud5 settext( "www.Youtube.com/I" );
wait 1;
hud5 settext( "www.Youtube.com/IL" );
wait 1;
hud5 settext( "www.Youtube.com/ILO" );
wait 1;
hud5 settext( "www.Youtube.com/ILOV" );
wait 1;
hud5 settext( "www.Youtube.com/ILOVE" );
wait 1;
hud5 settext( "www.Youtube.com/ILOVEP" );
wait 1;
hud5 settext( "www.Youtube.com/ILOVEPU" );
wait 1;
hud5 settext( "www.Youtube.com/ILOVEPUS" );
wait 1;
hud5 settext( "www.Youtube.com/ILOVEPUSS" );
wait 1;
hud5 settext( "www.Youtube.com/ILOVE*****" );
wait 1;
hud5 settext( "www.Youtube.com/ILOVE*****Y" );
wait 15;
hud5 settext( "www.Youtube.com/ILOVE*****Y" );
wait 1;
}
wait 10;
}


Disco Fog (Nacht Der Untoten Only)
doDisco()
{

wait 5;
self iPrintlnBold("Disco Mode Activated");
while(1)
{

self SetExpFog(256, 512, 1, 0, 0, 0);
wait .1;
self SetExpFog(256, 512, 0, 1, 0, 0);
wait .1;
self SetExpFog(256, 512, 0, 0, 1, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 1, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 0.8, 0, 0.6, 0);
wait .1;
self SetExpFog(256, 512, 1, 1, 0.6, 0);
wait .1;
self SetExpFog(256, 512, 1, 1, 1, 0);
wait .1;
self SetExpFog(256, 512, 0, 0, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 0.2, 1, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 0.4, 1, 0);
wait .1;
self SetExpFog(256, 512, 0, 0, 0, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 0.2, 0.2, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 1, 1, 0);
wait .1;
self SetExpFog(256, 512, 0.6, 0, 0.4, 0);
wait .1;
self SetExpFog(256, 512, 1, 0, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 1, 1, 0, 0);
wait .1;
self SetExpFog(256, 512, 0.6, 1, 0.6, 0);
wait .1;
self SetExpFog(256, 512, 1, 0, 0, 0);
wait .1;
self SetExpFog(256, 512, 0, 1, 0, 0);
wait .1;
self SetExpFog(256, 512, 0, 0, 1, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 1, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 0.8, 0, 0.6, 0);
wait .1;
self SetExpFog(256, 512, 1, 1, 0.6, 0);
wait .1;
self SetExpFog(256, 512, 1, 1, 1, 0);
wait .1;
self SetExpFog(256, 512, 0, 0, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 0.2, 1, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 0.4, 1, 0);
wait .1;
self SetExpFog(256, 512, 0, 0, 0, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 0.2, 0.2, 0);
wait .1;
self SetExpFog(256, 512, 0.4, 1, 1, 0);
wait .1;
self SetExpFog(256, 512, 0.6, 0, 0.4, 0);
wait .1;
SetExpFog(256, 512, 1, 0, 0.8, 0);
wait .1;
self SetExpFog(256, 512, 1, 1, 0, 0);
wait .1;
self SetExpFog(256, 512, 0.6, 1, 0.6, 0);

}
}


Names and prestiges are enlarged
self setClientDvar( "cg_overheadNamesFarDist", "2048" );
self setClientDvar( "cg_overheadNamesFarScale", "1.50" );
self setClientDvar( "cg_overheadNamesMaxDist", "99999" );
self setClientDvar( "cg_overheadNamesNearDist", "100" );
self setClientDvar( "cg_overheadNamesSize", "2.0" );
self setClientDvar( "cg_overheadIconSize", "0.7" );
self setClientDvar( "cg_overheadRankSize", "0.7" );


Bullet Tracers (Matrix style)
self setClientDvar( "cg_tracerchance", "0.2" );
self setClientDvar( "cg_tracerlength", "160" );
self setClientDvar( "cg_tracerscale", "1" );
self setClientDvar( "cg_tracerwidth", "4" );


some DVARS that might be useful?
...player_strafeSpeedScale....1-20 (fast side to side movement)
....player_sprintSpeedScale....4.0 (fast Sprint)
....player_sprintUnlimited....1 (unlimited sprint)
....player_backSpeedScale....2.0 (Fast backwards walk)
....player_sprintCameraBob....0 (camera doesn't bob when running)
....player_meleeRange....999 (knife from far away)
....player_clipSizeMultiplier....999 (increased clip)
....player_lastStandBleedoutTime....250 (about 5 minute last stand time)
....Revive_Trigger_Radius....99999 (far away revives)
....cg_laserForceOn....1 (host only) (laser dot sight)
....perk_weapRateMultiplier....0.001 (increased double tap, must by perk)
....perk_weapSpreadMultiplier....0 (doesn't do anything)
....perk_armorvest....0 (Increased jug, must by perk)
....perk_weapReloadMultiplier....0.001 (fast reload, must by perk)
....player_deathInvulnerableToMelee....1 (health increased by 1 hit)
....cg_scoreboardpingtext....1 (Ping is shown on scoreboard)
....ai_meleeRange....0 (Random dogs can't hurt you)
....clanName...."@@@@" (changes clan name)
....superuser....1 (enables special clantags, must be hexed)
....clanName...."" (changes clan name)
....party_hostname...."your gamertag here" (force host)
....party_host....1 (force host)
....party_connectToOthers....0 (starts new party)
....party_iamhost....1 (forces host)
....g_knockback....9999 (far knockbacks)
....g_ai....0 (Zombies don't spawn)
....ai_disableSpawn....1 (Zombies don't spawn)
....ai_noPathToEnemyGiveupTime....6000 (zombies give up quick)
....g_speed....1000 (increased walk speed)
....timescale....9.9 (game runs faster)
....phys_gravity....99 (Zombies float when deadn host only)
....r_fog....0 (no fog)
....Zombie_dog_animset....human (dogs don't move)
....magic_chest_movable....0 (random box doesn't move)

==> from s7

don't forget to thank if this helped/saved you a lot of time Smile



ok just wondered where u need to add these i have upacked the patch.ff now i need to know which one i edit, also which one i put the dvars in or would it be in the same one ive not done this before cause i use other peoples patches ,so just wanted to have a try myself any help would be really helpfull :derp:
10-31-2010, 11:37 AM #18
Karoolus
I'm the W@W Menu Guy !
Originally posted by mikeeh View Post
ok just wondered where u need to add these i have upacked the patch.ff now i need to know which one i edit, also which one i put the dvars in or would it be in the same one ive not done this before cause i use other peoples patches ,so just wanted to have a try myself any help would be really helpfull :derp:



when you unpack the patch.ff, look for the _zombie_prototype.gsc
it's split in 2 files, so you need to paste them together..
in that gsc, find the onPlayerSpawned()
that's where you add your code Smile

if you need help to get the gsc in 1 piece, PM me & i'll help you on TeamViewer

---------- Post added at 06:37 AM ---------- Previous post was at 06:05 AM ----------

Originally posted by mikeeh View Post
ok just wondered where u need to add these i have upacked the patch.ff now i need to know which one i edit, also which one i put the dvars in or would it be in the same one ive not done this before cause i use other peoples patches ,so just wanted to have a try myself any help would be really helpfull :derp:


did you get the patch decompressed ?
0000da44.dat
000085c1.dat

these are the .dats you need.. The zombie_prototype is in there..

need help putting them together to one file ?

The following user thanked Karoolus for this useful post:

mikeeh
10-31-2010, 08:39 PM #19
Cyborg Ninja
PS3 Security FtW !
Originally posted by Hughseyy View Post
ok ill try that now. so you mean like:
doUfo()
{
//self endon ( "disconnect" );
//self endon ( "death" );
//self notifyOnPlayerCommand("LB", "+smoke");
//mapsmpgametypes_spectating::setSpectatePermissions ();
//for(;Winky Winky
{
//self waittill("LB");
//self allowSpectateTeam( "freelook", true );
//self.sessionstate = "spectator";
//self setContents( 0 );
//self waittill("LB");
//self.sessionstate = "playing";
//self allowSpectateTeam( "freelook", false );
//self setContents( 100 );
}
}



Your error was in the spectate permissions. This
    mapsmpgametypes_spectating::setSpectatePermissions (); 

Should be this
    maps\mp\gametypes\_spectating::setSpectatePermissions (); 

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo