• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GTA.Ped类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: TaskSequenceData

        public TaskSequenceData( Ped ped, TaskSequence taskSequence, bool isActive = true )
        {
            this.TaskSequence = taskSequence;
            this.Ped = ped;
            this.IsActive = isActive;

            this._actions = new Dictionary<int, List<Action>>();
            this._actionsEveryTick = new Dictionary<int, List<Action>>();
        }
开发者ID:IncoCode,项目名称:EngineOverheat-GTA5,代码行数:9,代码来源:TaskSequenceData.cs


示例17: preparePed

 public void preparePed(Ped ped)
 {
     if (ped.Exists())
     {
         ped.Invincible = true;
         ped.WillFlyThroughWindscreen = false;
         ped.PreventRagdoll = true;
     }
 }
开发者ID:andrefsantos,项目名称:gta-iv-multiplayer,代码行数:9,代码来源:Positioners.cs


示例18: GiveAllWeapons2

    public void GiveAllWeapons2(Ped ped)
    {
        ped.Weapons.RemoveAll();
        WeaponHash w = WeaponHash.StunGun;

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


示例19: PlayAnimation

 public static void PlayAnimation(Ped mPed, string animSet, string animName, float speed, int duration, [MarshalAs(UnmanagedType.U1)] bool lastAnimation, float playbackRate)
 {
     var inputArgumentArray1 = new InputArgument[1];
     InputArgument inputArgument1 = new InputArgument(animSet);
     inputArgumentArray1[0] = inputArgument1;
     Function.Call(Hash.REQUEST_ANIM_DICT, inputArgumentArray1);
     DateTime dateTime = DateTime.Now + new TimeSpan(0, 0, 0, 0, 1000);
     InputArgument[] inputArgumentArray2 = new InputArgument[1];
     InputArgument inputArgument2 = new InputArgument(animSet);
     inputArgumentArray2[0] = inputArgument2;
     if (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, inputArgumentArray2))
     {
         InputArgument[] inputArgumentArray3;
         do
         {
             Script.Yield();
             if (!(DateTime.Now >= dateTime))
             {
                 inputArgumentArray3 = new InputArgument[1];
                 InputArgument inputArgument3 = new InputArgument(animSet);
                 inputArgumentArray3[0] = inputArgument3;
             }
             else
                 goto label_4;
         }
         while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, inputArgumentArray3));
         goto label_3;
     label_4:
         return;
     }
     label_3:
     var inputArgumentArray4 = new InputArgument[11];
     var inputArgument4 = new InputArgument(mPed.Handle);
     inputArgumentArray4[0] = inputArgument4;
     var inputArgument5 = new InputArgument(animSet);
     inputArgumentArray4[1] = inputArgument5;
     var inputArgument6 = new InputArgument(animName);
     inputArgumentArray4[2] = inputArgument6;
     var inputArgument7 = new InputArgument(speed);
     inputArgumentArray4[3] = inputArgument7;
     var inputArgument8 = new InputArgument(-8.0f);
     inputArgumentArray4[4] = inputArgument8;
     var inputArgument9 = new InputArgument(duration);
     inputArgumentArray4[5] = inputArgument9;
     var inputArgument10 = new InputArgument(48);
     inputArgumentArray4[6] = inputArgument10;
     InputArgument inputArgument11 = new InputArgument(playbackRate);
     inputArgumentArray4[7] = inputArgument11;
     InputArgument inputArgument12 = new InputArgument(0);
     inputArgumentArray4[8] = inputArgument12;
     InputArgument inputArgument13 = new InputArgument(0);
     inputArgumentArray4[9] = inputArgument13;
     InputArgument inputArgument14 = new InputArgument(0);
     inputArgumentArray4[10] = inputArgument14;
     Function.Call(Hash.TASK_PLAY_ANIM, inputArgumentArray4);
 }
开发者ID:Guad,项目名称:gta5eyetracking,代码行数:56,代码来源:Util.cs


示例20: GetPedSeat

 public static int GetPedSeat(Ped ped)
 {
     if (ped == null || !ped.IsInVehicle()) return -3;
     if (ped.CurrentVehicle.GetPedOnSeat(VehicleSeat.Driver) == ped) return (int)VehicleSeat.Driver;
     for (int i = 0; i < ped.CurrentVehicle.PassengerSeats; i++) {
         if (ped.CurrentVehicle.GetPedOnSeat((VehicleSeat)i) == ped)
             return i;
     }
     return -3;
 }
开发者ID:westre,项目名称:Stroopwaffle,代码行数:10,代码来源:Utility.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Menu.MenuItem类代码示例发布时间:2022-05-26
下一篇:
C# Lists.ListInfo类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap