Class World
Inherited Members
Namespace: GTA
Assembly: ScriptHookVDotNet3.dll
Syntax
public static class World
Properties
| Improve this Doc View SourceAnimatedBuildingCapacity
The total number of AnimatedBuildings that can exist in the world.
Declaration
public static int AnimatedBuildingCapacity { get; }
Property Value
Type | Description |
---|---|
Int32 |
AnimatedBuildingCount
A fast way to get the total number of AnimatedBuildings spawned in the world.
Declaration
public static int AnimatedBuildingCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Blackout
Sets a value indicating whether lights in the World should be rendered.
Declaration
public static bool Blackout { set; }
Property Value
Type | Description |
---|---|
Boolean | true if blackout; otherwise, false. |
BuildingCapacity
The total number of Buildings that can exist in the world.
Declaration
public static int BuildingCapacity { get; }
Property Value
Type | Description |
---|---|
Int32 |
BuildingCount
A fast way to get the total number of Buildings spawned in the world.
Declaration
public static int BuildingCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
CurrentDate
Gets or sets the current date and time in the GTA World.
Declaration
public static DateTime CurrentDate { get; set; }
Property Value
Type | Description |
---|---|
DateTime | The current date and time. |
CurrentTimeOfDay
Gets or sets the current time of day in the GTA World.
Declaration
public static TimeSpan CurrentTimeOfDay { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan | The current time of day |
EntityColliderCapacity
The total number of Entity colliders can be used. The return value can be different in different versions.
When EntityColliderCount reaches this value, no more Entity will not be able to be physically moved and Vehicles and Props will not be able to detach fragment parts properly.
Declaration
public static int EntityColliderCapacity { get; }
Property Value
Type | Description |
---|---|
Int32 |
EntityColliderCount
Returns the total number of Entity colliders used.
Declaration
public static int EntityColliderCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
GravityLevel
Sets the gravity level for all World objects.
Declaration
public static float GravityLevel { get; set; }
Property Value
Type | Description |
---|---|
Single | The gravity level: 9.8f - Default gravity. 2.4f - Moon gravity. 0.1f - Very low gravity. 0.0f - No gravity. |
InteriorInstanceCapacity
The total number of InteriorInstances that can exist in the world.
Declaration
public static int InteriorInstanceCapacity { get; }
Property Value
Type | Description |
---|---|
Int32 |
InteriorInstanceCount
A fast way to get the total number of InteriorInstances spawned in the world.
Declaration
public static int InteriorInstanceCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
InteriorProxyCapacity
The total number of InteriorProxys the game can manage at the same time in the InteriorProxy pool.
Declaration
public static int InteriorProxyCapacity { get; }
Property Value
Type | Description |
---|---|
Int32 |
InteriorProxyCount
A fast way to get the total number of InteriorProxys managed in the InteriorProxy pool.
Declaration
public static int InteriorProxyCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
IsClockPaused
Gets or sets a value indicating whether the in-game clock is paused.
Declaration
public static bool IsClockPaused { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
MillisecondsPerGameMinute
Gets or sets how many milliseconds in the real world one game minute takes.
Declaration
public static int MillisecondsPerGameMinute { get; set; }
Property Value
Type | Description |
---|---|
Int32 | The milliseconds one game minute takes in the real world. |
NextWeather
Gets or sets the next weather.
Declaration
public static Weather NextWeather { get; set; }
Property Value
Type | Description |
---|---|
Weather | The next weather. |
PedCapacity
The total number of Peds that can exist in the world.
Declaration
public static int PedCapacity { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
The game will crash when the number of Ped is the same as this limit and the game tries to create a Ped.
PedCount
A fast way to get the total number of Peds spawned in the world.
Declaration
public static int PedCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
PickupObjectCapacity
Declaration
public static int PickupObjectCapacity { get; }
Property Value
Type | Description |
---|---|
Int32 |
PickupObjectCount
Declaration
public static int PickupObjectCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
ProjectileCapacity
The total number of Projectiles that can exist in the world. Always returns 50 currently since the limit is hard-coded in the exe.
Declaration
public static int ProjectileCapacity { get; }
Property Value
Type | Description |
---|---|
Int32 |
ProjectileCount
A fast way to get the total number of Projectiles spawned in the world.
Declaration
public static int ProjectileCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
PropCapacity
The total number of Props that can exist in the world.
Declaration
public static int PropCapacity { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
The game will crash when the number of Prop is the same as this limit and the game tries to create a Prop.
PropCount
A fast way to get the total number of Props spawned in the world.
Declaration
public static int PropCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
RenderingCamera
Gets or sets the rendering camera.
Declaration
public static Camera RenderingCamera { get; set; }
Property Value
Type | Description |
---|---|
Camera | The rendering Camera. |
Remarks
Setting to null sets the rendering Camera to GameplayCamera.
VehicleCapacity
The total number of Vehicles that can exist in the world.
Declaration
public static int VehicleCapacity { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
The game will crash when the number of Vehicle is the same as this limit and the game tries to create a Vehicle.
VehicleCount
A fast way to get the total number of Vehicles spawned in the world.
Declaration
public static int VehicleCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
WaypointBlip
Gets the waypoint blip.
Declaration
public static Blip WaypointBlip { get; }
Property Value
Type | Description |
---|---|
Blip |
Remarks
Returns null if a waypoint Blip hasn't been set
WaypointPosition
Gets or sets the waypoint position.
Declaration
public static Vector3 WaypointPosition { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Remarks
Returns an empty Vector3 if a waypoint Blip hasn't been set If the game engine cant extract height information the Z component will be 0.0f
Weather
Gets or sets the weather.
Declaration
public static Weather Weather { get; set; }
Property Value
Type | Description |
---|---|
Weather | The weather. |
Methods
| Improve this Doc View SourceAddExplosion(Vector3, ExplosionType, Single, Single, Ped, Boolean, Boolean)
Creates an explosion in the world
Declaration
public static void AddExplosion(Vector3 position, ExplosionType type, float radius, float cameraShake, Ped owner = null, bool aubidble = true, bool invisible = false)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position of the explosion. |
ExplosionType | type | The type of explosion. |
Single | radius | The radius of the explosion. |
Single | cameraShake | The amount of camera shake to apply to nearby cameras. |
Ped | owner | The Ped who caused the explosion, leave null if no one caused the explosion. |
Boolean | aubidble | if set to true explosion can be heard. |
Boolean | invisible | if set to true explosion is invisible. |
AddRelationshipGroup(String)
Creates a RelationshipGroup with the given name.
Declaration
public static RelationshipGroup AddRelationshipGroup(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the relationship group. |
Returns
Type | Description |
---|---|
RelationshipGroup |
AddRope(RopeType, Vector3, Vector3, Single, Single, Boolean)
Spawns a Rope.
Declaration
public static Rope AddRope(RopeType type, Vector3 position, Vector3 rotation, float length, float minLength, bool breakable)
Parameters
Type | Name | Description |
---|---|---|
RopeType | type | The type of Rope. |
Vector3 | position | The position of the Rope. |
Vector3 | rotation | The rotation of the Rope. |
Single | length | The length of the Rope. |
Single | minLength | The minimum length of the Rope. |
Boolean | breakable | if set to true the Rope will break if shot. |
Returns
Type | Description |
---|---|
Rope |
CalculateTravelDistance(Vector3, Vector3)
Calculates the travel distance using roads and paths between 2 positions.
Declaration
public static float CalculateTravelDistance(Vector3 origin, Vector3 destination)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | origin | The origin. |
Vector3 | destination | The destination. |
Returns
Type | Description |
---|---|
Single | The travel distance |
CreateAmbientPickup(PickupType, Vector3, Model, Int32)
Spawns a pickup Prop at the specified position.
Declaration
public static Prop CreateAmbientPickup(PickupType type, Vector3 position, Model model, int value)
Parameters
Type | Name | Description |
---|---|---|
PickupType | type | |
Vector3 | position | |
Model | model | |
Int32 | value |
Returns
Type | Description |
---|---|
Prop |
CreateBlip(Vector3)
Creates a Blip at the given position on the map.
Declaration
public static Blip CreateBlip(Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position of the blip on the map. |
Returns
Type | Description |
---|---|
Blip |
CreateBlip(Vector3, Single)
Creates a Blip for a circular area at the given position on the map.
Declaration
public static Blip CreateBlip(Vector3 position, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position of the blip on the map. |
Single | radius | The radius of the area on the map. |
Returns
Type | Description |
---|---|
Blip |
CreateCamera(Vector3, Vector3, Single)
Creates a Camera, use RenderingCamera to switch to this camera
Declaration
public static Camera CreateCamera(Vector3 position, Vector3 rotation, float fov)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position of the camera. |
Vector3 | rotation | The rotation of the camera. |
Single | fov | The field of view of the camera. |
Returns
Type | Description |
---|---|
Camera |
CreateCheckpoint(CheckpointCustomIcon, Vector3, Vector3, Single, Color)
Creates a Checkpoint in the world.
Declaration
public static Checkpoint CreateCheckpoint(CheckpointCustomIcon icon, Vector3 position, Vector3 pointTo, float radius, Color color)
Parameters
Type | Name | Description |
---|---|---|
CheckpointCustomIcon | icon | The CheckpointCustomIcon to display inside the Checkpoint. |
Vector3 | position | The position in the World. |
Vector3 | pointTo | The position in the world where this Checkpoint should point. |
Single | radius | The radius of the Checkpoint. |
Color | color | The color of the Checkpoint. |
Returns
Type | Description |
---|---|
Checkpoint |
Remarks
returns null if the Checkpoint could not be created
CreateCheckpoint(CheckpointIcon, Vector3, Vector3, Single, Color)
Creates a Checkpoint in the world.
Declaration
public static Checkpoint CreateCheckpoint(CheckpointIcon icon, Vector3 position, Vector3 pointTo, float radius, Color color)
Parameters
Type | Name | Description |
---|---|---|
CheckpointIcon | icon | The CheckpointIcon to display inside the Checkpoint. |
Vector3 | position | The position in the World. |
Vector3 | pointTo | The position in the world where this Checkpoint should point. |
Single | radius | The radius of the Checkpoint. |
Color | color | The color of the Checkpoint. |
Returns
Type | Description |
---|---|
Checkpoint |
Remarks
returns null if the Checkpoint could not be created
CreateParticleEffect(ParticleEffectAsset, String, Entity, Vector3, Vector3, Single, InvertAxisFlags)
Creates a ParticleEffect on an Entity that runs looped.
Declaration
public static ParticleEffect CreateParticleEffect(ParticleEffectAsset asset, string effectName, Entity entity, Vector3 offset = default(Vector3), Vector3 rotation = default(Vector3), float scale = 1F, InvertAxisFlags invertAxis = InvertAxisFlags.None)
Parameters
Type | Name | Description |
---|---|---|
ParticleEffectAsset | asset | The effect asset to use. |
String | effectName | The name of the Effect |
Entity | entity | The Entity the effect is attached to. |
Vector3 | offset | The offset from the |
Vector3 | rotation | The rotation, relative to the |
Single | scale | How much to scale the size of the effect by. |
InvertAxisFlags | invertAxis | Which axis to flip the effect in. For a car side exhaust you may need to flip in the Y Axis. |
Returns
Type | Description |
---|---|
ParticleEffect |
CreateParticleEffect(ParticleEffectAsset, String, EntityBone, Vector3, Vector3, Single, InvertAxisFlags)
Creates a ParticleEffect on an EntityBone that runs looped.
Declaration
public static ParticleEffect CreateParticleEffect(ParticleEffectAsset asset, string effectName, EntityBone entityBone, Vector3 offset = default(Vector3), Vector3 rotation = default(Vector3), float scale = 1F, InvertAxisFlags invertAxis = InvertAxisFlags.None)
Parameters
Type | Name | Description |
---|---|---|
ParticleEffectAsset | asset | The effect asset to use. |
String | effectName | The name of the Effect |
EntityBone | entityBone | The EntityBone the effect is attached to. |
Vector3 | offset | The offset from the |
Vector3 | rotation | The rotation, relative to the |
Single | scale | How much to scale the size of the effect by. |
InvertAxisFlags | invertAxis | Which axis to flip the effect in. For a car side exhaust you may need to flip in the Y Axis. |
Returns
Type | Description |
---|---|
ParticleEffect |
CreateParticleEffect(ParticleEffectAsset, String, Vector3, Vector3, Single, InvertAxisFlags)
Creates a ParticleEffect at a position that runs looped.
Declaration
public static ParticleEffect CreateParticleEffect(ParticleEffectAsset asset, string effectName, Vector3 position, Vector3 rotation = default(Vector3), float scale = 1F, InvertAxisFlags invertAxis = InvertAxisFlags.None)
Parameters
Type | Name | Description |
---|---|---|
ParticleEffectAsset | asset | The effect asset to use. |
String | effectName | The name of the effect. |
Vector3 | position | The world coordinates where the effect is. |
Vector3 | rotation | What rotation to apply to the effect. |
Single | scale | How much to scale the size of the effect by. |
InvertAxisFlags | invertAxis | Which axis to flip the effect in. |
Returns
Type | Description |
---|---|
ParticleEffect |
CreateParticleEffectNonLooped(ParticleEffectAsset, String, Entity, Vector3, Vector3, Single, InvertAxisFlags)
Starts a Particle Effect on an Entity that runs once then is destroyed.
Declaration
public static bool CreateParticleEffectNonLooped(ParticleEffectAsset asset, string effectName, Entity entity, Vector3 off = default(Vector3), Vector3 rot = default(Vector3), float scale = 1F, InvertAxisFlags invertAxis = InvertAxisFlags.None)
Parameters
Type | Name | Description |
---|---|---|
ParticleEffectAsset | asset | The effect asset to use. |
String | effectName | the name of the effect. |
Entity | entity | The Entity the effect is attached to. |
Vector3 | off | The offset from the |
Vector3 | rot | The rotation, relative to the |
Single | scale | How much to scale the size of the effect by. |
InvertAxisFlags | invertAxis | Which axis to flip the effect in. For a car side exahust you may need to flip in the Y Axis |
Returns
Type | Description |
---|---|
Boolean | trueIf the effect was able to start; otherwise, false. |
CreateParticleEffectNonLooped(ParticleEffectAsset, String, EntityBone, Vector3, Vector3, Single, InvertAxisFlags)
Starts a Particle Effect on an EntityBone that runs once then is destroyed.
Declaration
public static bool CreateParticleEffectNonLooped(ParticleEffectAsset asset, string effectName, EntityBone entityBone, Vector3 off = default(Vector3), Vector3 rot = default(Vector3), float scale = 1F, InvertAxisFlags invertAxis = InvertAxisFlags.None)
Parameters
Type | Name | Description |
---|---|---|
ParticleEffectAsset | asset | The effect asset to use. |
String | effectName | the name of the effect. |
EntityBone | entityBone | The EntityBone the effect is attached to. |
Vector3 | off | The offset from the |
Vector3 | rot | The rotation, relative to the |
Single | scale | How much to scale the size of the effect by. |
InvertAxisFlags | invertAxis | Which axis to flip the effect in. For a car side exahust you may need to flip in the Y Axis |
Returns
Type | Description |
---|---|
Boolean | trueIf the effect was able to start; otherwise, false. |
CreateParticleEffectNonLooped(ParticleEffectAsset, String, Vector3, Vector3, Single, InvertAxisFlags)
Starts a Particle Effect that runs once at a given position then is destroyed.
Declaration
public static bool CreateParticleEffectNonLooped(ParticleEffectAsset asset, string effectName, Vector3 pos, Vector3 rot = default(Vector3), float scale = 1F, InvertAxisFlags invertAxis = InvertAxisFlags.None)
Parameters
Type | Name | Description |
---|---|---|
ParticleEffectAsset | asset | The effect asset to use. |
String | effectName | The name of the effect. |
Vector3 | pos | The World position where the effect is. |
Vector3 | rot | What rotation to apply to the effect. |
Single | scale | How much to scale the size of the effect by. |
InvertAxisFlags | invertAxis | Which axis to flip the effect in. |
Returns
Type | Description |
---|---|
Boolean | trueIf the effect was able to start; otherwise, false. |
CreatePed(Model, Vector3, Single)
Declaration
public static Ped CreatePed(Model model, Vector3 position, float heading = 0F)
Parameters
Type | Name | Description |
---|---|---|
Model | model | |
Vector3 | position | The position to spawn the Ped at. |
Single | heading | The heading of the Ped. |
Returns
Type | Description |
---|---|
Ped |
Remarks
returns null if the Ped could not be spawned.
CreatePickup(PickupType, Vector3, Vector3, Model, Int32)
Spawns a Pickup at the specified position.
Declaration
public static Pickup CreatePickup(PickupType type, Vector3 position, Vector3 rotation, Model model, int value)
Parameters
Type | Name | Description |
---|---|---|
PickupType | type | |
Vector3 | position | |
Vector3 | rotation | |
Model | model | |
Int32 | value |
Returns
Type | Description |
---|---|
Pickup |
CreatePickup(PickupType, Vector3, Model, Int32)
Spawns a Pickup at the specified position.
Declaration
public static Pickup CreatePickup(PickupType type, Vector3 position, Model model, int value)
Parameters
Type | Name | Description |
---|---|---|
PickupType | type | |
Vector3 | position | |
Model | model | |
Int32 | value |
Returns
Type | Description |
---|---|
Pickup |
CreateProp(Model, Vector3, Vector3, Boolean, Boolean)
Declaration
public static Prop CreateProp(Model model, Vector3 position, Vector3 rotation, bool dynamic, bool placeOnGround)
Parameters
Type | Name | Description |
---|---|---|
Model | model | |
Vector3 | position | The position to spawn the Prop at. |
Vector3 | rotation | The rotation of the Prop. |
Boolean | dynamic | if set to true the Prop will have physics; otherwise, it will be static. |
Boolean | placeOnGround | if set to true place the prop on the ground nearest to the |
Returns
Type | Description |
---|---|
Prop |
Remarks
returns null if the Prop could not be spawned.
CreateProp(Model, Vector3, Boolean, Boolean)
Declaration
public static Prop CreateProp(Model model, Vector3 position, bool dynamic, bool placeOnGround)
Parameters
Type | Name | Description |
---|---|---|
Model | model | |
Vector3 | position | The position to spawn the Prop at. |
Boolean | dynamic | if set to true the Prop will have physics; otherwise, it will be static. |
Boolean | placeOnGround | if set to true place the prop on the ground nearest to the |
Returns
Type | Description |
---|---|
Prop |
Remarks
returns null if the Prop could not be spawned.
CreatePropNoOffset(Model, Vector3, Vector3, Boolean)
Declaration
public static Prop CreatePropNoOffset(Model model, Vector3 position, Vector3 rotation, bool dynamic)
Parameters
Type | Name | Description |
---|---|---|
Model | model | |
Vector3 | position | The position to spawn the Prop at. |
Vector3 | rotation | The rotation of the Prop. |
Boolean | dynamic | if set to true the Prop will have physics; otherwise, it will be static. |
Returns
Type | Description |
---|---|
Prop |
Remarks
returns null if the Prop could not be spawned.
CreatePropNoOffset(Model, Vector3, Boolean)
Declaration
public static Prop CreatePropNoOffset(Model model, Vector3 position, bool dynamic)
Parameters
Type | Name | Description |
---|---|---|
Model | model | |
Vector3 | position | The position to spawn the Prop at. |
Boolean | dynamic | if set to true the Prop will have physics; otherwise, it will be static. |
Returns
Type | Description |
---|---|
Prop |
Remarks
returns null if the Prop could not be spawned.
CreateRandomPed(Vector3)
Declaration
public static Ped CreateRandomPed(Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to spawn the Ped at. |
Returns
Type | Description |
---|---|
Ped |
CreateRandomPed(Vector3, Single, Func<Model, Boolean>)
Declaration
public static Ped CreateRandomPed(Vector3 position, float heading, Func<Model, bool> predicate = null)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to spawn the Ped at. |
Single | heading | The heading of the Ped. |
Func<Model, Boolean> | predicate | The method that determines whether a model should be considered when choosing a random model for the Ped. If null is set, gangster and animal models will not be chosen, just like CREATE_PED does. |
Returns
Type | Description |
---|---|
Ped |
CreateRandomVehicle(Vector3, Single, Func<Model, Boolean>)
Declaration
public static Vehicle CreateRandomVehicle(Vector3 position, float heading = 0F, Func<Model, bool> predicate = null)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to spawn the Vehicle at. |
Single | heading | The heading of the Vehicle. |
Func<Model, Boolean> | predicate | The method that determines whether a model should be considered when choosing a random model for the Vehicle. |
Returns
Type | Description |
---|---|
Vehicle |
Remarks
returns null if the Vehicle could not be spawned.
CreateVehicle(Model, Vector3, Single)
Declaration
public static Vehicle CreateVehicle(Model model, Vector3 position, float heading = 0F)
Parameters
Type | Name | Description |
---|---|---|
Model | model | |
Vector3 | position | The position to spawn the Vehicle at. |
Single | heading | The heading of the Vehicle. |
Returns
Type | Description |
---|---|
Vehicle |
Remarks
returns null if the Vehicle could not be spawned.
DestroyAllCameras()
Destroys all user created Cameras.
Declaration
public static void DestroyAllCameras()
DrawLightWithRange(Vector3, Color, Single, Single)
Draws light around a region.
Declaration
public static void DrawLightWithRange(Vector3 position, Color color, float range, float intensity)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to center the light around. |
Color | color | The color of the light. |
Single | range | How far the light should extend to. |
Single | intensity | The intensity: |
DrawLine(Vector3, Vector3, Color)
Declaration
public static void DrawLine(Vector3 start, Vector3 end, Color color)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | start | |
Vector3 | end | |
Color | color |
DrawMarker(MarkerType, Vector3, Vector3, Vector3, Vector3, Color, Boolean, Boolean, Boolean, String, String, Boolean)
Draws a marker in the world, this needs to be done on a per frame basis
Declaration
public static void DrawMarker(MarkerType type, Vector3 pos, Vector3 dir, Vector3 rot, Vector3 scale, Color color, bool bobUpAndDown = false, bool faceCamera = false, bool rotateY = false, string textueDict = null, string textureName = null, bool drawOnEntity = false)
Parameters
Type | Name | Description |
---|---|---|
MarkerType | type | The type of marker. |
Vector3 | pos | The position of the marker. |
Vector3 | dir | The direction the marker points in. |
Vector3 | rot | The rotation of the marker. |
Vector3 | scale | The amount to scale the marker by. |
Color | color | The color of the marker. |
Boolean | bobUpAndDown | if set to true the marker will bob up and down. |
Boolean | faceCamera | if set to true the marker will always face the camera, regardless of its rotation. |
Boolean | rotateY | if set to true rotates only on the y axis(heading). |
String | textueDict | Name of texture dictionary to load the texture from, leave null for no texture in the marker. |
String | textureName | Name of texture inside the dictionary to load the texture from, leave null for no texture in the marker. |
Boolean | drawOnEntity | if set to true draw on any Entity that intersects the marker. |
DrawPolygon(Vector3, Vector3, Vector3, Color)
Declaration
public static void DrawPolygon(Vector3 vertexA, Vector3 vertexB, Vector3 vertexC, Color color)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vertexA | |
Vector3 | vertexB | |
Vector3 | vertexC | |
Color | color |
DrawSpotLight(Vector3, Vector3, Color, Single, Single, Single, Single, Single)
Declaration
public static void DrawSpotLight(Vector3 pos, Vector3 dir, Color color, float distance, float brightness, float roundness, float radius, float fadeout)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | pos | |
Vector3 | dir | |
Color | color | |
Single | distance | |
Single | brightness | |
Single | roundness | |
Single | radius | |
Single | fadeout |
DrawSpotLightWithShadow(Vector3, Vector3, Color, Single, Single, Single, Single, Single)
Declaration
public static void DrawSpotLightWithShadow(Vector3 pos, Vector3 dir, Color color, float distance, float brightness, float roundness, float radius, float fadeout)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | pos | |
Vector3 | dir | |
Color | color | |
Single | distance | |
Single | brightness | |
Single | roundness | |
Single | radius | |
Single | fadeout |
GetAllAnimatedBuildings()
Declaration
public static AnimatedBuilding[] GetAllAnimatedBuildings()
Returns
Type | Description |
---|---|
AnimatedBuilding[] |
GetAllBlips(BlipSprite[])
Gets an array
of all the Blips on the map with a given BlipSprite.
Declaration
public static Blip[] GetAllBlips(params BlipSprite[] blipTypes)
Parameters
Type | Name | Description |
---|---|---|
BlipSprite[] | blipTypes | The blip types to include, leave blank to get all Blips. |
Returns
Type | Description |
---|---|
Blip[] |
GetAllBuildings()
Declaration
public static Building[] GetAllBuildings()
Returns
Type | Description |
---|---|
Building[] |
GetAllCheckpoints()
Gets an array
of all the Checkpoints.
Declaration
public static Checkpoint[] GetAllCheckpoints()
Returns
Type | Description |
---|---|
Checkpoint[] |
GetAllEntities()
Gets an array
of all Entitys in the World.
Declaration
public static Entity[] GetAllEntities()
Returns
Type | Description |
---|---|
Entity[] |
GetAllInteriorInstances()
Declaration
public static InteriorInstance[] GetAllInteriorInstances()
Returns
Type | Description |
---|---|
InteriorInstance[] |
GetAllInteriorProxies()
Declaration
public static InteriorProxy[] GetAllInteriorProxies()
Returns
Type | Description |
---|---|
InteriorProxy[] |
GetAllPeds(Model[])
Gets an array
of all Peds in the World.
Declaration
public static Ped[] GetAllPeds(params Model[] models)
Parameters
Type | Name | Description |
---|---|---|
Model[] | models |
Returns
Type | Description |
---|---|
Ped[] |
GetAllPickupObjects()
Declaration
public static Prop[] GetAllPickupObjects()
Returns
Type | Description |
---|---|
Prop[] |
GetAllProjectiles()
Gets an array
of all Projectiles in the World.
Declaration
public static Projectile[] GetAllProjectiles()
Returns
Type | Description |
---|---|
Projectile[] |
GetAllProps(Model[])
Gets an array
of all Props in the World.
Declaration
public static Prop[] GetAllProps(params Model[] models)
Parameters
Type | Name | Description |
---|---|---|
Model[] | models |
Returns
Type | Description |
---|---|
Prop[] |
GetAllVehicles(Model[])
Gets an array
of all Vehicles in the World.
Declaration
public static Vehicle[] GetAllVehicles(params Model[] models)
Parameters
Type | Name | Description |
---|---|---|
Model[] | models | The Model of Vehicles to get, leave blank for all Vehicle Models. |
Returns
Type | Description |
---|---|
Vehicle[] |
GetClosest(Vector2, AnimatedBuilding[])
Gets the closest AnimatedBuilding to a given position in the World ignoring height.
Declaration
public static AnimatedBuilding GetClosest(Vector2 position, params AnimatedBuilding[] animatedBuildings)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The position to check against. |
AnimatedBuilding[] | animatedBuildings | The animated building to check. |
Returns
Type | Description |
---|---|
AnimatedBuilding | The closest AnimatedBuilding to the |
GetClosest(Vector2, Building[])
Gets the closest Building to a given position in the World ignoring height.
Declaration
public static Building GetClosest(Vector2 position, params Building[] buildings)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The position to check against. |
Building[] | buildings | The buildings to check. |
Returns
Type | Description |
---|---|
Building | The closest Building to the |
GetClosest(Vector2, InteriorInstance[])
Gets the closest InteriorInstance to a given position in the World ignoring height.
Declaration
public static InteriorInstance GetClosest(Vector2 position, params InteriorInstance[] interiorInstances)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The position to check against. |
InteriorInstance[] | interiorInstances | The interior instances to check. |
Returns
Type | Description |
---|---|
InteriorInstance | The closest InteriorInstance to the |
GetClosest(Vector2, InteriorProxy[])
Gets the closest InteriorProxy to a given position in the World ignoring height.
Declaration
public static InteriorProxy GetClosest(Vector2 position, params InteriorProxy[] interiorProxies)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The position to check against. |
InteriorProxy[] | interiorProxies | The spatials to check. |
Returns
Type | Description |
---|---|
InteriorProxy | The closest InteriorProxy to the |
GetClosest(Vector3, AnimatedBuilding[])
Gets the closest AnimatedBuilding to a given position in the World.
Declaration
public static AnimatedBuilding GetClosest(Vector3 position, params AnimatedBuilding[] animatedBuildings)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check against. |
AnimatedBuilding[] | animatedBuildings | The animated building to check. |
Returns
Type | Description |
---|---|
AnimatedBuilding | The closest AnimatedBuilding to the |
GetClosest(Vector3, Building[])
Gets the closest Building to a given position in the World.
Declaration
public static Building GetClosest(Vector3 position, params Building[] buildings)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check against. |
Building[] | buildings | The buildings to check. |
Returns
Type | Description |
---|---|
Building | The closest Building to the |
GetClosest(Vector3, InteriorInstance[])
Gets the closest InteriorInstance to a given position in the World.
Declaration
public static InteriorInstance GetClosest(Vector3 position, params InteriorInstance[] interiorInstances)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check against. |
InteriorInstance[] | interiorInstances | The spatials to check. |
Returns
Type | Description |
---|---|
InteriorInstance | The closest InteriorInstance to the |
GetClosest(Vector3, InteriorProxy[])
Gets the closest InteriorProxy to a given position in the World.
Declaration
public static InteriorProxy GetClosest(Vector3 position, params InteriorProxy[] interiorProxies)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check against. |
InteriorProxy[] | interiorProxies | The spatials to check. |
Returns
Type | Description |
---|---|
InteriorProxy | The closest InteriorProxy to the |
GetClosest<T>(Vector2, T[])
Gets the closest ISpatial to a given position in the World ignoring height.
Declaration
public static T GetClosest<T>(Vector2 position, params T[] spatials)
where T : ISpatial
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The position to check against. |
T[] | spatials | The spatials to check. |
Returns
Type | Description |
---|---|
T | The closest ISpatial to the |
Type Parameters
Name | Description |
---|---|
T |
GetClosest<T>(Vector3, T[])
Gets the closest ISpatial to a given position in the World.
Declaration
public static T GetClosest<T>(Vector3 position, params T[] spatials)
where T : ISpatial
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check against. |
T[] | spatials | The spatials to check. |
Returns
Type | Description |
---|---|
T | The closest ISpatial to the |
Type Parameters
Name | Description |
---|---|
T |
GetClosestAnimatedBuilding(Vector3, Single)
Declaration
public static AnimatedBuilding GetClosestAnimatedBuilding(Vector3 position, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | |
Single | radius |
Returns
Type | Description |
---|---|
AnimatedBuilding |
GetClosestBuilding(Vector3, Single)
Declaration
public static Building GetClosestBuilding(Vector3 position, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | |
Single | radius |
Returns
Type | Description |
---|---|
Building |
GetClosestInteriorInstance(Vector3, Single)
Declaration
public static InteriorInstance GetClosestInteriorInstance(Vector3 position, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | |
Single | radius |
Returns
Type | Description |
---|---|
InteriorInstance |
GetClosestInteriorProxy(Vector3, Single)
Declaration
public static InteriorProxy GetClosestInteriorProxy(Vector3 position, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | |
Single | radius |
Returns
Type | Description |
---|---|
InteriorProxy |
GetClosestPed(Vector3, Single, Model[])
Gets the closest Ped to a given position in the World.
Declaration
public static Ped GetClosestPed(Vector3 position, float radius, params Model[] models)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to find the nearest Ped. |
Single | radius | The maximum distance from the |
Model[] | models |
Returns
Type | Description |
---|---|
Ped |
Remarks
Returns null if no Ped was in the given region.
GetClosestPickupObject(Vector3, Single)
Declaration
public static Prop GetClosestPickupObject(Vector3 position, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to find the nearest Prop. |
Single | radius | The maximum distance from the |
Returns
Type | Description |
---|---|
Prop |
Remarks
Returns null if no Prop was in the given region.
GetClosestProjectile(Vector3, Single)
Gets the closest Projectile to a given position in the World.
Declaration
public static Projectile GetClosestProjectile(Vector3 position, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to find the nearest Projectile. |
Single | radius | The maximum distance from the |
Returns
Type | Description |
---|---|
Projectile |
Remarks
Returns null if no Projectile was in the given region.
GetClosestProp(Vector3, Single, Model[])
Gets the closest Prop to a given position in the World.
Declaration
public static Prop GetClosestProp(Vector3 position, float radius, params Model[] models)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to find the nearest Prop. |
Single | radius | The maximum distance from the |
Model[] | models |
Returns
Type | Description |
---|---|
Prop |
Remarks
Returns null if no Prop was in the given region.
GetClosestVehicle(Vector3, Single, Model[])
Gets the closest Vehicle to a given position in the World.
Declaration
public static Vehicle GetClosestVehicle(Vector3 position, float radius, params Model[] models)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to find the nearest Vehicle. |
Single | radius | The maximum distance from the |
Model[] | models | The Model of Vehicles to get, leave blank for all Vehicle Models. |
Returns
Type | Description |
---|---|
Vehicle |
Remarks
Returns null if no Vehicle was in the given region.
GetCrosshairCoordinates()
Determines where the crosshair intersects with the world.
Declaration
public static RaycastResult GetCrosshairCoordinates()
Returns
Type | Description |
---|---|
RaycastResult | A RaycastResult containing information about where the crosshair intersects with the world. |
GetCrosshairCoordinates(IntersectFlags, Entity)
Determines where the crosshair intersects with the world.
Declaration
public static RaycastResult GetCrosshairCoordinates(IntersectFlags intersectOptions = IntersectFlags.Everything, Entity ignoreEntity = null)
Parameters
Type | Name | Description |
---|---|---|
IntersectFlags | intersectOptions | Type of environment the raycast should intersect with. |
Entity | ignoreEntity | Prevent the raycast detecting a specific Entity. |
Returns
Type | Description |
---|---|
RaycastResult | A RaycastResult containing information about where the crosshair intersects with the world. |
GetDistance(Vector3, Vector3)
Gets the straight line distance between 2 positions.
Declaration
public static float GetDistance(Vector3 origin, Vector3 destination)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | origin | The origin. |
Vector3 | destination | The destination. |
Returns
Type | Description |
---|---|
Single | The distance |
GetGroundHeight(Vector2)
Gets the height of the ground at a given position.
Declaration
public static float GetGroundHeight(Vector2 position)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The position. |
Returns
Type | Description |
---|---|
Single | The height measured in meters |
GetGroundHeight(Vector3)
Gets the height of the ground at a given position. Note : If the Vector3 is already below the ground, this will return 0. You may want to use the other overloaded function to be safe.
Declaration
public static float GetGroundHeight(Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position. |
Returns
Type | Description |
---|---|
Single | The height measured in meters |
GetNearbyAnimatedBuildings(Vector3, Single)
Declaration
public static AnimatedBuilding[] GetNearbyAnimatedBuildings(Vector3 position, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | |
Single | radius |
Returns
Type | Description |
---|---|
AnimatedBuilding[] |
GetNearbyBlips(Vector3, Single, BlipSprite[])
Gets an array
of all Blips in a given region in the World.
Declaration
public static Blip[] GetNearbyBlips(Vector3 position, float radius, params BlipSprite[] blipTypes)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check the Blip against. |
Single | radius | The maximum distance from the |
BlipSprite[] | blipTypes | The blip types to include, leave blank to get all Blips. |
Returns
Type | Description |
---|---|
Blip[] |
GetNearbyBuildings(Vector3, Single)
Declaration
public static Building[] GetNearbyBuildings(Vector3 position, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | |
Single | radius |
Returns
Type | Description |
---|---|
Building[] |
GetNearbyEntities(Vector3, Single)
Gets an array
of all Entitys in a given region in the World.
Declaration
public static Entity[] GetNearbyEntities(Vector3 position, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check the Entity against. |
Single | radius | The maximun distance from the |
Returns
Type | Description |
---|---|
Entity[] |
GetNearbyInteriorInstances(Vector3, Single)
Declaration
public static InteriorInstance[] GetNearbyInteriorInstances(Vector3 position, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | |
Single | radius |
Returns
Type | Description |
---|---|
InteriorInstance[] |
GetNearbyInteriorProxies(Vector3, Single)
Declaration
public static InteriorProxy[] GetNearbyInteriorProxies(Vector3 position, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | |
Single | radius |
Returns
Type | Description |
---|---|
InteriorProxy[] |
GetNearbyPeds(Vector3, Single, Model[])
Gets an array
of all Peds in a given region in the World.
Declaration
public static Ped[] GetNearbyPeds(Vector3 position, float radius, params Model[] models)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check the Ped against. |
Single | radius | The maximun distance from the |
Model[] | models |
Returns
Type | Description |
---|---|
Ped[] |
GetNearbyPeds(Ped, Single, Model[])
Declaration
public static Ped[] GetNearbyPeds(Ped ped, float radius, params Model[] models)
Parameters
Type | Name | Description |
---|---|---|
Ped | ped | The ped to check. |
Single | radius | The maximun distance from the |
Model[] | models |
Returns
Type | Description |
---|---|
Ped[] |
Remarks
Doesnt include the ped
in the result
GetNearbyPickupObjects(Vector3, Single)
Declaration
public static Prop[] GetNearbyPickupObjects(Vector3 position, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check the Entity against. |
Single | radius | The maximun distance from the |
Returns
Type | Description |
---|---|
Prop[] |
GetNearbyProjectiles(Vector3, Single)
Gets an array
of all Projectiles in a given region in the World.
Declaration
public static Projectile[] GetNearbyProjectiles(Vector3 position, float radius)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check the Projectile against. |
Single | radius | The maximum distance from the |
Returns
Type | Description |
---|---|
Projectile[] |
GetNearbyProps(Vector3, Single, Model[])
Gets an array
of all Props in a given region in the World.
Declaration
public static Prop[] GetNearbyProps(Vector3 position, float radius, params Model[] models)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check the Prop against. |
Single | radius | The maximun distance from the |
Model[] | models |
Returns
Type | Description |
---|---|
Prop[] |
GetNearbyVehicles(Vector3, Single, Model[])
Gets an array
of all Vehicles in a given region in the World.
Declaration
public static Vehicle[] GetNearbyVehicles(Vector3 position, float radius, params Model[] models)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check the Vehicle against. |
Single | radius | The maximun distance from the |
Model[] | models | The Model of Vehicles to get, leave blank for all Vehicle Models. |
Returns
Type | Description |
---|---|
Vehicle[] |
GetNearbyVehicles(Ped, Single, Model[])
Declaration
public static Vehicle[] GetNearbyVehicles(Ped ped, float radius, params Model[] models)
Parameters
Type | Name | Description |
---|---|---|
Ped | ped | The ped to check. |
Single | radius | The maximun distance from the |
Model[] | models | The Model of Vehicles to get, leave blank for all Vehicle Models. |
Returns
Type | Description |
---|---|
Vehicle[] |
Remarks
Doesnt include the Vehicle the ped
is using in the result
GetNextPositionOnSidewalk(Vector2)
Gets the next position on the street where a Ped can be placed.
Declaration
public static Vector3 GetNextPositionOnSidewalk(Vector2 position)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The position to check around. |
Returns
Type | Description |
---|---|
Vector3 |
GetNextPositionOnSidewalk(Vector3)
Gets the next position on the street where a Ped can be placed.
Declaration
public static Vector3 GetNextPositionOnSidewalk(Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check around. |
Returns
Type | Description |
---|---|
Vector3 |
GetNextPositionOnStreet(Vector2, Boolean)
Gets the next position on the street where a Vehicle can be placed.
Declaration
public static Vector3 GetNextPositionOnStreet(Vector2 position, bool unoccupied = false)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The position to check around. |
Boolean | unoccupied | if set to true only find positions that dont already have a vehicle in them. |
Returns
Type | Description |
---|---|
Vector3 |
GetNextPositionOnStreet(Vector3, Boolean)
Gets the next position on the street where a Vehicle can be placed.
Declaration
public static Vector3 GetNextPositionOnStreet(Vector3 position, bool unoccupied = false)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check around. |
Boolean | unoccupied | if set to true only find positions that dont already have a vehicle in them. |
Returns
Type | Description |
---|---|
Vector3 |
GetSafeCoordForPed(Vector3, Boolean, Int32)
Gets the nearest safe coordinate to position a Ped.
Declaration
public static Vector3 GetSafeCoordForPed(Vector3 position, bool sidewalk = true, int flags = 0)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position to check around. |
Boolean | sidewalk | if set to true Only find positions on the sidewalk. |
Int32 | flags | The flags. |
Returns
Type | Description |
---|---|
Vector3 |
GetStreetName(Vector2)
Determines the name of the street which is the closest to the given coordinates.
Declaration
public static string GetStreetName(Vector2 position)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position |
Returns
Type | Description |
---|---|
String |
GetStreetName(Vector3)
Determines the name of the street which is the closest to the given coordinates.
Declaration
public static string GetStreetName(Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position |
Returns
Type | Description |
---|---|
String |
GetStreetName(Vector3, out String)
Determines the name of the street which is the closest to the given coordinates.
Declaration
public static string GetStreetName(Vector3 position, out string crossingRoadName)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The coordinates of the street |
String | crossingRoadName | If the coordinates are on an intersection, the name of the crossing road |
Returns
Type | Description |
---|---|
String | Returns the name of the street the coordinates are on. |
GetZoneDisplayName(Vector2)
Gets the display name of the a zone in the map. Use GetLocalizedString(String) to convert to the localized name.
Declaration
public static string GetZoneDisplayName(Vector2 position)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The position on the map. |
Returns
Type | Description |
---|---|
String |
GetZoneDisplayName(Vector3)
Gets the display name of the a zone in the map. Use GetLocalizedString(String) to convert to the localized name.
Declaration
public static string GetZoneDisplayName(Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position on the map. |
Returns
Type | Description |
---|---|
String |
GetZoneLocalizedName(Vector2)
Gets the localized name of the a zone in the map.
Declaration
public static string GetZoneLocalizedName(Vector2 position)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The position on the map. |
Returns
Type | Description |
---|---|
String |
GetZoneLocalizedName(Vector3)
Gets the localized name of the a zone in the map.
Declaration
public static string GetZoneLocalizedName(Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position on the map. |
Returns
Type | Description |
---|---|
String |
PauseClock(Boolean)
Pauses or resumes the in-game clock.
Declaration
[Obsolete("The World.PauseClock is obsolete, use World.IsClockPaused instead.")]
public static void PauseClock(bool value)
Parameters
Type | Name | Description |
---|---|---|
Boolean | value | Pauses the game clock if set to true; otherwise, resumes the game clock. |
Raycast(Vector3, Vector3, IntersectFlags, Entity)
Creates a raycast between 2 points.
Declaration
public static RaycastResult Raycast(Vector3 source, Vector3 target, IntersectFlags options, Entity ignoreEntity = null)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | source | The source of the raycast. |
Vector3 | target | The target of the raycast. |
IntersectFlags | options | What type of objects the raycast should intersect with. |
Entity | ignoreEntity | Specify an Entity that the raycast should ignore, leave null for no entities ignored. |
Returns
Type | Description |
---|---|
RaycastResult |
Raycast(Vector3, Vector3, Single, IntersectFlags, Entity)
Creates a raycast between 2 points.
Declaration
public static RaycastResult Raycast(Vector3 source, Vector3 direction, float maxDistance, IntersectFlags options, Entity ignoreEntity = null)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | source | The source of the raycast. |
Vector3 | direction | The direction of the raycast. |
Single | maxDistance | How far the raycast should go out to. |
IntersectFlags | options | What type of objects the raycast should intersect with. |
Entity | ignoreEntity | Specify an Entity that the raycast should ignore, leave null for no entities ignored. |
Returns
Type | Description |
---|---|
RaycastResult |
RaycastCapsule(Vector3, Vector3, Single, IntersectFlags, Entity)
Creates a 3D raycast between 2 points.
Declaration
public static RaycastResult RaycastCapsule(Vector3 source, Vector3 target, float radius, IntersectFlags options, Entity ignoreEntity = null)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | source | The source of the raycast. |
Vector3 | target | The target of the raycast. |
Single | radius | The radius of the raycast. |
IntersectFlags | options | What type of objects the raycast should intersect with. |
Entity | ignoreEntity | Specify an Entity that the raycast should ignore, leave null for no entities ignored. |
Returns
Type | Description |
---|---|
RaycastResult |
RaycastCapsule(Vector3, Vector3, Single, Single, IntersectFlags, Entity)
Creates a 3D raycast between 2 points.
Declaration
public static RaycastResult RaycastCapsule(Vector3 source, Vector3 direction, float maxDistance, float radius, IntersectFlags options, Entity ignoreEntity = null)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | source | The source of the raycast. |
Vector3 | direction | The direction of the raycast. |
Single | maxDistance | How far the raycast should go out to. |
Single | radius | The radius of the raycast. |
IntersectFlags | options | What type of objects the raycast should intersect with. |
Entity | ignoreEntity | Specify an Entity that the raycast should ignore, leave null for no entities ignored. |
Returns
Type | Description |
---|---|
RaycastResult |
RemoveAllParticleEffectsInRange(Vector3, Single)
Stops all particle effects in a range.
Declaration
public static void RemoveAllParticleEffectsInRange(Vector3 pos, float range)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | pos | The position in the world to stop particle effects. |
Single | range | The maximum distance from the |
RemoveWaypoint()
Removes the waypoint.
Declaration
public static void RemoveWaypoint()
ShootBullet(Vector3, Vector3, Ped, WeaponAsset, Int32, Single)
Fires a single bullet in the world
Declaration
public static void ShootBullet(Vector3 sourcePosition, Vector3 targetPosition, Ped owner, WeaponAsset weaponAsset, int damage, float speed = -1F)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | sourcePosition | Where the bullet is fired from. |
Vector3 | targetPosition | Where the bullet is fired to. |
Ped | owner | The Ped who fired the bullet, leave null for no one. |
WeaponAsset | weaponAsset | The weapon that the bullet is fired from. |
Int32 | damage | The damage the bullet will cause. |
Single | speed | The speed, only affects projectile weapons, leave -1 for default. |
TransitionToWeather(Weather, Single)
Transitions to weather.
Declaration
public static void TransitionToWeather(Weather weather, float duration)
Parameters
Type | Name | Description |
---|---|---|
Weather | weather | The weather. |
Single | duration | The duration. |