Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Standalone Airstrike CoD2

  1. #1
    Private
    Join Date
    Feb 2013
    Location
    Poland
    Posts
    32
    Thanks
    33
    Thanked 27 Times in 8 Posts

    Standalone Airstrike CoD2

    For all wanted real airstrike. Full customizable airstreak standalone script.

    _airstrike.gsc
    PHP Code:
    /////////////////////////
    // scripted by: BlancO //
    /////////////////////////

    Setup()
    {
        
    // Text variables
        
    level.airstrikeUseText "Press F in Binoculars to use airstrike!";
        
    level.airstrikeIncommingText "Airstrike incomming!";

        
    // Models
        
    level.airstrikePlane "xmodel/vehicle_p51_mustang";
        
    precacheModel(level.airstrikePlane);

        
    level.airstrikeBomb "xmodel/prop_stuka_bomb";
        
    precacheModel(level.airstrikeBomb);

        
    // Efx of bomb explosion
        
    level.airstrikBombEFX loadFx("fx/explosions/mortarExp_dirt.efx");

        
    // Count of bombs plane will drop
        
    level.airstrikeBombsCount 10;
        
    // Distance of damage
        
    level.airstrikeBombRange 200;
        
    // Damage of single bomb
        
    level.airstrikeBombsDamage 300;
        
    // Set to 1 on zombie maps with ceils
        
    level.airstrikeIgnoreCeils 0;
        
    // Team will get damage "allies", "axis", "enemy", "all"
        
    level.airstrikeDamageTo "axis";
    }

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

        if(
    isDefined(level.airstrikeUse) && level.airstrikeUse != "")
            
    self iPrintlnBold(level.airstrikeUse);

        
    self waittill("binocular_fire");
        
    targetPos GetTargetedPos();

        if(
    isDefined(level.airstrikeIncommingText) && level.airstrikeIncommingText != "")
            
    iPrintln(level.airstrikeIncommingText);

        if(
    isDefined(targetPos))
        {
            
    randomize = (0randomInt(360), 0);
            
    droppos = (targetPos[0], targetPos[1], targetPos[2] + 400);

            
    forward anglesToForward(randomize);
            
    forward maps\mp\_utility::vectorScale(forward10000);
            
    endOrigin droppos forward;
            
    startOrigin droppos forward;

            
    plane spawn("script_model"startOrigin);
            
    plane setmodel(level.airstrikePlane);
            
    plane.angles plane.angles randomize;

            
    plane moveto(endOrigin10);

            
    bombs level.airstrikeBombs;
            if(
    bombs 30bombs 30;

            
    delay = (bombs 0.05);

            
    wait delay;
            for(
    1<= bombs+= 1)
            {
                
    plane thread DropBomb(self);
                
    wait 0.1;
            }
            
    wait delay;

            
    plane delete();
        }
    }

    DropBomb(eAttacker)
    {
        
    tergetPos self.origin + (00, -400)
        if(!
    level.airstrikeIgnoreCeils)
        {
            
    trace bulletTrace(self.originself.origin + (00, -1000), falseself);
            
    targetPos trace["position"];
        }

        
    bomb spawn("script_model"self.origin);
        
    bomb setModel(level.airstrikeBomb);
        
    bomb.angles = (9000);

        
    time int(distance(self.origintargetPos) / 400);
        if(
    time 0.1)
            
    time 0.1;

        
    bomb moveTo(targetPostime);
        
    wait time;
        
        
    playfx(level.airstrikBombEFXtargetPos);
        
        
    players getentarray("player""classname");
        for(
    0players.sizei++)
            if(
    distance(targetPosplayers[i].origin) < level.airstrikeBombRange && players[i].pers["team"] != "spectator" && isAlive(players[i]) && (level.airstrikeDamageTo == "all" || (level.airstrikeDamageTo == "enemy" && eAttacker.pers["team"] != players[i].pers["team"]) || (eAttacker.pers["team"] == level.airstrikeDamageTo)))
                
    players[ithread [[level.callbackPlayerDamage]](eAttackereAttackerlevel.airstrikeBombsDamage1"MOD_PISTOL_BULLET""airstrike_mp"targetPostargetPos"none"0);
        
        
    bomb delete();
    }

    GetTargetedPos()
    {
        
    startOrigin self getEye();
        
    forward anglesToForward(self getPlayerAngles());
        
    forward maps\mp\_utility::vectorScale(forward100000);
        
    endOrigin startOrigin forward;    

        
    trace bulletTrace(startOriginendOriginfalseself);
        if(
    trace["fraction"] == 1.0 || trace["surfacetype"] == "default")
            
    endOrigin trace["position"];
        else if(
    trace["fraction"] < 1)
            
    endOrigin trace["position"];

        return 
    endOrigin;

    call on start
    thread scripts\_airstrike::Setup();

    call on player
    thread scripts\_airstrike::DoAirstrike();

    Have fun!
    BlancO ;)
    Last edited by BlancO; 13th September 2013 at 22:07.

  2. The Following 7 Users Say Thank You to BlancO For This Useful Post:

    EvoloZz (14th September 2013),Jeplaa (14th September 2013),kung foo man (14th September 2013),Ni3ls (14th September 2013),Rocky (24th March 2014),smect@ (16th September 2013),YuriJurek (13th September 2013)

  3. #2
    Private
    Join Date
    Sep 2013
    Posts
    13
    Thanks
    1
    Thanked 2 Times in 2 Posts
    how to use

  4. #3
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    There is a friggin setup() function and a doairstrike() function. What more do you want?

    Reading scripts is a good practice to start scripting yourself, and i'd suggest no more explanation should be given

  5. #4
    Private
    Join Date
    Jan 2014
    Posts
    26
    Thanks
    1
    Thanked 9 Times in 5 Posts
    No work Script eror u line 82: if(!level.airstrikeIgnoreCeils)

  6. #5
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Quote Originally Posted by goddzila View Post
    No work Script eror u line 82: if(!level.airstrikeIgnoreCeils)
    Looks like a missing ; in the line before.

    PHP Code:
        tergetPos self.origin + (00, -400)
        if(!
    level.airstrikeIgnoreCeils
    To

    PHP Code:
        tergetPos self.origin + (00, -400);
        if(!
    level.airstrikeIgnoreCeils
    timescale 0.01

  7. The Following 3 Users Say Thank You to kung foo man For This Useful Post:

    BlancO (5th January 2014),goddzila (6th January 2014),YuriJurek (5th January 2014)

  8. #6
    Private
    Join Date
    Jan 2014
    Posts
    26
    Thanks
    1
    Thanked 9 Times in 5 Posts
    yes and fail line:
    tergetPos = self.origin + (0, 0, -400)

    update to:

    targetPos = self.origin + (0, 0, -400)

    and work script...


    if someone knows somewhere a script and a model helicopter for cod2

    and if someone can make a script to nuke
    Video: http://www.youtube.com/watch?list=UU...&v=OUkuCiM5yLI

  9. #7
    Private First Class
    Join Date
    Jul 2013
    Posts
    170
    Thanks
    44
    Thanked 16 Times in 11 Posts
    wtf xd ask inak :]

  10. #8
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    The chopper script should be complicated, and would require new models.

    Guys I'm gonna try to include this to my mod. It will be called on player death and be unlocked on kill streaks (like in the case of COD4, it's a 5 kill streak).

    Edit: the chopper movement would be complicated... it accelerates and stops all the time, its longitudinal and side velocities vary a lot -different from the airplane, that has a constant longitudinal velocity. It also turns to different directions. The coordinates it must follow should also be complicated, since the size of the maps is different (idk how its done for COD4, never played a custom map on it).
    Last edited by guiismiti; 7th January 2014 at 22:44.
    set logfile 2

  11. #9
    Private
    Join Date
    Jan 2014
    Posts
    26
    Thanks
    1
    Thanked 9 Times in 5 Posts
    If any of you know how to change the button :

    self waittill("binocular_fire")

    in this button 6,7,8,9 or f6, f7, f8

  12. #10
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by goddzila View Post
    If any of you know how to change the button :

    self waittill("binocular_fire")

    in this button 6,7,8,9 or f6, f7, f8
    You can do that in Options/Shoot/binoculars - [bind key of your choice]

    Or, find your "players" folder, and manually edit config_mp.cfg file:

    Code:
    bind F6 "+binoculars"

  13. The Following User Says Thank You to Tally For This Useful Post:

    kung foo man (11th January 2014)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •