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


C# Ped.ChangeRelationship方法代码示例

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


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

示例1: AddToGroup

        private bool AddToGroup(Ped p)
        {
            if (!Exists(p)) return false; // check if the ped is valid
            Player.Group.AddMember(p);
            p.CurrentRoom = Player.Character.CurrentRoom; // required, or ped won't be visible when spawned inside a building
            p.WillDoDrivebys = true;
            p.PriorityTargetForEnemies = true;
            p.DuckWhenAimedAtByGroupMember = false;
            p.AlwaysDiesOnLowHealth = true;
            p.SetPathfinding(true, true, true);
            p.CanSwitchWeapons = true;
             //   p.isRequiredForMission = false;
            p.Money = 500;
            p.Health = 300;
            p.Invincible = false;
            p.Weapons.Uzi.Ammo = 30000;
            switch (rnd.Next(6))
            {
                case 0:
                    p.Weapons.MP5.Ammo = 30000;
                    p.Weapons.Select(Weapon.SMG_MP5);
                    break;
                case 1:
                    p.Weapons.AssaultRifle_M4.Ammo = 30000;
                    p.Weapons.Select(Weapon.Rifle_M4);
                    break;
                case 2:
                    p.Weapons.RocketLauncher.Ammo = 30000;
                    p.Weapons.Select(Weapon.Heavy_RocketLauncher);
                    break;
                case 3:
                    p.Weapons.MolotovCocktails.Ammo = 30000;
                    p.Weapons.Select(Weapon.Thrown_Molotov);
                    break;
                case 4:
                    p.Weapons.DesertEagle.Ammo = 30000;
                    p.Weapons.Select(Weapon.Handgun_DesertEagle);
                    break;
                case 5:
                    p.Weapons.RocketLauncher.Ammo = 30000;
                    p.Weapons.Select(Weapon.Heavy_RocketLauncher);
                    break;

                default:

                    p.Weapons.BaseballBat.Ammo = 2000;
                    p.Weapons.Select(Weapon.Melee_BaseballBat);
                    break;

            }
            p.RelationshipGroup = RelationshipGroup.Player;
            p.ChangeRelationship(RelationshipGroup.Player, Relationship.Companion);
            p.CantBeDamagedByRelationshipGroup(RelationshipGroup.Player, true);
            p.DuckWhenAimedAtByGroupMember = true;

            Blip B = p.AttachBlip();
            B.Color = BlipColor.Green;
            AddG(p);

            Game.DisplayText(index+"");

            return true;
        }
开发者ID:TORISOUP,项目名称:GTA4-Inferno-scripts,代码行数:63,代码来源:Fluton.cs


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