• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Release] Cranked V1.3
#31
i cnat get this to work on steam anyone minde explaining how to get it to work ?
  Reply
#32
(05-28-2014, 17:21)poles Wrote: i cnat get this to work on steam anyone minde explaining how to get it to work ?


My time to SHINE! Big Grin

Okay so,

First load the mod correctly into MW2 Liberation... Be sure to copy the folder called "Cranked" from within the archive that I posted above to the Mods folder of MW2 Liberation.

Tick "Retain custom game settings" in Liberation.

Press Cntl + F2 to open the console and type
"seta scr_cranked_time 30" (no quotes).

Thats it.
  Reply
#33
(05-28-2014, 20:05)camxxcore Wrote:
(05-28-2014, 17:21)poles Wrote: i cnat get this to work on steam anyone minde explaining how to get it to work ?


My time to SHINE! Big Grin

Okay so,

First load the mod correctly into MW2 Liberation... Be sure to copy the folder called "Cranked" from within the archive that I posted above to the Mods folder of MW2 Liberation.

Tick "Retain custom game settings" in Liberation.

Press Cntl + F2 to open the console and type
"seta scr_cranked_time 30" (no quotes).

Thats it.

Thank you worked Big Grin

Alot of problems with this cranked . even after you die you dont loose it you still are "cranked" . after time is out you dont explode the counter just hits zero . also cranked does not do anything :S
hm , am i doing something wrong or is it supposed to be like that ?
  Reply
#34
(05-28-2014, 17:21)poles Wrote: Thank you worked Big Grin

Alot of problems with this cranked . even after you die you dont loose it you still are "cranked" . after time is out you dont explode the counter just hits zero . also cranked does not do anything :S
hm , am i doing something wrong or is it supposed to be like that ?

I uploaded the original by mistake. D:

I updated the file:

http://www.mediafire.com/download/kt7hs9...ranked.rar
  Reply
#35
great work

but i had a problem
cranked time is always 0 when i play the mod
for some reason this line:

PHP Code:
setDvarIfUninitialized("scr_cranked_time"30); 

is not working
so when you try to get scr_cranked_time inside Cranked_Timer() it returns 0 all the time
the player dies immediately after killing another player!

i know programming but its the first time i try to do gsc scripting
so i replaced your function with this to get it work:

PHP Code:
Cranked_Timer()
{    
    
level.TimeLimit 30;

    
self endon("death");
    
self notify("is_cranked");
    
self endon("is_cranked");
    
self.CrankedTime setTenthsTimerlevel.TimeLimit );
    
self.CrankedTimeOver setTenthsTimerlevel.TimeLimit );
    
waitlevel.TimeLimit );
    
self thread Cranked_Fail();


tried to create global variable but didn't know how XD
maybe you could fix it better than this

also, i dunno whats goin on in this function Cranked() but i think you have a logical mistake

PHP Code:
if(self.isCranked == false)
{
    
self.isCranked true;
    
self thread Cranked_Perks();
    
self thread Cranked_Overlay();
    
self thread Cranked_Timer();
    
self thread Cranked_Background_Overlay();
    
self.moveSpeedScaler 3;
    
self maps\mp\gametypes\_weapons::updateMoveSpeedScale"primary" );
    
self setClientDvar("player_sprintspeedscale"1.7);
}
else if(
self.isCranked == false)
{
    
self thread Cranked_Timer();


bcoz what i see is: if statement is exactly the same as the else if statement
which is

PHP Code:
self.isCranked == false 

unless gsc scripts if statements works differently than other programming languages

sorry for getting into your code but i really wanted to play this mod

and thanx for the mod its great and awesome
keep up the good work ^_^
  Reply
#36
(09-08-2014, 16:06)vip9008 Wrote: Heart @4FunPlayin

This is a global variable for example:

Code:
level.TimeLimit = 30;

You could make one global variable to replace the dvar.

There is indeed a coding error here, you can keep it as else. Else if works in the same way as in other languages

Code:
else if(self.isCranked == false)
{
  Reply
#37
(09-08-2014, 16:06)vip9008 Wrote: great work

but i had a problem
cranked time is always 0 when i play the mod
for some reason this line:

PHP Code:
setDvarIfUninitialized("scr_cranked_time"30); 

is not working
so when you try to get scr_cranked_time inside Cranked_Timer() it returns 0 all the time
the player dies immediately after killing another player!

i know programming but its the first time i try to do gsc scripting
so i replaced your function with this to get it work:

PHP Code:
Cranked_Timer()
{    
    
level.TimeLimit 30;

    
self endon("death");
    
self notify("is_cranked");
    
self endon("is_cranked");
    
self.CrankedTime setTenthsTimerlevel.TimeLimit );
    
self.CrankedTimeOver setTenthsTimerlevel.TimeLimit );
    
waitlevel.TimeLimit );
    
