Example #1
0
    void Start()
    {
        //Load arrays
        max_ammo = new int[]
        {
            1,
            170,
            36,
            50,
            240,
            300,
            100,
            150,
            100,
            50
        };

        clip_ammo = new int[]
        {
            1,
            17,
            6,
            8,
            30,
            50,
            20,
            50,
            50,
            2
        };

        fire_reset = new float[]
        {
            0.1f,
            0.10f,
            0.15f,
            0.15f,
            0.02f,
            0.02f,
            0.2f,
            0.05f,
            0.05f,
            0.2f
        };

        fire_delay = new float[]
        {
            0.15f,
            0.15f,
            0.3f,
            0.35f,
            0.027f,
            0.027f,
            0.3f,
            0.027f,
            0.027f,
            0.3f
        };

        reload_delay = new float[]
        {
            1.5f,
            1.0f,
            2.5f,
            1.5f,
            1.5f,
            1.5f,
            1.5f,
            2.0f,
            2.0f,
            1.5f
        };

        damage = new int[, ]
        {
            { 75, 150 },
            { 10, 20 },
            { 50, 70 },
            { 80, 150 },
            { 10, 25 },
            { 5, 15 },
            { 50, 150 },
            { 10, 25 },
            { 10, 15 },
            { 80, 120 }
        };

        isauto = new bool[]
        {
            false,
            false,
            false,
            false,
            true,
            true,
            false,
            true,
            true,
            false
        };
        //Load arrays end
        audiosrc   = transform.root.gameObject;
        controller = audiosrc.GetComponent <MainScript>();
        weaponid   = 6;
        altshotgun = CFGLoader.altshotgun;
        autoswitch = CFGLoader.autoswitch;
        if (altshotgun)
        {
            weapon[3].renderer.materials[1].mainTexture = mosberg_sg;
        }
        auto_reload = CFGLoader.auto_reload;
        weapon[weaponid].renderer.enabled = true;
        for (int i = 0; i < mammo.Length; i++)
        {
            mammo[i]   = max_ammo[i];
            cammo[i]   = clip_ammo[i];
            normal_pos = wp_pivot.localPosition;
            shoot_pos  = normal_pos - new Vector3(0, 0, 0.1f);
            reload_pos = normal_pos - new Vector3(0, 0.3f, 0);
        }
        Transform temp = GameObject.Find("HudWeapon").transform;

        gui_ammo = temp.Find("HudAmmo").GetComponent <HudAmmo>();
        gui_ammo.GetComponent <HudAmmo>().enabled = true;
        gui_cammo      = temp.Find("HudCAmmo").guiText;
        gui_mammo      = temp.Find("HudMAmmo").guiText;
        gui_cammo.text = cammo[weaponid].ToString("00");
        gui_mammo.text = mammo[weaponid].ToString("000");
        temp           = null;
        if (spec == 1)
        {
            OldSchool();
        }
        else if (spec == 2)
        {
            InstagibMod();
        }
        else if (spec == 3)
        {
            FilterWeapons(tmp);
        }
    }