本文整理汇总了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;
}