예제 #1
0
        private void InitializeServerDvars()
        {
            GSCFunctions.SetDvar("scr_game_playerwaittime", (Parameter)0.1);    //Only for development purposes so we can get the f**k started
            GSCFunctions.SetDvar("scr_game_matchstarttime", (Parameter)5);

            GSCFunctions.SetDvar("com_maxfps", 0);
            //Server netcode adjustments//
            GSCFunctions.SetDvar("com_maxfps", 0);
            //-IW5 server update rate-
            GSCFunctions.SetDevDvar("sv_network_fps", 200);
            //-Setup larger snapshot size and remove/lower delay-
            GSCFunctions.SetDvar("sv_hugeSnapshotSize", 10000);
            GSCFunctions.SetDvar("sv_hugeSnapshotDelay", 100);
            //-Remove ping degradation-
            GSCFunctions.SetDvar("sv_pingDegradation", 0);
            GSCFunctions.SetDvar("sv_pingDegradationLimit", 9999);
            //-Teak ping throttle-
            GSCFunctions.SetDvar("sv_acceptableRateThrottle", 9999);
            GSCFunctions.SetDvar("sv_newRateThrottling", 2);
            //-Tweak ping clamps-
            GSCFunctions.SetDvar("sv_minPingClamp", 50);
            //-Increase server think rate per frame-
            GSCFunctions.SetDvar("sv_cumulThinkTime", 1000);
            //End server netcode//

            //EXPERIMENTALS
            //-Lock CPU threads-
            GSCFunctions.SetDvar("sys_lockThreads", "all");
            //-Prevent game from attempting to slow time for frames-
            GSCFunctions.SetDvar("com_maxFrameTime", 1000);
            GSCFunctions.SetDvar("cg_drawCrosshair", 1);
            GSCFunctions.SetDvar("cl_demo_enabled", 0);
            GSCFunctions.SetDvar("cl_demo_recordPrivateMatches", 0);
            GSCFunctions.SetDvar("sv_voiceQuality", 9);
            GSCFunctions.SetDvar("maxVoicePacketsPerSec", 1000);
            GSCFunctions.SetDvar("maxVoicePacketsPerSecForServer", 200);
            GSCFunctions.SetDvar("cg_everyoneHearsEveryone", 1);
        }
