Results 1 to 1 of 1

Thread: weapon shops on wall, nodl zombies, mp_carentan example files

  1. #1
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    1,922
    Thanks
    1,814
    Thanked 1,048 Times in 729 Posts

    weapon shops on wall, nodl zombies, mp_carentan example files

    mp_carentan.gsc

    PHP Code:
    // something is going wrong.
    // the bot isnt linked to the helper
    // maybe a wait 0.05 is missing ("let it happen")
    spawnPopulationBots()
    {
        
    helper spawn("script_origin", (57,1909,68));
        for (
    i=0i<1i++)
        {
            
    bot addTestClient();
            
    bot spawn(helper.origin, (0,0,0));
            
    bot.isBot 1;
            
    bot linkTo(helper);
        }
    }

    main()
    {
        
    maps\mp\_load::main();
        
    ambientPlay("ambient_france");

        
    game["allies"] = "american";
        
    game["axis"] = "german";
        
    game["attackers"] = "allies";
        
    game["defenders"] = "axis";
        
    game["american_soldiertype"] = "normandy";
        
    game["german_soldiertype"] = "normandy";

        
    // the bugged spawn near (-11,684,206)
        
    mod\UTILS::deleteEntityByClassnameAndId("mp_dm_spawn"279);

        
    mod\INTERFACE::startMod();
        
    mod\INTERFACE::createShop((176881836), 134);

        
    mortar1 mod\INTERFACE::addMortar( (-208,1798,206), 119);
        
    mortar1 mod\INTERFACE::addMortarTarget( (-588,2308,102) );

        
    mortar2 mod\INTERFACE::addMortar( (1696,2116,36), 198);
        
    mortar2 mod\INTERFACE::addMortarTarget( (1126,1987,20) );

        
    mortar3 mod\INTERFACE::addMortar( (1734,1868,36), 247);
        
    mortar3 mod\INTERFACE::addMortarTarget( (1578,1339,28) );

        
    mod\INTERFACE::addMortarAmmo((-811,2527,34), 316);
        
    mod\INTERFACE::addMortarAmmo((1932,1862,35), 139);
        
    //mod\INTERFACE::addRandomBox((1017,1181,-24+60), 357);

        
    mod\INTERFACE::shopTT30( (1798+18,1217,36), 180);
        
    mod\INTERFACE::shopGreaseGun( (1798+18,975,36), 180);
        
    mod\INTERFACE::shopKar98k( (1625,783-14,36), 90);

        
    // erster
        
    mod\INTERFACE::createTeleport( (656,448,274), (1484,943,458), "^9trigger #1"mod\UTILS::isHunter);
        
    // leichter jump
        
    mod\INTERFACE::createTeleport( (-472,2451,131), (1484,943,458), "^9trigger #2"mod\UTILS::isHunter);
        
    mod\INTERFACE::createTeleport( (-569,2546,110), (1484,943,458), "^9trigger #3"mod\UTILS::isHunter);
        
    mod\INTERFACE::createTeleport( (-518,2497,111), (1484,943,458), "^9trigger #4"mod\UTILS::isHunter);
        
    // schwerer jump
        
    mod\INTERFACE::createTeleport( (900,-951,100), (1484,943,458), "^9trigger #5"mod\UTILS::isHunter);
        
    mod\INTERFACE::createTeleport( (901,-1075,100), (1484,943,458), "^9trigger #6"mod\UTILS::isHunter);
        
    mod\INTERFACE::createTeleport( (900,-1022,120), (1484,943,458), "^9trigger #7"mod\UTILS::isHunter);
        
    mod\INTERFACE::createTeleport( (966,-936,128), (1484,943,458), "^9trigger #8"mod\UTILS::isHunter);
        
    // window links
        
    mod\INTERFACE::createTeleport( (1067,785,215), (1484,943,458), "^9trigger #9"mod\UTILS::isHunter);
        
    // window rechts
        
    mod\INTERFACE::createTeleport( (888,786,215), (1484,943,458), "^9trigger #10"mod\UTILS::isHunter);
        
    // hippys beschwerde 1
        
    mod\INTERFACE::createTeleport( (846,1721,197), (1484,943,458), "^9trigger #11"mod\UTILS::isHunter);
        
    // hippys beschwerde 1
        
    mod\INTERFACE::createTeleport( (944,1792,168), (1484,943,458), "^9trigger #12"mod\UTILS::isHunter);
        
    // we1n nade jump
        
    mod\INTERFACE::createTeleport( (989,3605,143), (1484,943,458), "^9trigger #13"mod\UTILS::isHunter);
        
    // god glitch (replaced by collision)
        // mod\INTERFACE::createTeleport( (-51,707,184), (1484,943,458), "^9trigger #13", mod\UTILS::isHunter);
        // two camp windows with nade or side-jump
        
    mod\INTERFACE::createTeleport( (1390,1584,214), (1484,943,458), "^9trigger #14"mod\UTILS::isHunter4);
        
    mod\INTERFACE::createTeleport( (1395,1704,214), (1484,943,458), "^9trigger #15"mod\UTILS::isHunter4);

        
    mod\INTERFACE::createRadio((1773,1353,36),269);

        
    // muster-code...
        // mod\interface::createCollision((,,),,); // 

        
    mod\interface::createCollision((-62,707,144),50,30); // hinter Komode

        //spawnPopulationBots();

        /*
        wait 5.00;
        //findIdOfBuggedSpawn():
        pointNearTheSpawn = (-11,684,206);
        spawns = getentarray("mp_dm_spawn", "classname");
        spawnNearest = spawns[0];
        spawnNearestDistance = distance(spawnNearest.origin, pointNearTheSpawn);
        for (i=1; i<spawns.size; i++)
        {
            distanceToThis = distance(spawns[i].origin, pointNearTheSpawn);
            if (distanceToThis < spawnNearestDistance)
            {
                spawnNearestDistance = distanceToThis;
                spawnNearest = spawns[i];
            }
        }
        iprintln("found the spawn: ", spawnNearest.origin, " id: ", spawnNearest getEntityNumber());
        */

    interface.gsc

    PHP Code:
    initVar(namevalue)
    {
        
    mod\INIT::initDefaultVar(namevalue);
    }

    startMod(overwrite)
    {
        
    mod\INIT::main();
    }

    createShop(posdir)
    {
        
    thread mod\SHOP::createShop(posdir);
    }

    addBadPlace(discriptionoriginradiusheight)
    {
        
    thread mod\BADPLACES::addBadPlace(discriptionoriginradiusheight);
    }

    addMortar(positiondir)
    {
        
    mortar mod\MORTAR::addMortar(positiondir);
        return 
    mortar;
    }

    addMortarTarget(position)
    {
        
    thread mod\MORTAR::addMortarTarget(position);
    }

    addMortarAmmo(positiondir)
    {
        
    thread mod\MORTAR::addMortarAmmo(positiondir);
    }

    addRandomBox(posdir)
    {
        
    //not implemented yet.
        
    thread mod\RANDOMBOX::addRandomBox(posdir);
    }

    createDefendBox(posdir)
    {
        
    mod\DEFENDBOXES::createDefendBox(posdir);
    }

    createModel(namepositionangles)
    {
        
    model spawn("script_model"position);
        
    model.angles angles;
        
    model setModel(name);

        return 
    model;
    }

    /*
    addBlocker(pos, size)
    {
        blocker = spawn("script_origin", pos);
        blocker setbounds( (0,0,0)-size, size);
        blocker setcontents(1);

        //level.size = size;

        level.blocker = blocker;

        thread makeVis();
    }
    */
    createTeleport(fromtomessagecallbackradius)
    {
        
    mod\TELEPORT::createTeleport(fromtomessagecallbackradius);
    }

    spawnSignTeddy(positionangle)
    {
        
    mod\SIGNS::spawnSignTeddy(positionangle);
    }

    spawnSignMortar(positionangle)
    {
        
    mod\SIGNS::spawnSignMortar(positionangle);
    }

    // methods of class "player"
    addMoney(money)
    {
        
    player self;
        
    player mod\PLAYER::PLAYER_addMoney(money);
    }

    checkpointCreate(nameposition)
    {
        
    mod\CHECKPOINT::checkpointCreate(nameposition);
    }

    checkpointConnect(fromtomaterialgivePrize)
    {
        
    mod\CHECKPOINT::checkpointConnect(fromtomaterialgivePrize);
    }

    checkpointSetFirstCheckpoint(namematerialgivePrice)
    {
        
    mod\CHECKPOINT::checkpointSetFirstCheckpoint(namematerialgivePrice);
    }

    shopTT30(posdir)
    {
        
    mod\WEAPONSHOPS::shopTT30(posdir);
    }
    shopGreaseGun(posdir)
    {
        
    mod\WEAPONSHOPS::shopGreaseGun(posdir);
    }
    shopKar98K(posdir)
    {
        
    mod\WEAPONSHOPS::shopKar98K(posdir);
    }
    createRadio(posangle)
    {
        
    mod\HINTRADIO::radioCreate(posangle-90);
    }

    createCollision(positionradiusheight)
    {
        
    coll spawn("trigger_radius"position0radiusheight); // name, position, flags, radius, height
        
    coll setContents(1);

    weaponshops.gsc

    PHP Code:
    precache()
    {
        
    game["shop_greasegun_hunter"] = &"^7Press ^8[^7[{+activate}]^8] ^7to buy a Greasegun ^8[^7600 coins^8]";
        
    game["shop_greasegun_zombie"] = &"zombies do not play with greaseguns^8... ^7:D";
        
    game["shop_tt30_hunter"] = &"^7Press ^8[^7[{+activate}]^8] ^7to buy a TT30 ^8[^7300 coins^8]";
        
    game["shop_tt30_zombie"] = &"zombies do not play with pistols^8... ^7:D";
        
    game["shop_kar98k_hunter"] = &"^7Press ^8[^7[{+activate}]^8] ^7to buy a M1 Carbine ^8[^7400 coins^8]";
        
    game["shop_kar98k_zombie"] = &"zombies do not play with carbines^8... ^7:D";
        
    precacheString(game["shop_greasegun_hunter"]);
        
    precacheString(game["shop_greasegun_zombie"]);
        
    precacheString(game["shop_tt30_hunter"]);
        
    precacheString(game["shop_tt30_zombie"]);
        
    precacheString(game["shop_kar98k_hunter"]);
        
    precacheString(game["shop_kar98k_zombie"]);
        
    precacheModel("xmodel/weapon_greasegun");
        
    precacheModel("xmodel/weapon_tt30");
        
    precacheModel("xmodel/weapon_m1carbine");
    }

    entityToWall(dirdistanceToWall)
    {
        
    entity self;
        
    forward anglesToForward((0,dir,0));

        
    // to wall
        
    delta mod\MATH::vecScale(forward, -1000);
        
    trace bullettrace(entity.originentity.origin+deltafalseundefined);

        if (
    trace["fraction"] == 1)
            return;

        
    // delta from wall away...
        
    delta mod\MATH::vecScale(forwarddistanceToWall);

        
    entity.origin trace["position"] + delta;
    }

    greasegun_buy(player)
    {
        if (
    player.pers["team"] != "allies")
        {
            
    player iprintln("^7[^8NOTICE^7] zombies can't buy greaseguns");
            return;
        }

        if (
    player mod\PLAYER::getMoney() < 600)
        {
            
    player iprintln("^7[^8NOTICE^7] you don't have enough coins to purchase. You need ^8"600" ^7coins.");
            return;
        }

        
    //iprintln("current weapon: " + );
        //player giveWeapon("greasegun_mp");
        //player giveMaxAmmo("greasegun_mp");

        
    player setWeaponSlotWeapon("primary""greasegun_mp");
        
    player giveMaxAmmo("primary");
        
    player giveMaxAmmo("primary");
        
    player giveMaxAmmo("primary");
        
    player giveMaxAmmo("primary");
        
    player switchToWeapon("greasegun_mp");

        
    player iprintln("^7[^8NOTICE^7] ^8greasegun purchased (price: ^8"+600+"^7)");
        
    player mod\PLAYER::subMoney(600);
        
    player playsound("weap_pickup");
    }
    shopGreaseGun(posdir)
    {
        
    gun mod\UTILS::spawnXmodel("xmodel/weapon_greasegun"posdir-90);
        
    gun entityToWall(dir2);
        
    gun thread mod\TRIGGER::spawnUseTrigger(
            ::
    greasegun_buy,
            
    game["shop_greasegun_hunter"],
            
    game["shop_greasegun_zombie"]
        );
        
    gun.trigger.origin += (0,0,-50);
    }

    kar98k_buy(player)
    {
        if (
    player.pers["team"] != "allies")
        {
            
    player iprintln("^7[^8NOTICE^7] zombies can't buy carabines");
            return;
        }

        if (
    player mod\PLAYER::getMoney() < 400)
        {
            
    player iprintln("^7[^8NOTICE^7] you don't have enough coins to purchase. You need ^8"400" ^7coins.");
            return;
        }

        
    player setWeaponSlotWeapon("primary""m1carbine_mp");
        
    player giveMaxAmmo("primary");
        
    player giveMaxAmmo("primary");
        
    player giveMaxAmmo("primary");
        
    player giveMaxAmmo("primary");
        
    player switchToWeapon("m1carbine_mp");

        
    player iprintln("^7[^8NOTICE^7] ^8M1 Carbine purchased (price: ^8"+400+"^7)");
        
    player mod\PLAYER::subMoney(400);
        
    player playsound("weap_pickup");
    }

    shopKar98k(posdir)
    {
        
    gun mod\UTILS::spawnXmodel("xmodel/weapon_m1carbine"posdir-90);
        
    gun entityToWall(dir2);
        
    gun thread mod\TRIGGER::spawnUseTrigger(
            ::
    kar98k_buy,
            
    game["shop_kar98k_hunter"],
            
    game["shop_kar98k_zombie"]
        );
        
    gun.trigger.origin += (0,0,-50);

    }
    tt30_buy(player)
    {
        if (
    player.pers["team"] != "allies")
        {
            
    player iprintln("^7[^8NOTICE^7] zombies can't buy pistoles");
            return;
        }

        if (
    player mod\PLAYER::getMoney() < 300)
        {
            
    player iprintln("^7[^8NOTICE^7] you don't have enough coins to purchase. You need ^8"300" ^7coins.");
            return;
        }

        
    //iprintln("current weapon: " + );
        //player giveWeapon("greasegun_mp");
        //player giveMaxAmmo("greasegun_mp");

        
    player setWeaponSlotWeapon("primaryb""tt30_mp");
        
    player giveMaxAmmo("primaryb");
        
    player giveMaxAmmo("primaryb");
        
    player giveMaxAmmo("primaryb");
        
    player giveMaxAmmo("primaryb");
        
    player switchToWeapon("tt30_mp");

        
    player iprintln("^7[^8NOTICE^7] ^8TT30 purchased (price: ^8"+300+"^7)");
        
    player mod\PLAYER::subMoney(300);
        
    player playsound("weap_pickup");
    }
    shopTT30(posdir)
    {
        
    gun mod\UTILS::spawnXmodel("xmodel/weapon_tt30"posdir-90);
        
    gun entityToWall(dir2);
        
    gun thread mod\TRIGGER::spawnUseTrigger(
            ::
    tt30_buy,
            
    game["shop_tt30_hunter"],
            
    game["shop_tt30_zombie"]
        );
        
    gun.trigger.origin += (0,0,-50);

    timescale 0.01

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

    kubislav23 (18th November 2018),vanfreddy (19th November 2018),voron00 (19th November 2018)

Posting Permissions

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