本文整理汇总了C#中Vehicle.Exists方法的典型用法代码示例。如果您正苦于以下问题:C# Vehicle.Exists方法的具体用法?C# Vehicle.Exists怎么用?C# Vehicle.Exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vehicle
的用法示例。
在下文中一共展示了Vehicle.Exists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnBeforeCalloutDisplayed
private LHandle pursuit; // an API pursuit handle
/// <summary>
/// OnBeforeCalloutDisplayed is where we create a blip for the user to see where the pursuit is happening, we initiliaize any variables above and set
/// the callout message and position for the API to display
/// </summary>
/// <returns></returns>
public override bool OnBeforeCalloutDisplayed()
{
//Set our spawn point to be on a street around 300f (distance) away from the player.
SpawnPoint = World.GetNextPositionOnStreet(Game.LocalPlayer.Character.Position.Around(300f));
//Create our ped in the world
myPed = new Ped("a_m_y_mexthug_01", SpawnPoint, 0f);
//Create the vehicle for our ped
myVehicle = new Vehicle("DUKES2", SpawnPoint);
//Now we have spawned them, check they actually exist and if not return false (preventing the callout from being accepted and aborting it)
if (!myPed.Exists()) return false;
if (!myVehicle.Exists()) return false;
//If we made it this far both exist so let's warp the ped into the driver seat
myPed.WarpIntoVehicle(myVehicle, -1);
// Show the user where the pursuit is about to happen and block very close peds.
this.ShowCalloutAreaBlipBeforeAccepting(SpawnPoint, 15f);
this.AddMinimumDistanceCheck(5f, myPed.Position);
// Set up our callout message and location
this.CalloutMessage = "Example Callout Message";
this.CalloutPosition = SpawnPoint;
//Play the police scanner audio for this callout (available as of the 0.2a API)
Functions.PlayScannerAudioUsingPosition("CITIZENS_REPORT CRIME_RESIST_ARREST IN_OR_ON_POSITION", SpawnPoint);
return base.OnBeforeCalloutDisplayed();
}
示例2: TpIntoVehicle
private void TpIntoVehicle(Vehicle veh)
{
if (veh.Exists())
{
if (veh.IsSeatFree(VehicleSeat.Driver))
{
Game.Player.Character.SetIntoVehicle(veh, VehicleSeat.Driver);
}
else
{
Game.Player.Character.SetIntoVehicle(veh, VehicleSeat.Any);
}
}
}
示例3: TpVehicleToMe
private void TpVehicleToMe(Vehicle veh)
{
if (veh.Exists())
{
if (Game.Player.Character.IsInVehicle())
{
Game.Player.Character.CurrentVehicle.Position += tpfactor;
veh.Position = (Game.Player.Character.CurrentVehicle.Position - tpfactor);
}
else
{
Game.Player.Character.Position += tpfactor;
veh.Position = (Game.Player.Character.Position - tpfactor);
}
}
}
示例4: ExplodeVehicle
private void ExplodeVehicle(Vehicle veh)
{
if (veh.Exists())
{
World.AddExplosion(veh.Position, ExplosionType.BigExplosion1, 10f, 1f);
//veh.Explode();
}
}