Results 1 to 6 of 6

Thread: Removing weapons out of a Map via script

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts

    Removing weapons out of a Map via script

    Hello,
    often you have that problem:
    You download nice maps, run zombie gametype or rifle and then there are weapons inside the map.
    To remove them out add a file named _rWeapons.gsc into the maps\mp\gametypes folder.

    Open the GAMETYPE.gsc (zom.gsc, tdm.gsc) and go to main()

    Add the following line:
    PHP Code:
    thread maps\mp\gametypes\_rWeapons::init(); 
    _rWeapons.gsc file:
    PHP Code:
    //This script is writen by Earliboy
    //You got full access to use this file and edit it.
    //If you have any questions, contact me at Xfire: earliboy or skype: earliboy
    //If you find any issues, please contact me!

    //Adding a new weapon:
    //rmWeapon("weapon_NAME_mp");
    //Example: rmWeapon("weapon_mp44_mp");

    //Add following line to your server.cfg
    //set scr_remove_weapons "1"
    //"1" = On (remove weapons) "0" = Off (don't remove weapons)

    init()
    {
        if(
    getCvar("scr_remove_weapons") == "")
            
    setCvar("scr_remove_weapons","1");
        
        
    level.rmWeapons getCvarInt("scr_remove_weapons");
        
        if(!
    level.rmWeapons)
            return;
        
        
    rmWeapon("weapon_greasegun_mp");
        
    rmWeapon("weapon_m1carbine_mp");
        
    rmWeapon("weapon_m1garand_mp");
        
    rmWeapon("weapon_springfield_mp");
        
    rmWeapon("weapon_thompson_mp");
        
    rmWeapon("weapon_bar_mp");
        
    rmWeapon("weapon_sten_mp");
        
    rmWeapon("weapon_enfield_mp");
        
    rmWeapon("weapon_enfield_scope_mp");
        
    rmWeapon("weapon_bren_mp");
        
    rmWeapon("weapon_PPS42_mp");
        
    rmWeapon("weapon_mosin_nagant_mp");
        
    rmWeapon("weapon_SVT40_mp");
        
    rmWeapon("weapon_mosin_nagant_sniper_mp");
        
    rmWeapon("weapon_ppsh_mp");
        
    rmWeapon("weapon_mp40_mp");
        
    rmWeapon("weapon_kar98k_mp");
        
    rmWeapon("weapon_g43_mp");
        
    rmWeapon("weapon_kar98k_sniper_mp");
        
    rmWeapon("weapon_mp44_mp");
        
    rmWeapon("weapon_shotgun_mp");
        
    rmWeapon("weapon_trenchgun_mp");
        
    rmWeapon("weapon_raygun_mp");
        
    rmWeapon("weapon_panzerschreck_mp");
        
    rmWeapon("weapon_panzerfaust_mp");
        
    rmWeapon("weapon_defaultweapon_mp");
        
    rmWeapon("weapon_chainsaw_mp");
        
    rmWeapon("weapon_flametrower_mp");
    }

    rmWeapon(ent)
    {
        
    ent getEntArray(ent"classname");
        
        if(!
    isDefined(ent))
            return;
        
        for(
    0ent.sizei++)
            
    ent[idelete();

    No ... No ... this is not possible .......

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

    EvoloZz (12th May 2013),kung foo man (12th May 2013)

Posting Permissions

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