Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 82 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty: World at War
Category: CoDWW Scripting
Scripting and coding with Call of Duty: World at War.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: I need some help with this please
aden34
General Member
Since: Mar 6, 2012
Posts: 5
Last: Mar 7, 2012
[view latest posts]
Level 0
Category: CoDWW Scripting
Posted: Tuesday, Mar. 6, 2012 07:44 pm
I am trying to make it so this lunarlander has to be hold the use button and not just press it. Ive looked everywhere but i cant seem to find an answer. here is the script for it. i took it from a compressed .ff file and used prettyprinter to change it which is why it looks messed up.


Code:
}
doLunarLander(){
    if( IsSubStr( level.script, "nazi_zombie_factory" ) && self GetFortStatus() == "SpotAvail" ){
        for( i = 0;
        i <
        get_players().size;
        i++ ){
            get_players()[i].OnLunar = false;
            
        }
        level.LunarsSpwnd = true;
        self iPrintln( "Lunar Landers ^2Spawned" );
        self thread LunaRModels();
        self thread LunaR();
        self thread LunaR2();
        self thread LunarFxCircle();
        
    }
    
}
LunaRModels(){
    level.LunarInUse = false;
    level.LunarPosition = "Spawn";
    SpawnPos = ( 52, -440, -1.2 );
    level._effect["zombie_flashback_american"] = loadfx( "maps/zombie/fx_zombie_flashback_american" );
    playfx( level._effect["zombie_flashback_american"], SpawnPos );
    playfx( level._effect["zombie_flashback_american"], SpawnPos );
    playfx( level._effect["zombie_flashback_american"], ( 300, -1640, 58 ) );
    playfx( level._effect["zombie_flashback_american"], ( 300, -1640, 58 ) );
    level.Lunar1 = spawn( "script_model", SpawnPos );
    level.Lunar1 setmodel( "zombie_teleporter_pad" );
    level.Lunar2 = spawn( "script_model", level.Lunar1.origin );
    level.Lunar2 setModel( level.Lunar1.model );
    level.Lunar2.angles = ( -180, 0, 0 );
    level.Lunar2 linkto( level.Lunar1 );
    level.PlayerOrig0 = spawn( "script_model", level.Lunar1.origin + ( 0, 50, 20 ) );
    level.PlayerOrig0 linkto( level.Lunar1 );
    level.PlayerOrig1 = spawn( "script_model", level.Lunar1.origin + ( 0, -50, 20 ) );
    level.PlayerOrig1 linkto( level.Lunar1 );
    level.PlayerOrig2 = spawn( "script_model", level.Lunar1.origin + ( 50, 0, 20 ) );
    level.PlayerOrig2 linkto( level.Lunar1 );
    level.PlayerOrig3 = spawn( "script_model", level.Lunar1.origin + ( -50, 0, 20 ) );
    level.PlayerOrig3 linkto( level.Lunar1 );
    level.CtrlPan = spawn( "script_model", level.Lunar1.origin + ( 0, -8, 40 ) );
    level.CtrlPan setmodel( "zombie_teleporter_control_panel" );
    level.CtrlPan linkto( level.Lunar1 );
    level.CtrlPan2 = spawn( "script_model", level.Lunar1.origin + ( 0, 8, 40 ) );
    level.CtrlPan2 setmodel( level.CtrlPan.model );
    level.CtrlPan2.angles = ( 0, 180, 0 );
    level.CtrlPan2 linkto( level.Lunar1 );
    for( i = 0;
    i <
    get_players().size;
    i++ ){
        get_players()[i].OnLunar = false;
        
    }
    
}
LunaR(){
    level.LunaTrig = Spawn( "trigger_radius", level.Lunar1.origin, 1, 50, 20 );
    level.LunaTrig SetCursorHint( "HINT_NOICON" );
    level.LunaTrig SetHintString( "Press & Hold &&1 To Use Lunar Lander" );
    for(;
    ;
    ){
        level.LunaTrig waittill( "trigger", i );
        if( i UseButtonPressed() && level.LunarPosition == "Spawn" && i.is_zombie == false && level.LunarInUse == false ){
            level.LunarInUse = true;
            playsoundatposition( "pa_buzz", ( 52, -440, -1.2 ) );
            level.LunaTrig SetHintString( "Lunar Lander In Use" );
            level.LunaTrig2 SetHintString( "Lunar Lander In Use" );
            i LunarSpawn2Dest();
            level.LunarPosition = "Destination";
            level.LunarInUse = false;
            level.LunaTrig SetHintString( "Press & Hold &&1 To Call Lunar Lander" );
            level.LunaTrig2 SetHintString( "Press & Hold &&1 To Use Lunar Lander" );
            
        }
        if( i UseButtonPressed() && level.LunarPosition == "Destination" && i.is_zombie == false && level.LunarInUse == false ){
            level.LunarInUse = true;
            playsoundatposition( "pa_buzz", ( 52, -440, -1.2 ) );
            level.LunaTrig SetHintString( "Lunar Lander In Use" );
            level.LunaTrig2 SetHintString( "Lunar Lander In Use" );
            i LunarDest2Spawn();
            level.LunarPosition = "Spawn";
            level.LunarInUse = false;
            level.LunaTrig SetHintString( "Press & Hold &&1 To Use Lunar Lander" );
            level.LunaTrig2 SetHintString( "Press & Hold &&1 To Call Lunar Lander" );
            
        }
        
    }
    
}
LunaR2(){
    DestPos = ( 300, -1640, 58 );
    level.LunaTrig2 = Spawn( "trigger_radius", DestPos, 1, 50, 20 );
    level.LunaTrig2 SetCursorHint( "HINT_NOICON" );
    level.LunaTrig2 SetHintString( "Press & Hold &&1 To Call Lunar Lander" );
    for(;
    ;
    ){
        level.LunaTrig2 waittill( "trigger", i );
        if( i UseButtonPressed() && level.LunarPosition == "Spawn" && i.is_zombie == false && level.LunarInUse == false ){
            level.LunarInUse = true;
            playsoundatposition( "pa_buzz", DestPos );
            level.LunaTrig SetHintString( "Lunar Lander In Use" );
            level.LunaTrig2 SetHintString( "Lunar Lander In Use" );
            i LunarSpawn2Dest();
            level.LunarPosition = "Destination";
            level.LunarInUse = false;
            level.LunaTrig SetHintString( "Press & Hold &&1 To Call Lunar Lander" );
            level.LunaTrig2 SetHintString( "Press & Hold &&1 To Use Lunar Lander" );
            
        }
        if( i UseButtonPressed() && level.LunarPosition == "Destination" && i.is_zombie == false && level.LunarInUse == false ){
            level.LunarInUse = true;
            playsoundatposition( "pa_buzz", DestPos );
            level.LunaTrig SetHintString( "Lunar Lander In Use" );
            level.LunaTrig2 SetHintString( "Lunar Lander In Use" );
            i LunarDest2Spawn();
            level.LunarPosition = "Spawn";
            level.LunarInUse = false;
            level.LunaTrig SetHintString( "Press & Hold &&1 To Use Lunar Lander" );
            level.LunaTrig2 SetHintString( "Press & Hold &&1 To Call Lunar Lander" );
            
        }
        
    }
    
}
LunarSpawn2Dest(){
    self thread PlayerCheck( 0, level.PlayerOrig0 );
    self thread PlayerCheck( 1, level.PlayerOrig1 );
    self thread PlayerCheck( 2, level.PlayerOrig2 );
    self thread PlayerCheck( 3, level.PlayerOrig3 );
    self thread LunarEffect();
    self thread LunarNuke();
    self thread LunarFx( ( 52, -440, -1.2 ) );
    self thread LunarPowerUp( ( -163.83, -836.333, 719 ) );
    level.Lunar1 moveto( ( 85, -450, 699 ), 3, .5 );
    level.Lunar1 vibrate( ( 0, -100, 0 ), 1.5, .4, 3 );
    level.Lunar1 waittill( "movedone" );
    wait .2;
    level.Lunar1 moveto( ( 300, -1640, 699 ), 6 );
    level.Lunar1 waittill( "movedone" );
    wait .2;
    self thread KillAll( ( 300, -1640, 58 ) );
    level.Lunar1 moveto( ( 300, -1640, 58 ), 3, 0, .5 );
    level.Lunar1 vibrate( ( 0, -100, 0 ), 1.5, .4, 3 );
    level.Lunar1 waittill( "movedone" );
    self PlayerUnlink( 0 );
    self PlayerUnlink( 1 );
    self PlayerUnlink( 2 );
    self PlayerUnlink( 3 );
    self notify( "Lunar_Arrived" );
    
}
LunarDest2Spawn(){
    self thread PlayerCheck( 0, level.PlayerOrig0 );
    self thread PlayerCheck( 1, level.PlayerOrig1 );
    self thread PlayerCheck( 2, level.PlayerOrig2 );
    self thread PlayerCheck( 3, level.PlayerOrig3 );
    self thread LunarEffect();
    self thread LunarNuke();
    self thread LunarFx( ( 300, -1640, 58 ) );
    self thread LunarPowerUp( ( -163.83, -836.333, 719 ) );
    level.Lunar1 moveto( ( 300, -1640, 699 ), 3, .5 );
    level.Lunar1 vibrate( ( 0, -100, 0 ), 1.5, .4, 3 );
    level.Lunar1 waittill( "movedone" );
    wait .2;
    level.Lunar1 moveto( ( 52, -440, 699 ), 6 );
    level.Lunar1 waittill( "movedone" );
    wait .2;
    self thread KillAll( ( 52, -440, 1.8 ) );
    level.Lunar1 moveto( ( 52, -440, -1.2 ), 3, 0, .5 );
    level.Lunar1 vibrate( ( 0, -100, 0 ), 1.5, .4, 3 );
    level.Lunar1 waittill( "movedone" );
    self PlayerUnlink( 0 );
    self PlayerUnlink( 1 );
    self PlayerUnlink( 2 );
    self PlayerUnlink( 3 );
    self notify( "Lunar_Arrived" );
    
}
LunarEffect(){
    self endon( "Lunar_Arrived" );
    for(;
    ;
    ){
        Earthquake( .14, .2, level.Lunar1.origin, 500 );
        wait .2;
        
    }
    
}
LunarPowerUp( origin ){
    level.zombie_powerup_index = RandomInt( 4 );
    level.zombie_vars["zombie_drop_item"] = 1;
    level.powerup_drop_count = 0;
    level thread maps\_zombiemode_powerups::powerup_drop( origin );
    
}
PlayerCheck( num, origin ){
    P = get_players();
    if( Distance( P[num].origin, level.Lunar1.origin ) <
    100 ){
        P[num] PlayerLinkTo( origin );
        P[num] EnableHealthShield( true );
        P[num] EnableInvulnerability();
        P[num].OnLunar = true;
        
    }
    
}
PlayerUnlink( num ){
    P = get_players();
    if( Distance( P[num].origin, level.Lunar1.origin ) <
    100 ){
        P[num] unlink();
        P[num] EnableHealthShield( false );
        P[num] DisableInvulnerability();
        P[num].OnLunar = false;
        
    }
    
}
LunarNuke(){
    Zombz = GetAiSpeciesArray( "axis" );
    Zombz = get_array_of_closest( level.Lunar1.origin, Zombz, undefined, undefined, 300 );
    for( i = 0;
    i <
    Zombz.size;
    i++ ){
        wait( RandomFloatRange( .2, .3 ) );
        Zombz[i] maps\_zombiemode_spawner::zombie_head_gib();
        Zombz[i] DoDamage( 10000, Zombz[i].origin );
        PlaySoundatPosition( "nuked", Zombz[i].origin );
        
    }
    
}
KillAll( origin ){
    wait 2;
    self thread LunarNuke();
    for( i = 0;
    i <
    get_players().size;
    i++ ){
        self thread PlayerSquash( origin, i );
        
    }
    
}
PlayerSquash( ent, num ){
    self endon( "Lunar_Arrived" );
    P = get_players();
    for(;
    ;
    ){
        XAx = RandomIntRange( -110, 110 );
        YAx = RandomIntRange( -110, 110 );
        if( distance( P[num].origin, ent ) <
        100 && P[num].OnLunar == false ){
            P[num] DisableInvulnerability();
            P[num] DoDamage( P[num].health + 999999, P[num].origin, undefined, undefined, "riflebullet" );
            P[num] DoDamage( P[num].health + 999999, P[num].origin, undefined, undefined, "riflebullet" );
            P[num] DoDamage( P[num].health + 999999, P[num].origin, undefined, undefined, "riflebullet" );
            P[num] setOrigin( ent + ( XAx, YAx, 3 ) );
            
        }
        wait .01;
        
    }
    
}
LunarFx( orig ){
    level._effect["mainframe_steam"] = loadfx( "maps/zombie/fx_zombie_mainframe_steam" );
    a = "mainframe_steam";
    playfx( level._effect[a], orig + ( 50, -50, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( -50, -50, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( 50, 50, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( -50, 50, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( 0, -50, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( 0, 50, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( -50, 0, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( 50, 0, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( -50, 25, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( -50, -25, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( 50, 25, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( 50, -25, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( -25, -50, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( -25, 50, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( 25, -50, 0 ) );
    wait .05;
    playfx( level._effect[a], orig + ( 25, 50, 0 ) );
    wait .05;
    
}
LunarFxCircle(){
    self thread LunarFxCircle2( ( 52, -440, 10 ) );
    self thread LunarFxCircle2( ( 300, -1640, 70 ) );
    
}
LunarFxCircle2( origin ){
    LunarFxC = spawn( "script_model", origin );
    LunarFxC2 = spawn( "script_model", LunarFxC.origin + ( 0, -56, 0 ) );
    LunarFxC2 SetModel( "tag_origin" );
    LunarFxC2.angles = ( 270, 0, 0 );
    LunarFxC2 LinkTo( LunarFxC );
    LunarFxC thread Rotate_Model( 360, 3 );
    LunarFxC3 = spawn( "script_model", origin );
    LunarFxC4 = spawn( "script_model", LunarFxC3.origin + ( 0, 56, 0 ) );
    LunarFxC4 SetModel( "tag_origin" );
    LunarFxC4.angles = ( 270, 0, 0 );
    LunarFxC4 LinkTo( LunarFxC3 );
    LunarFxC3 thread Rotate_Model( -360, 3 );
    for( i = 0;
    i <
    3;
    i++ ){
        PlayFxOnTag( level._effect["mp_light_lamp"], LunarFxC2, "tag_origin" );
        PlayFxOnTag( level._effect["mp_light_lamp"], LunarFxC4, "tag_origin" );
        
    }
    
}
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty: World at War : CoDWW Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»