self thread Cranked_Fail();


tried to create global variable but didn't know how XD
maybe you could fix it better than this

also, i dunno whats goin on in this function Cranked() but i think you have a logical mistake

PHP Code:
if(self.isCranked == false)
{
    
self.isCranked true;
    
self thread Cranked_Perks();
    
self thread Cranked_Overlay();
    
self thread Cranked_Timer();
    
self thread Cranked_Background_Overlay();
    
self.moveSpeedScaler 3;
    
self maps\mp\gametypes\_weapons::updateMoveSpeedScale"primary" );
    
self setClientDvar("player_sprintspeedscale"1.7);
}
else if(
self.isCranked == false)
{
    
self thread Cranked_Timer();


bcoz what i see is: if statement is exactly the same as the else if statement
which is

PHP Code:
self.isCranked == false 

unless gsc scripts if statements works differently than other programming languages

sorry for getting into your code but i really wanted to play this mod

and thanx for the mod its great and awesome
keep up the good work ^_^


Lol it sent me an email about this. You will need to set the dvar manually on the game console with "seta" if it is not registering
  Reply
#38
(09-08-2014, 21:05)camxxcore Wrote:
(09-08-2014, 16:06)vip9008 Wrote: great work

but i had a problem
cranked time is always 0 when i play the mod
for some reason this line:

PHP Code:
setDvarIfUninitialized("scr_cranked_time"30); 

is not working
so when you try to get scr_cranked_time inside Cranked_Timer() it returns 0 all the time
the player dies immediately after killing another player!

i know programming but its the first time i try to do gsc scripting
so i replaced your function with this to get it work:

PHP Code:
Cranked_Timer()
{    
    
level.TimeLimit 30;

    
self endon("death");
    
self notify("is_cranked");
    
self endon("is_cranked");
    
self.CrankedTime setTenthsTimerlevel.TimeLimit );
    
self.CrankedTimeOver setTenthsTimerlevel.TimeLimit );
    
waitlevel.TimeLimit );
    
self thread Cranked_Fail();


tried to create global variable but didn't know how XD
maybe you could fix it better than this

also, i dunno whats goin on in this function Cranked() but i think you have a logical mistake

PHP Code:
if(self.isCranked == false)
{
    
self.isCranked true;
    
self thread Cranked_Perks();
    
self thread Cranked_Overlay();
    
self thread Cranked_Timer();
    
self thread Cranked_Background_Overlay();
    
self.moveSpeedScaler 3;
    
self maps\mp\gametypes\_weapons::updateMoveSpeedScale"primary" );
    
