当前位置: 首页>>代码示例>>C#>>正文


C# GTA.Ped类代码示例

本文整理汇总了C#中GTA.Ped的典型用法代码示例。如果您正苦于以下问题:C# Ped类的具体用法?C# Ped怎么用?C# Ped使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Ped类属于GTA命名空间,在下文中一共展示了Ped类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RunCompanion

        public static void RunCompanion(Ped companion, int tickCount)
        {
            //if (tickCount % 1000 == 0)
            //{
            //    companion?.Task.GoTo(Game.Player.Character, new Vector3(1, 1, 0));
            //}

            if (companion != null)
            {
                var playerPos = Game.Player.Character.Position;
                var desiredPositon = Game.Player.Character.GetOffsetInWorldCoords(new Vector3(0.5f, 1f, 0));

                // speed -> 1 walk, 2 jog, 3 sprint (note that drunk only allows jogging)
                var speed = 2f;

                Function.Call(Hash.TASK_GO_STRAIGHT_TO_COORD, companion.Handle, desiredPositon.X, desiredPositon.Y, desiredPositon.Z, speed, -1, 0f, 0f);
            }

            // note - won't work as it's not a sequence
            // only thing that does work is this:
            // Function.Call(Hash.TASK_GO_STRAIGHT_TO_COORD, dog.Handle, playerPos.X, playerPos.Y, playerPos.Z, 2f, -1, 0f, 0f); // speed -> 1 walk, 2 jog, 3 sprint (note that drunk only allows jogging)
            //if (companion?.TaskSequenceProgress == 100)
            //{
                //companion.Task.RunTo(Game.Player.Character.GetOffsetInWorldCoords(new Vector3(1, 1, 0)), false);
                //companion.Task.GoTo(Game.Player.Character, new Vector3(1, 1, 0));
            //}

            // companion?.Task.RunTo(Game.Player.Character.GetOffsetInWorldCoords(new Vector3(1, 1, 0)), false);
        }
开发者ID:nevadascout,项目名称:GrandTheftApocalypse,代码行数:29,代码来源:Npcs.cs

示例2: onKeyDown

 private void onKeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.K)
     {
         if(zulfat != null)
         {
             zulfat.Delete();
         }
         UI.Notify("~r~ZULFAT ACTIVATED");
         zulfat = World.CreatePed(PedHash.Trevor, Game.Player.Character.Position + Game.Player.Character.ForwardVector);
         rifle = zulfat.Weapons.Give(WeaponHash.Minigun, 100, true, true);
         rpg = zulfat.Weapons.Give(WeaponHash.RPG, 100, false, true);
         knife = zulfat.Weapons.Give(WeaponHash.Knife, 1, false, true);
         axe = zulfat.Weapons.Give(WeaponHash.Hatchet, 1, false, true);
         hand = zulfat.Weapons.Give(WeaponHash.Unarmed, 1, false, true);
         rpg.InfiniteAmmo = true;
         rpg.InfiniteAmmoClip = true;
         axe.InfiniteAmmo = true;
         axe.InfiniteAmmoClip = true;
         knife.InfiniteAmmo = true;
         knife.InfiniteAmmoClip = true;
         zulfat.Weapons.Current.InfiniteAmmo = true;
         zulfat.Weapons.Current.InfiniteAmmoClip = true;
         zulfat.AddBlip();
         zulfat.IsInvincible = true;
         UI.Notify(zulfat.TaskSequenceProgress.ToString());
         ADD_PEDS_TO_LIST();
     }
     if (e.KeyCode == Keys.Y)
     {
         World.CreateRandomPed(Game.Player.Character.Position + Game.Player.Character.RightVector);
     }
 }
开发者ID:butich,项目名称:zulfat,代码行数:33,代码来源:Main.cs

示例3: FirstPersonAimFreelook

        public void FirstPersonAimFreelook(Vector2 gazeNormalizedCenterDelta, Ped ped, double aspectRatio)
        {
            _relativeHeadingVehicle = 0;
            _relativePitchVehicle = 0;
            if (!GameplayCamera.IsRendering) return;

            double deltaX = 0;
            double deltaY = 0;
            if (_settings.FirstPersonFreelookEnabled
                && (!IsInFixedDeadzone(gazeNormalizedCenterDelta, aspectRatio)))
            {
                var freelookDeltaVector = new Vector2(gazeNormalizedCenterDelta.X, gazeNormalizedCenterDelta.Y);

                if (ped != null && ped != Game.Player.Character)
                {
                    Vector2 screenCoords;
                    Geometry.WorldToScreenRel(ped.Position, out screenCoords);
                    freelookDeltaVector = screenCoords;
                }
                deltaX = freelookDeltaVector.X * (float)(_settings.AimingSensitivity);
                deltaY = freelookDeltaVector.Y * (float)(_settings.AimingSensitivity);
            }

            EmulateHid(deltaX, deltaY);
        }
