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


C# Ped.IsInVehicle方法代码示例

本文整理汇总了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;
 }
开发者ID:westre,项目名称:Stroopwaffle,代码行数:10,代码来源:Utility.cs

示例2: Teleport

 public static void Teleport(Ped ped)
 {
     if (ped.IsInVehicle() == true)
     {
         ped.CurrentVehicle.Position = Location;
     }
     else
     {
         ped.Position = Location;
     }
 }
开发者ID:TylerEspo,项目名称:SetPoint,代码行数:11,代码来源:SetPoint.cs

示例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;
 }
开发者ID:butich,项目名称:zulfat,代码行数:48,代码来源:Main.cs

示例4: Unfreeze

 void Unfreeze(Ped playa)
 {
     playa.FreezePosition = false;
     if (playa.IsInVehicle())
     {
         playa.CurrentVehicle.FreezePosition = false;
     }
 }
开发者ID:ardaozkal,项目名称:YoloNet-GTAV,代码行数:8,代码来源:yolonet.cs

示例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);
     }
 }
开发者ID:ardaozkal,项目名称:YoloNet-GTAV,代码行数:11,代码来源:yolonet.cs

示例6: Telep

 private void Telep(Ped playa, Vector3 loc)
 {
     if (playa.IsInVehicle())
     {
         playa.CurrentVehicle.Position = loc;
     }
     else
     {
         playa.Position = loc;
     }
 }
开发者ID:ardaozkal,项目名称:YoloNet-GTAV,代码行数:11,代码来源:yolonet.cs

示例7: Freeze

 void Freeze(Ped playa)
 {
     playa.FreezePosition = true;
     if (playa.IsInVehicle())
     {
         playa.CurrentVehicle.FreezePosition = true;
     }
 }
开发者ID:ardaozkal,项目名称:YoloNet-GTAV,代码行数:8,代码来源:yolonet.cs

示例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()));
    }
开发者ID:ardaozkal,项目名称:YoloNet-GTAV,代码行数:27,代码来源:yolonet.cs


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