self setClientDvar("player_sprintspeedscale"1.7);
}
else if(
self.isCranked == false)
{
    
self thread Cranked_Timer();


bcoz what i see is: if statement is exactly the same as the else if statement
which is

PHP Code:
self.isCranked == false 

unless gsc scripts if statements works differently than other programming languages

sorry for getting into your code but i really wanted to play this mod

and thanx for the mod its great and awesome
keep up the good work ^_^


Lol it sent me an email about this. You will need to set the dvar manually on the game console with "seta" if it is not registering

oh i see lol

you should make a default value for the dvar if its not working as expected or the user didnt set the time correctly

well its expected coz im still noob in gsc sentex and how its working so i couldnt figure it out...

i think i need to learn that XD
  Reply
#39
Stop using an old version. This is the final version of cranked.
Code:
/************************************\
            CRANKED v1
    Created by Intricate for REKT
/************************************/

#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
#include common_scripts\utility;

/*
    Cranked
    Objective:     Get your first kill and then have 30 seconds to continue killing
    Map ends:    When one team reaches the score limit, or time limit is reached
    Respawning:    No wait / Near teammates

    Level requirementss
    ------------------
        Spawnpoints:
            classname        mp_tdm_spawn
            All players spawn from these. The spawnpoint chosen is dependent on the current locations of teammates and enemies
            at the time of spawn. Players generally spawn behind their teammates relative to the direction of enemies.

        Spectator Spawnpoints:
            classname        mp_global_intermission
            Spectators spawn from these and intermission is viewed from these positions.
            Atleast one is required, any more and they are randomly chosen between.
*/

/*QUAKED mp_tdm_spawn (0.0 0.0 1.0) (-16 -16 0) (16 16 72)
Players spawn away from enemies and near their team at one of these positions.*/

/*QUAKED mp_tdm_spawn_axis_start (0.5 0.0 1.0) (-16 -16 0) (16 16 72)
Axis players spawn away from enemies and near their team at one of these positions at the start of a round.*/

/*QUAKED mp_tdm_spawn_allies_start (0.0 0.5 1.0) (-16 -16 0) (16 16 72)
Allied players spawn away from enemies and near their team at one of these positions at the start of a round.*/

main()
{
    if(getdvar("mapname") == "mp_background")
        return;
    
    maps\mp\gametypes\_globallogic::init();
    maps\mp\gametypes\_callbacksetup::SetupCallbacks();
    maps\mp\gametypes\_globallogic::SetupCallbacks();

    registerRoundSwitchDvar( level.gameType, 0, 0, 9 );
    registerTimeLimitDvar( level.gameType, 10, 0, 1440 );
    registerScoreLimitDvar( level.gameType, 500, 0, 5000 );
    registerRoundLimitDvar( level.gameType, 1, 0, 10 );
    registerWinLimitDvar( level.gameType, 1, 0, 10 );
    registerRoundSwitchDvar( level.gameType, 3, 0, 30 );
    registerNumLivesDvar( level.gameType, 0, 0, 10 );
    registerHalfTimeDvar( level.gameType, 0, 0, 1 );

    level.teamBased = true;
    level.onStartGameType = ::onStartGameType;
    level.getSpawnPoint = ::getSpawnPoint;
    level.onNormalDeath = ::onNormalDeath;
    level.onSpawnPlayer = ::onSpawnPlayer;
}


onStartGameType()
{
    setClientNameMode("auto_change");

    setObjectiveText( "allies", &"OBJECTIVES_WAR" );
    setObjectiveText( "axis", &"OBJECTIVES_WAR" );
    
    if ( level.splitscreen )
    {
        setObjectiveScoreText( "allies", &"OBJECTIVES_WAR" );
        setObjectiveScoreText( "axis", &"OBJECTIVES_WAR" );
    }
    else
    {
        setObjectiveScoreText( "allies", &"OBJECTIVES_WAR_SCORE" );
        setObjectiveScoreText( "axis", &"OBJECTIVES_WAR_SCORE" );
    }
    setObjectiveHintText( "allies", &"OBJECTIVES_WAR_HINT" );
    setObjectiveHintText( "axis", &"OBJECTIVES_WAR_HINT" );
            
    level.spawnMins = ( 0, 0, 0 );
    level.spawnMaxs = ( 0, 0, 0 );    
    maps\mp\gametypes\_spawnlogic::placeSpawnPoints( "mp_tdm_spawn_allies_start" );
    maps\mp\gametypes\_spawnlogic::placeSpawnPoints( "mp_tdm_spawn_axis_start" );
    maps\mp\gametypes\_spawnlogic::addSpawnPoints( "allies", "mp_tdm_spawn" );
    maps\mp\gametypes\_spawnlogic::addSpawnPoints( "axis", "mp_tdm_spawn" );
    
    level.mapCenter = maps\mp\gametypes\_spawnlogic::findBoxCenter( level.spawnMins, level.spawnMaxs );
    setMapCenter( level.mapCenter );
    
    allowed[0] = level.gameType;
    allowed[1] = "airdrop_pallet";
    
    maps\mp\gametypes\_gameobjects::main(allowed);    

    level thread onPlayerConnect();    
    setDvarIfUninitialized( "scr_cranked_time", 30 );
}

onPlayerConnect()
{
    self endon("disconnect");
    for(;;)
    {
        level waittill( "connected", player );
        player thread Cranked_Overlay_Start();
        player.isCranked = undefined;
        player.equippedPerks = [];
    }
}

onSpawnPlayer()
{
    self thread DeleteOverlay();
    self.isCranked = false;
    self.equippedPerks = [];
}

getSpawnPoint()
{
    spawnteam = self.pers["team"];

    if ( level.inGracePeriod )
    {
        spawnPoints = maps\mp\gametypes\_spawnlogic::getSpawnpointArray( "mp_tdm_spawn_" + spawnteam + "_start" );
        spawnPoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_Random( spawnPoints );
    }
    else
    {
        spawnPoints = maps\mp\gametypes\_spawnlogic::getTeamSpawnPoints( spawnteam );
        spawnPoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_NearTeam( spawnPoints );
    }
    
    return spawnPoint;
}

Cranked()
{
    self endon("death");
    self endon("disconnect");

    self.isCranked = true;
    self crnk_PerkLogic( "true", undefined );
    
    self thread Cranked_Overlay();
    self thread Cranked_Timer();
}

onNormalDeath( victim, attacker, lifeId )
{
    score = maps\mp\gametypes\_rank::getScoreInfoValue( "kill" );
    assert( isDefined( score ) );

    attacker maps\mp\gametypes\_gamescore::giveTeamScoreForObjective( attacker.pers["team"], score );
    
    if( victim != attacker )
    {
        if( !attacker.isCranked )
            attacker thread Cranked();
        else if( attacker.isCranked )
            attacker thread Cranked_Timer();
    }

    if ( game["state"] == "postgame" && game["teamScores"][attacker.team] > game["teamScores"][level.otherTeam[attacker.team]] )
        attacker.finalKill = true;
}

Cranked_Overlay_Start()
{
    self waittill("spawned_player");
    
    self.CrankedOverlay = newClientHudElem( self );
    self.CrankedOverlay.x = 0;
    self.CrankedOverlay.y = 0;
    self.CrankedOverlay.alignX = "left";
    self.CrankedOverlay.alignY = "top";
    self.CrankedOverlay.horzAlign = "fullscreen";
    self.CrankedOverlay.vertAlign = "fullscreen";
    self.CrankedOverlay setshader ( "combathigh_overlay", 640, 480 );
    self.CrankedOverlay.sort = -10;
    self.CrankedOverlay.archived = false;    
    self.CrankedOverlay.alpha = 0;
    //
    self.CrankedTime = self createTimer( "hudbig", 0.8 );
    self.CrankedTime setPoint("CENTER", "CENTER", -250, 90);
    self.CrankedTime.label = &""; //keep it empty at start
    self.CrankedTime.color = (1,1,0.5);
    self.CrankedTime.archived = true;
    self.CrankedTime.hideWhenInMenu = true;
    self.CrankedTime.alpha = 0;
    //
    self.CrankedText = createFontString( "hudbig", 0.6);
    self.CrankedText setPoint("CENTER", "CENTER", -230, 100);
    self.CrankedText.color = (1,1,0.5);
    self.CrankedText.label = &"CRANKED";
    self.CrankedText.archived = true;
    self.CrankedText.hideWhenInMenu = true;
    self.CrankedText.alpha = 0;
}

Cranked_Overlay()
{
    self endon("death");
    self endon("disconnect");
    self.CrankedOverlay fadeOverTime( 0.75 );
    self.CrankedOverlay.alpha = 1;
    self.CrankedOverlay.sort = 1;
    //
    self.CrankedTime fadeOverTime( 0.75 );
    self.CrankedTime.alpha = 1;
    self.CrankedTime.sort = 1;
    //
    self.CrankedText fadeOverTime ( 0.75 );
    self.CrankedText.alpha = 1;
    self.CrankedText.sort = 1;
}

Cranked_Timer()
{    
    self endon("death");
    self notify("is_cranked");
    self endon("is_cranked");
    
    self playLocalSound("mp_bonus_start");
    self.CrankedTime setTenthsTimer( getDvarInt("scr_cranked_time") );
    maps\mp\gametypes\_hostmigration::waitLongDurationWithHostMigrationPause( getDvarInt("scr_cranked_time") - 5 );
    //Intricate - Decided to just add the Ghost thingy where it has the timer.
    //So what I did was take 5 seconds of the wait and did a good ol' for loop.
    //We start at 5 (so it's easier to understand) and then countdown to 0.
    for( i = 5; i > 0; i-- )
    {
        self playLocalSound( "ui_mp_suitcasebomb_timer" );
        self.CrankedTime fadeOverTime ( 0.5 );
        self.CrankedTime.alpha = 0.4;
        wait 0.5;
        self.CrankedTime fadeOverTime ( 0.5 );
        self.CrankedTime.alpha = 1;
        wait 0.5;
    }
    
    self thread Cranked_Fail();
}

Cranked_Fail()
{
    self endon("death");
    if( maps\mp\killstreaks\_killstreaks::isRideKillstreak( self GetCurrentWeapon() ) )
    {
        self notify("failed");
        self thread DeleteOverlay( "true" );
        self.isCranked = false;
    }
    else
    {
        self playSound( "detpack_explo_default" );
        PlayFX(level.c4Death, self.origin);
        self suicide();
    }
}

DeleteOverlay( killstreak )
{
    self waittill_either("death", "failed");
    
    self.CrankedOverlay fadeOverTime ( 0.3 );
    self.CrankedOverlay.alpha = 0;
    //
    self.CrankedTime fadeOverTime ( 0.3 );
    self.CrankedTime.alpha = 0;
    //
    self.CrankedText fadeOverTime ( 0.3 );
    self.CrankedText.alpha = 0;
    //
    if( isDefined( killstreak ) )
        self crnk_PerkLogic( undefined, "true" );
}

crnk_PerkLogic( setting, unsetting )
{
    if( isDefined( setting ) )
    {
        perkList = perksList();
        perkSetIndex = 0;
        foreach ( perk in perkList )
        {
            if ( ! ( self _hasPerk( perk ) ) )
            {
                //Intricate - Check if we don't have the perk that's supposed to be given.
                //Then give it to them and save it as a local var.
                self _setPerk( perk );
                self.equippedPerks[perkSetIndex] = perk;
                perkSetIndex++;
            }
        }
    }
    else if( isDefined( unsetting ) )
    {
        //Intricate - Check if we did set the perks and then unset/delete.
        foreach( perk in self.equippedPerks )
        {
            if( self _hasPerk( perk ) )
            {
                self _unsetPerk( perk );
                self.equippedPerks = [];
            }
        }
    }
}

perksList()
{
    perks = [];
    perks[0] = "specialty_fastreload";
    perks[1] = "specialty_quickdraw";
    perks[2] = "specialty_marathon";
    perks[3] = "specialty_fastmantle";
    perks[4] = "specialty_lightweight";
    perks[5] = "specialty_fastsprintrecovery";
    return perks;
}

onTimeLimit()
{
    if ( game["status"] == "overtime" )
    {
        winner = "forfeit";
    }
    else if ( game["teamScores"]["allies"] == game["teamScores"]["axis"] )
    {
        winner = "overtime";
    }
    else if ( game["teamScores"]["axis"] > game["teamScores"]["allies"] )
    {
        winner = "axis";
    }
    else
    {
        winner = "allies";
    }
    
    thread maps\mp\gametypes\_gamelogic::endGame( winner, game["strings"]["time_limit_reached"] );
}
If you're getting errors with DVAR's replace the function with setDvar I don't know what you're using that's causing it because it works for me everywhere.
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
  Reply
#40
(09-09-2014, 20:05)DidUknowiPwn Wrote: Stop using an old version. This is the final version of cranked.
Code:
/************************************\
            CRANKED v1
    Created by Intricate for REKT
/************************************/

#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
#include common_scripts\utility;

/*
    Cranked
    Objective:     Get your first kill and then have 30 seconds to continue killing
    Map ends:    When one team reaches the score limit, or time limit is reached
    Respawning:    No wait / Near teammates

    Level requirementss
    ------------------
        Spawnpoints:
            classname        mp_tdm_spawn
            All players spawn from these. The spawnpoint chosen is dependent on the current locations of teammates and enemies
            at the time of spawn. Players generally spawn behind their teammates relative to the direction of enemies.

        Spectator Spawnpoints:
            classname        mp_global_intermission
            Spectators spawn from these and intermission is viewed from these positions.
            Atleast one is required, any more and they are randomly chosen between.
*/

/*QUAKED mp_tdm_spawn (0.0 0.0 1.0) (-16 -16 0) (16 16 72)
Players spawn away from enemies and near their team at one of these positions.*/

/*QUAKED mp_tdm_spawn_axis_start (0.5 0.0 1.0) (-16 -16 0) (16 16 72)
Axis players spawn away from enemies and near their team at one of these positions at the start of a round.*/

/*QUAKED mp_tdm_spawn_allies_start (0.0 0.5 1.0) (-16 -16 0) (16 16 72)
Allied players spawn away from enemies and near their team at one of these positions at the start of a round.*/

main()
{
    if(getdvar("mapname") == "mp_background")
        return;
    
    maps\mp\gametypes\_globallogic::init();
    maps\mp\gametypes\_callbacksetup::SetupCallbacks();
    maps\mp\gametypes\_globallogic::SetupCallbacks();

    registerRoundSwitchDvar( level.gameType, 0, 0, 9 );
    registerTimeLimitDvar( level.gameType, 10, 0, 1440 );
    registerScoreLimitDvar( level.gameType, 500, 0, 5000 );
    registerRoundLimitDvar( level.gameType, 1, 0, 10 );
    registerWinLimitDvar( level.gameType, 1, 0, 10 );
    registerRoundSwitchDvar( level.gameType, 3, 0, 30 );
    registerNumLivesDvar( level.gameType, 0, 0, 10 );
    registerHalfTimeDvar( level.gameType, 0, 0, 1 );

    level.teamBased = true;
    level.onStartGameType = ::onStartGameType;
    level.getSpawnPoint = ::getSpawnPoint;
    level.onNormalDeath = ::onNormalDeath;
    level.onSpawnPlayer = ::onSpawnPlayer;
}


onStartGameType()
{
    setClientNameMode("auto_change");

    setObjectiveText( "allies", &"OBJECTIVES_WAR" );
    setObjectiveText( "axis", &"OBJECTIVES_WAR" );
    
    if ( level.splitscreen )
    {
        setObjectiveScoreText( "allies", &"OBJECTIVES_WAR" );
        setObjectiveScoreText( "axis", &"OBJECTIVES_WAR" );
    }
    else
    {
        setObjectiveScoreText( "allies", &"OBJECTIVES_WAR_SCORE" );
        setObjectiveScoreText( "axis", &"OBJECTIVES_WAR_SCORE" );
    }
    setObjectiveHintText( "allies", &"OBJECTIVES_WAR_HINT" );
    setObjectiveHintText( "axis", &"OBJECTIVES_WAR_HINT" );
            
    level.spawnMins = ( 0, 0, 0 );
    level.spawnMaxs = ( 0, 0, 0 );    
    maps\mp\gametypes\_spawnlogic::placeSpawnPoints( "mp_tdm_spawn_allies_start" );
    maps\mp\gametypes\_spawnlogic::placeSpawnPoints( "mp_tdm_spawn_axis_start" );
    maps\mp\gametypes\_spawnlogic::addSpawnPoints( "allies", "mp_tdm_spawn" );
    maps\mp\gametypes\_spawnlogic::addSpawnPoints( "axis", "mp_tdm_spawn" );
    
    level.mapCenter = maps\mp\gametypes\_spawnlogic::findBoxCenter( level.spawnMins, level.spawnMaxs );
    setMapCenter( level.mapCenter );
    
    allowed[0] = level.gameType;
    allowed[1] = "airdrop_pallet";
    
    maps\mp\gametypes\_gameobjects::main(allowed);    

    level thread onPlayerConnect();    
    setDvarIfUninitialized( "scr_cranked_time", 30 );
}

onPlayerConnect()
{
    self endon("disconnect");
    for(;;)
    {
        level waittill( "connected", player );
        player thread Cranked_Overlay_Start();
        player.isCranked = undefined;
        player.equippedPerks = [];
    }
}

onSpawnPlayer()
{
    self thread DeleteOverlay();
    self.isCranked = false;
    self.equippedPerks = [];
}

getSpawnPoint()
{
    spawnteam = self.pers["team"];

    if ( level.inGracePeriod )
    {
        spawnPoints = maps\mp\gametypes\_spawnlogic::getSpawnpointArray( "mp_tdm_spawn_" + spawnteam + "_start" );
        spawnPoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_Random( spawnPoints );
    }
    else
    {
        spawnPoints = maps\mp\gametypes\_spawnlogic::getTeamSpawnPoints( spawnteam );
        spawnPoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_NearTeam( spawnPoints );
    }
    
    return spawnPoint;
}

Cranked()
{
    self endon("death");
    self endon("disconnect");

    self.isCranked = true;
    self crnk_PerkLogic( "true", undefined );
    
    self thread Cranked_Overlay();
    self thread Cranked_Timer();
}

onNormalDeath( victim, attacker, lifeId )
{
    score = maps\mp\gametypes\_rank::getScoreInfoValue( "kill" );
    assert( isDefined( score ) );

    attacker maps\mp\gametypes\_gamescore::giveTeamScoreForObjective( attacker.pers["team"], score );
    
    if( victim != attacker )
    {
        if( !attacker.isCranked )
            attacker thread Cranked();
        else if( attacker.isCranked )
            attacker thread Cranked_Timer();
    }

    if ( game["state"] == "postgame" && game["teamScores"][attacker.team] > game["teamScores"][level.otherTeam[attacker.team]] )
        attacker.finalKill = true;
}

Cranked_Overlay_Start()
{
    self waittill("spawned_player");
    
    self.CrankedOverlay = newClientHudElem( self );
    self.CrankedOverlay.x = 0;
    self.CrankedOverlay.y = 0;
    self.CrankedOverlay.alignX = "left";
    self.CrankedOverlay.alignY = "top";
    self.CrankedOverlay.horzAlign = "fullscreen";
    self.CrankedOverlay.vertAlign = "fullscreen";
    self.CrankedOverlay setshader ( "combathigh_overlay", 640, 480 );
    self.CrankedOverlay.sort = -10;
    self.CrankedOverlay.archived = false;    
    self.CrankedOverlay.alpha = 0;
    //
    self.CrankedTime = self createTimer( "hudbig", 0.8 );
    self.CrankedTime setPoint("CENTER", "CENTER", -250, 90);
    self.CrankedTime.label = &""; //keep it empty at start
    self.CrankedTime.color = (1,1,0.5);
    self.CrankedTime.archived = true;
    self.CrankedTime.hideWhenInMenu = true;
    self.CrankedTime.alpha = 0;
    //
    self.CrankedText = createFontString( "hudbig", 0.6);
    self.CrankedText setPoint("CENTER", "CENTER", -230, 100);
    self.CrankedText.color = (1,1,0.5);
    self.CrankedText.label = &"CRANKED";
    self.CrankedText.archived = true;
    self.CrankedText.hideWhenInMenu = true;
    self.CrankedText.alpha = 0;
}

Cranked_Overlay()
{
    self endon("death");
    self endon("disconnect");
    self.CrankedOverlay fadeOverTime( 0.75 );
    self.CrankedOverlay.alpha = 1;
    self.CrankedOverlay.sort = 1;
    //
    self.CrankedTime fadeOverTime( 0.75 );
    self.CrankedTime.alpha = 1;
    self.CrankedTime.sort = 1;
    //
    self.CrankedText fadeOverTime ( 0.75 );
    self.CrankedText.alpha = 1;
    self.CrankedText.sort = 1;
}

Cranked_Timer()
{    
    self endon("death");
    self notify("is_cranked");
    self endon("is_cranked");
    
    self playLocalSound("mp_bonus_start");
    self.CrankedTime setTenthsTimer( getDvarInt("scr_cranked_time") );
    maps\mp\gametypes\_hostmigration::waitLongDurationWithHostMigrationPause( getDvarInt("scr_cranked_time") - 5 );
    //Intricate - Decided to just add the Ghost thingy where it has the timer.
    //So what I did was take 5 seconds of the wait and did a good ol' for loop.
    //We start at 5 (so it's easier to understand) and then countdown to 0.
    for( i = 5; i > 0; i-- )
    {
        self playLocalSound( "ui_mp_suitcasebomb_timer" );
        self.CrankedTime fadeOverTime ( 0.5 );
        self.CrankedTime.alpha = 0.4;
        wait 0.5;
        self.CrankedTime fadeOverTime ( 0.5 );
        self.CrankedTime.alpha = 1;
        wait 0.5;
    }
    
    self thread Cranked_Fail();
}

Cranked_Fail()
{
    self endon("death");
    if( maps\mp\killstreaks\_killstreaks::isRideKillstreak( self GetCurrentWeapon() ) )
    {
        self notify("failed");
        self thread DeleteOverlay( "true" );
        self.isCranked = false;
    }
    else
    {
        self playSound( "detpack_explo_default" );
        PlayFX(level.c4Death, self.origin);
        self suicide();
    }
}

DeleteOverlay( killstreak )
{
    self waittill_either("death", "failed");
    
    self.CrankedOverlay fadeOverTime ( 0.3 );
    self.CrankedOverlay.alpha = 0;
    //
    self.CrankedTime fadeOverTime ( 0.3 );
    self.CrankedTime.alpha = 0;
    //
    self.CrankedText fadeOverTime ( 0.3 );
    self.CrankedText.alpha = 0;
    //
    if( isDefined( killstreak ) )
        self crnk_PerkLogic( undefined, "true" );
}

crnk_PerkLogic( setting, unsetting )
{
    if( isDefined( setting ) )
    {
        perkList = perksList();
        perkSetIndex = 0;
        foreach ( perk in perkList )
        {
            if ( ! ( self _hasPerk( perk ) ) )
            {
                //Intricate - Check if we don't have the perk that's supposed to be given.
                //Then give it to them and save it as a local var.
                self _setPerk( perk );
                self.equippedPerks[perkSetIndex] = perk;
                perkSetIndex++;
            }
        }
    }
    else if( isDefined( unsetting ) )
    {
        //Intricate - Check if we did set the perks and then unset/delete.
        foreach( perk in self.equippedPerks )
        {
            if( self _hasPerk( perk ) )
            {
                self _unsetPerk( perk );
                self.equippedPerks = [];
            }
        }
    }
}

perksList()
{
    perks = [];
    perks[0] = "specialty_fastreload";
    perks[1] = "specialty_quickdraw";
    perks[2] = "specialty_marathon";
    perks[3] = "specialty_fastmantle";
    perks[4] = "specialty_lightweight";
    perks[5] = "specialty_fastsprintrecovery";
    return perks;
}

onTimeLimit()
{
    if ( game["status"] == "overtime" )
    {
        winner = "forfeit";
    }
    else if ( game["teamScores"]["allies"] == game["teamScores"]["axis"] )
    {
        winner = "overtime";
    }
    else if ( game["teamScores"]["axis"] > game["teamScores"]["allies"] )
    {
        winner = "axis";
    }
    else
    {
        winner = "allies";
    }
    
    thread maps\mp\gametypes\_gamelogic::endGame( winner, game["strings"]["time_limit_reached"] );
}
If you're getting errors with DVAR's replace the function with setDvar I don't know what you're using that's causing it because it works for me everywhere.

i play on lan only using iwnet so maybe this is causing problem ...
thanx, and sorry for asking alot XD
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)