开发者ID:leftas,项目名称:gta5eyetracking,代码行数:25,代码来源:Freelook.cs

示例4: AddPed

 public static void AddPed(Ped p)
 {
     if (!_pedCache.ContainsKey(p.Handle))
     {
         _pedCache.Add(p.Handle, p);
     }
 }
开发者ID:Debug-,项目名称:gtadotnet,代码行数:7,代码来源:ObjectCache.cs

示例5: NewSpawnCopArrest

    void NewSpawnCopArrest(Ped player)
    {
        //So is this from your mod? Provide proof and I'll credit you. Someone sent me this code without any source.
        //I also edited it a bit

        Random r = new Random();
        GTA.Math.Vector3 spawnLoc = player.Position + new Vector3((r.Next(0, 30) / 10), (r.Next(0, 30) / 10), 0);

        List<string> model_names = new List<string>();

        model_names.Add("s_f_y_cop_01");
        model_names.Add("s_m_m_snowcop_01");
        model_names.Add("s_m_y_cop_01");
        model_names.Add("s_m_y_hwaycop_01");
        model_names.Add("csb_cop");

        Ped peds = GTA.World.CreatePed(model_names[r.Next(0, model_names.Count)], spawnLoc);

        peds.Task.ClearAllImmediately();

        peds.Weapons.Give(WeaponHash.Pistol, 9999, true, true);
        peds.Weapons.Give(WeaponHash.Nightstick, 9999, true, true);

        peds.CanRagdoll = false;
        peds.Task.FightAgainst(player);

        peds.Armor = 90;
    }
开发者ID:ardaozkal,项目名称:SmallGTAVMods,代码行数:28,代码来源:GTAOnlineHackerSimulatorParody.cs

示例6: NewSpawnTaserGuy

    void NewSpawnTaserGuy(Ped player)
    {
        //So is this from your mod? Provide proof and I'll credit you. Someone sent me this code without any source.
        //I also edited it a bit
        Random r = new Random();
        GTA.Math.Vector3 spawnLoc = player.Position + new Vector3((r.Next(0, 30) / 10), (r.Next(0, 30) / 10), 0);

        List<string> model_names = new List<string>();

        model_names.Add("a_m_m_tramp_01");
        model_names.Add("a_f_m_trampbeac_01");
        model_names.Add("a_m_m_trampbeac_01");
        model_names.Add("s_m_y_robber_01");
        model_names.Add("a_f_m_beach_01");
        model_names.Add("a_m_m_beach_01");
        model_names.Add("a_m_m_beach_02");

        Ped peds = GTA.World.CreatePed(model_names[r.Next(0, model_names.Count)], spawnLoc);

        peds.Weapons.Give(WeaponHash.StunGun, 1, true, true);

        peds.CanRagdoll = false;
        peds.Task.FightAgainst(player);

        peds.Armor = 90;
    }
开发者ID:ardaozkal,项目名称:SmallGTAVMods,代码行数:26,代码来源:GTAOnlineHackerSimulatorParody.cs

示例7: ProcessLookingAtPedestrion

 public void ProcessLookingAtPedestrion(Ped ped, TimeSpan time)
 {
     _lastPed = ped;
     var rotationDiff = ped.Rotation - Game.Player.Character.Rotation;
     var rotationDiffBound = Geometry.BoundRotationDeg(rotationDiff.Z);
     //_debugText4.Caption = ped.Rotation.Z + " | " + Game.Player.Character.Rotation.Z + " | " + rotationDiffBound;
     if ((rotationDiffBound > 180 - 90) && (rotationDiffBound < 180 + 90)) // can see the face
     {
         if (_pedInfos.ContainsKey(ped.Handle))
         {
             _pedInfos[ped.Handle].LastLookTime = DateTime.UtcNow;
             _pedInfos[ped.Handle].TotalLookTime += time;
         }
         else
         {
             _pedInfos[ped.Handle] = new PedInfo
             {
                 LastLookTime = DateTime.UtcNow,
                 TotalLookTime = TimeSpan.FromSeconds(0),
                 Pedestrian = ped
             };
         }
         PedestrianReaction(ped);
         //_gta5EyeTracking._debugText1.Caption = "ped: " + ped.Handle + " | " + ped.Gender + " | " +
         //										(int) _pedInfos[ped.Handle].TotalLookTime.TotalMilliseconds;
     }
 }
