本文整理汇总了C#中GTA.Ped.IsInVehicle方法的典型用法代码示例。如果您正苦于以下问题:C# Ped.IsInVehicle方法的具体用法?C# Ped.IsInVehicle怎么用?C# Ped.IsInVehicle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GTA.Ped
的用法示例。
在下文中一共展示了Ped.IsInVehicle方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: Teleport
public static void Teleport(Ped ped)
{
if (ped.IsInVehicle() == true)
{
ped.CurrentVehicle.Position = Location;
}
else
{
ped.Position = Location;
}
}
示例3: KillPedRifle
public void KillPedRifle(Ped ped)
{
killingPed = ped;
isKilling = true;
UI.Notify("Killing");
zulfat.Weapons.Select(rifle);
zulfat.Task.RunTo(ped.Position);
UI.Notify(zulfat.TaskSequenceProgress.ToString());
while(zulfat.Position.DistanceTo(ped.Position) > 40f && ped.Position.DistanceTo(zulfat.Position) < 60f)
{
UI.ShowSubtitle(zulfat.TaskSequenceProgress.ToString() + " PedCount: " + peds.Count.ToString() + " IsKilling: " + isKilling.ToString() + " NoOne: " + noOneKill.ToString());
Wait(0);
}
if (ped.Position.DistanceTo(zulfat.Position) < 60f)
{
if (!ped.IsInVehicle())
zulfat.Weapons.Select(rifle);
else
zulfat.Weapons.Select(rpg);
zulfat.Task.ShootAt(ped, 10000, FiringPattern.FullAuto);
}
zulfat.Task.ClearAll();
while (!ped.IsDead && ped.Position.DistanceTo(zulfat.Position) < 60f)
{
UI.ShowSubtitle(zulfat.TaskSequenceProgress.ToString() + " PedCount: " + peds.Count.ToString() + " IsKilling: " + isKilling.ToString() + " NoOne: " + noOneKill.ToString());
if (isKilling && killingPed != null)
{
if (World.Raycast(zulfat.Position, killingPed.Position, IntersectOptions.Everything).HitCoords.DistanceTo(killingPed.Position) > 7f)
{
Wait(50);
Run();
}
else
{
if (!zulfat.IsShooting)
{
zulfat.Task.ShootAt(ped, 10000, FiringPattern.FullAuto);
}
}
}
Wait(0);
}
zulfat.Task.ClearAll();
peds = new List<Ped>();
ADD_PEDS_TO_LIST();
killingPed = null;
isKilling = false;
}
示例4: Unfreeze
void Unfreeze(Ped playa)
{
playa.FreezePosition = false;
if (playa.IsInVehicle())
{
playa.CurrentVehicle.FreezePosition = false;
}
}
示例5: tptony
void tptony(Ped name)
{
if (name.IsInVehicle())
{
name.CurrentVehicle.Position = new Vector3(3360.19f, -4849.67f, 111.8f);
}
else
{
name.Position = new Vector3(3360.19f, -4849.67f, 111.8f);
}
}
示例6: Telep
private void Telep(Ped playa, Vector3 loc)
{
if (playa.IsInVehicle())
{
playa.CurrentVehicle.Position = loc;
}
else
{
playa.Position = loc;
}
}
示例7: Freeze
void Freeze(Ped playa)
{
playa.FreezePosition = true;
if (playa.IsInVehicle())
{
playa.CurrentVehicle.FreezePosition = true;
}
}
示例8: editonlineplayers
void editonlineplayers(Ped playa)
{
var menuItems = new List<IMenuItem>();
var button = new MenuButton(("Tp me to " + ((playa.Gender == Gender.Female) ? "her" : "him")), "");
button.Activated += (sender, args) => this.Telep(playa.Position);
menuItems.Add(button);
button = new MenuButton(("Tp " + ((playa.Gender == Gender.Female) ? "her" : "him") + " to me"), "");
button.Activated += (sender, args) => this.Telep(playa.Position);
menuItems.Add(button);
button = new MenuButton(("Frame " + ((playa.Gender == Gender.Female) ? "her" : "him")), "Go to weapon menu to activate");
button.Activated += (sender, args) => this.frammeeee(playa);
menuItems.Add(button);
if (playa.IsInVehicle())
{
button = new MenuButton("Open vehicle menu", "");
button.Activated += (sender, args) => this.OpenVehicleMenu(playa.CurrentVehicle);
menuItems.Add(button);
}
//TODO: Color pick menu. Enum to foreach + skip code.
this.View.AddMenu(new Menu("Player Menu", menuItems.ToArray()));
}