예제 #2
0
        public Class1()
        {
            Utilities.PrintToConsole(string.Format("Plugin loaded at {0}", GSCFunctions.GetTime()));
            //GSCFunctions.PreCacheString("Test String");
            //GSCFunctions.PreCacheStatusIcon("cardicon_iwlogo");
            //GSCFunctions.PreCacheMenu("kickplayer");
            //GSCFunctions.PreCacheMenu("elevator_floor_selector");
            //GSCFunctions.PreCacheShader("faction_128_gign");

            //Marshal.WriteInt32(new IntPtr(0x0585AE0C), 24);
            //Marshal.WriteInt32(new IntPtr(0x0585AE1C), 24);

            //working guns
            GSCFunctions.PreCacheItem("at4_mp");
            GSCFunctions.PreCacheItem("airdrop_mega_marker_mp");
            GSCFunctions.PreCacheItem("throwingknife_rhand_mp");
            GSCFunctions.PreCacheItem("iw5_mk12spr_mp");
            GSCFunctions.PreCacheItem("lightstick_mp");
            GSCFunctions.PreCacheItem("killstreak_double_uav_mp");
            GSCFunctions.PreCacheItem("strike_marker_mp");
            GSCFunctions.PreCacheItem("killstreak_helicopter_minigun_mp");
            GSCFunctions.PreCacheItem("airdrop_juggernaut_def_mp");
            GSCFunctions.PreCacheItem("uav_strike_missile_mp");
            GSCFunctions.PreCacheItem("uav_strike_projectile_mp");
            GSCFunctions.PreCacheItem("iw5_xm25_mp");
            GSCFunctions.PreCacheItem("iw5_riotshield_mp");
            GSCFunctions.PreCacheItem("harrier_missile_mp");

            //turret-only
            GSCFunctions.PreCacheTurret("manned_minigun_turret_mp");
            GSCFunctions.PreCacheTurret("manned_gl_turret_mp");
            GSCFunctions.PreCacheItem("remote_uav_weapon_mp");
            GSCFunctions.PreCacheItem("aamissile_projectile_mp");

            //Hacking in all fx
            //smoke

            /*
             * string[] smoke_fx;
             * smoke_fx = Directory.GetFiles(@"H:\USBFORMAT\MW3 GSCs\devraw\fx\smoke");
             * for (int i = 0; i < smoke_fx.Length; i++)
             * {
             *  GSCFunctions.LoadFX("smoke/" + smoke_fx[i].Split('\\')[6].Replace(".FXE", ""));
             * }
             * string[] prop_fx;
             * prop_fx = Directory.GetFiles(@"H:\USBFORMAT\MW3 GSCs\devraw\fx\props");
             * for (int i = 0; i < prop_fx.Length; i++)
             * {
             *  GSCFunctions.LoadFX("props/" + prop_fx[i].Split('\\')[6].Replace(".FXE", ""));
             * }
             * string[] dust_fx;
             * dust_fx = Directory.GetFiles(@"H:\USBFORMAT\MW3 GSCs\devraw\fx\dust");
             * for (int i = 0; i < dust_fx.Length; i++)
             * {
             *  GSCFunctions.LoadFX("dust/" + dust_fx[i].Split('\\')[6].Replace(".FXE", ""));
             * }
             * string[] exp_fx;
             * exp_fx = Directory.GetFiles(@"H:\USBFORMAT\MW3 GSCs\devraw\fx\explosions");
             * for (int i = 0; i < exp_fx.Length; i++)
             * {
             *  GSCFunctions.LoadFX("explosions/" + exp_fx[i].Split('\\')[6].Replace(".FXE", ""));
             * }
             * string[] impact_fx;
             * impact_fx = Directory.GetFiles(@"H:\USBFORMAT\MW3 GSCs\devraw\fx\impacts");
             * for (int i = 0; i < 100; i++)
             * {
             *  GSCFunctions.LoadFX("impacts/" + impact_fx[i].Split('\\')[6].Replace(".FXE", ""));
             * }
             * string[] shellejects_fx;
             * shellejects_fx = Directory.GetFiles(@"H:\USBFORMAT\MW3 GSCs\devraw\fx\shellejects");
             * for (int i = 0; i < shellejects_fx.Length; i++)
             * {
             *  GSCFunctions.LoadFX("shellejects/" + shellejects_fx[i].Split('\\')[6].Replace(".FXE", ""));
             * }
             * string[] fire_fx;
             * fire_fx = Directory.GetFiles(@"H:\USBFORMAT\MW3 GSCs\devraw\fx\fire");
             * for (int i = 0; i < fire_fx.Length; i++)
             * {
             *  GSCFunctions.LoadFX("fire/" + fire_fx[i].Split('\\')[6].Replace(".FXE", ""));
             * }
             */
            GSCFunctions.LoadFX("fire/jet_afterburner_harrier");
            GSCFunctions.LoadFX("smoke/jet_contrail");
            GSCFunctions.LoadFX("misc/aircraft_light_red_blink");
            GSCFunctions.LoadFX("misc/aircraft_light_wingtip_red");
            GSCFunctions.LoadFX("misc/aircraft_light_wingtip_green");

            _airdropCollision = GSCFunctions.GetEnt("care_package", "targetname");
            _airdropCollision = GSCFunctions.GetEnt(_airdropCollision.Target, "targetname");

            GSCFunctions.PreCacheMpAnim("viewmodel_airdrop_marker_sprint_loop");
            //GSCFunctions.PreCacheMpAnim("viewmodel_claymore_idle");

            string[] testAnims = new string[] { "pb_crouch_grenade_idle",
                                                "pb_crouch_stickgrenade_idle",
                                                "pb_crouch_grenade_pullpin",
                                                "pb_crouch_alert",
                                                "pb_crouch_ads",
                                                "pb_crouch_alert_pistol",
                                                "pb_crouch_ads_pistol",
                                                "pb_crouch_alert_unarmed",
                                                "pb_crouch_alert_akimbo",
                                                "pb_crouch_alert_shield",
                                                "pb_chicken_dance",
                                                "pb_chicken_dance_crouch",
                                                "pb_crouch_bombplant",
                                                "pb_crouch_remotecontroller",
                                                "pb_hold_idle",
                                                "pb_crouch_hold_idle",
                                                "pb_crouch_alert_RPG",
                                                "pb_crouch_ads_RPG" };

            //foreach (string anim in testAnims)
            //GSCFunctions.PreCacheMpAnim(anim);

            fx_eyes = GSCFunctions.LoadFX("misc/aircraft_light_wingtip_red");

            PlayerConnected += OnPlayerConnected;

            //GSCFunctions.SetDvar("scr_diehard", 2);
            GSCFunctions.SetDevDvar("developer", 2);
            GSCFunctions.SetDevDvar("developer_script", 1);
            GSCFunctions.SetDvarIfUninitialized("scr_showNotifyMessages", 1);
            GSCFunctions.SetDvar("scr_game_playerwaittime", 0);
            GSCFunctions.SetDvar("scr_game_matchstarttime", 0);

            Notified += new Action <int, string, Parameter[]>((ent, message, parameters) =>
            {
                //if (message == "trigger") return;
                if (GSCFunctions.GetDvarInt("scr_showNotifyMessages") == 0)
                {
                    return;
                }
                if (parameters.Length > 0)
                {
                    foreach (string p in parameters)
                    {
                        Utilities.PrintToConsole(ent.ToString() + ": " + message + ":" + p);
                    }
                }
                else
                {
                    Utilities.PrintToConsole(string.Format("{0} Notified " + message, ent));
                }
            });

            level = Entity.GetEntity(2046);

            /*
             * GSCFunctions.SetSunlight(new Vector3(0, 0, 1));
             * GSCFunctions.VisionSetNaked("cobra_sunset3");
             * for (int i = 18; i < 2000; i++)
             * {
             *  Entity ent = GSCFunctions.GetEntByNum(i);
             *  if (ent == null) continue;
             *  string entModel = ent.Model;
             *
             *  if (entModel == "vehicle_hummer_destructible")
             *      ent.SetModel("com_satellite_dish_big");
             *  else if (ent.TargetName == "explodable_barrel")
             *  {
             *      Entity col = GSCFunctions.GetEnt(ent.Target, "targetname");
             *      if (col != null) col.Delete();
             *      ent.Delete();
             *  }
             *  else if (ent.TargetName == "animated_model")
             *  {
             *      ent.ScriptModelClearAnim();
             *      ent.Delete();
             *      Entity placeholder = GSCFunctions.Spawn("script_model", Vector3.Zero);
             *  }
             * }
             */
            //StartAsync(testFunc());
            //StartAsync(dumpHud());
        }