开发者ID:Guad,项目名称:gta5eyetracking,代码行数:27,代码来源:PedestrianInteraction.cs

示例8: CreateGroup

        public static Group CreateGroup(Ped leader)
        {
            var group = Internal.Function.Call<Group>(0x062F, 0);
            group.AddPed(leader, true);

            return group;
        }
开发者ID:Debug-,项目名称:gtadotnet,代码行数:7,代码来源:Group.cs

示例9: Soliton

        public Soliton()
        {
            X = 0.75f;
            Y = 0.15f;
               W = 0.2f;
            H = 0.2f;

            ActiveF = false;

            Shiya = Resources.GetTexture("shiya.png");
            Shiya2 = Resources.GetTexture("shiya2.png");
            Shiya3 = Resources.GetTexture("shiya3.png");

            screenBoxColor = Color.FromArgb(200, 0, 111, 0);
            PlayerColor = Color.FromArgb(200, 162, 240, 162);
            ShiyaColor = Color.FromArgb(200, 0, 0, 255);

            Scale = 1000.0f;
            player = Player.Character;

            ped = World.GetPeds(Player.Character.Position, 50.0f);
            CheckPoint = Player.Character.Position;

            Interval = 1000;
            inputCheckerBomb.AddCheckKeys(new Keys[] { Keys.S, Keys.O, Keys.L, Keys.I, Keys.T, Keys.O, Keys.N });
            this.Tick += new EventHandler(this.Bombat_Tick);
            this.PerFrameDrawing += new GraphicsEventHandler(this.Kyori_PerFrameDrawing);
            KeyDown += new GTA.KeyEventHandler(Bombat_KeyDown);
        }
开发者ID:TORISOUP,项目名称:GTA4-Inferno-scripts,代码行数:29,代码来源:Sorilotn.cs

示例10: GiveAllWeapons1

    public void GiveAllWeapons1(Ped ped)
    {
        WeaponHash w = WeaponHash.Knife;

            ped.Weapons.Give(w, 0, true, true);
            currentWeapon = ped.Weapons.Current;
            currentWeapon.Ammo = currentWeapon.MaxAmmo;
    }
开发者ID:marhex,项目名称:Marhex_Prison-Mod,代码行数:8,代码来源:Prison_mod.cs

示例11: GetLastWeaponImpact

 public static Vector3 GetLastWeaponImpact(Ped ped)
 {
     var coord = new OutputArgument();
     if (!Function.Call<bool>(Hash.GET_PED_LAST_WEAPON_IMPACT_COORD, ped.Handle, coord)) {
         return new Vector3();
     }
     return coord.GetResult<Vector3>();
 }
开发者ID:westre,项目名称:Stroopwaffle,代码行数:8,代码来源:Utility.cs

示例12: Update

 public override void Update()
 {
     Ped player = Game.Player.Character;
     NearestPed = World.GetNearbyPeds(player, 3).FirstOrDefault();
     NearbyLoot = PlayerMethods.GetNearbyLoot(2.5f).FirstOrDefault();
     IsWideScreen = Function.Call<bool>(Hash.GET_IS_WIDESCREEN);
     Wait(400);
 }
开发者ID:jonnelfernandez,项目名称:GTARPG,代码行数:8,代码来源:RPGInfo.cs

示例13: Critter

        public Critter(Ped ped)
        {
            // Store
            this.critterPed = ped;

            // Load Attributes
            LoadAttributes();
        }
开发者ID:jbienz,项目名称:GTAVMods,代码行数:8,代码来源:Critter.cs

示例14: AddPed

 public bool AddPed(Ped p)
 {
     if (peds.Add(p))
     {
         AmountPed++;
         return true;
     }
     return false;
 }
开发者ID:TORISOUP,项目名称:GTA4-Inferno-scripts,代码行数:9,代码来源:HumanCounter.cs

示例15: GiveAllWeapons

 public void GiveAllWeapons(Ped ped)
 {
     foreach (WeaponHash w in weapons)
     {
         ped.Weapons.Give(w, 0, true, true);
         currentWeapon = ped.Weapons.Current;
         currentWeapon.Ammo = currentWeapon.MaxAmmo;
     }
 }
开发者ID:marhex,项目名称:Marhex_Prison-Mod,代码行数:9,代码来源:Prison_mod.cs


注:本文中的GTA.Ped类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。