An ASI plugin for Grand Theft Auto V, which allows running scripts written in any .NET language on the .NET Framework runtime in-game.
ZLIB License
Bot releases are hidden (Show)
You can now run scripts in the main thread rather than a decicated thread by setting NoScriptThread
of ScriptAttributes
to true
. Note that Script.Yield()
and Script.Wait()
are not available and instead throw an exception when NoScriptThread
is set to true
(even via some scripting API such as World.CreateVehicle()
without having the model loaded in advance).
NativeHashes
enums are updated (v3 API only) as some leaked source revealed all the exact native function names that exist in 1.0.2699. Compiled scripts do not take effect since enums are embedded as constants when directly used. See f2edb0e for the changes.
ShapeTest
class, ShapeTestHandle
and ShapeTestResult
structs, and ShapeTestStatus
and ShapeTestOptions
World.RaycastCapsule()
as obsolete because the result may not be made in the same frame you call the method despite START_SHAPE_TEST_CAPSULE
asynchronous. Use ShapeTest.StartTestCapsule()
instead.IntersectFlags
and old incorrect value as obsoleteTaskInvoker.StartVehicleMission()
, TaskInvoker.StartHeliMission()
, TaskInvoker.StartPlaneMission()
, and TaskInvoker.StartBoatMission()
, Vehicle.GetActiveMissionType()
methods, VehicleMissionType
, BoatMissionFlags
, and HeliMissionFlags
enumsVehicle.BringToHalt()
, Vehicle.BringToHalt()
, Vehicle.StopBringingToHalt()
methods, and IsBeingBroughtToHalt
propertyVehicle.IsParachuteDeployed
, Vehicle.IsRocketBoostActive
, Vehicle.StartParachuting()
, and the setters of IsLeftIndicatorLightOn
and IsRightIndicatorLightOn
Projectile.FromHandle()
EulerRotationOrder
enumPed.AlwaysKeepTask
and Ped.BlockPermanentEvents
Ped.AlwaysKeepTask
only take effect when you call Ped.MarkAsNoLongerNeeded()
or set Ped.IsPersistent
to false
as previous versions.PedHash
, VehicleHash
, WeaponHash
, WeaponComponentHash
, and BlipSprite
enumsAnimationFlags
and documentations for all values and made 2 old values as obsoleteFont
of v3 API and documentations for all valuesVehicleDrivingFlags
and old incorrect values as obsoleteINPUT_VEH_FLY_BOOST
to Control
enum
VehicleParachute
, VehicleBikeWings
, VehicleFlyBombBay
, VehicleFlyCounter
, VehicleFlyTransform
, QuadLocoReverse
, RespawnFaster
, HudmarkerSelect
, you should compile against v3.6.0 (v2.11.6.0 for v2 API) or later versions of SHVDN since enum values are compiled as constant values.EnterVehicleFlags
and EnterVehicleFlags
and old incorrect values of EnterVehicleFlags
as obsoleteDead
to Relationship
and documentations for most values to tell script developers accurate namesVehicleWeaponHash
WeaponComponentCollection
(Ped.Weapon.Components
) crashing the game on the collection accessed in 1.0.2802.0 or laterWorld.CreateParticleEffect
not working with entityPed.CanBeKnockedOffBike
Vehicle.RadioStation
Entity.MaxHealthFloat
not working correctly in 1.0.2699.16 or laterWeapon.LocalizedName
and WeaponComponent.LocalizedName
faster.Ped.LastVehicle
more reliable. No longer returns null
when the ped is going to a entry point (door) or opening the door, or returns a Vehicle
instance that are for the vehicle the ped is getting in.Formation
and old values as obsoleteParachuteLandingType
and old values as obsoletePublished by crosire about 2 years ago
v3.5.0 is skipped due to versioning issues. Almost all the changes are done in v3.5.0.
Entity.IsInAngledArea()
, World.DrawBoxForAngledArea()
, World.IsPointInAngledArea()
, and DrawBoxFlags
Entity.IsInAngledArea()
is kept for existing script compatibilities, including the parameter names.HandlingData.BoostMaxSpeed
, HandlingData.BrakeBiasFront
, HandlingData.DownForceModifier
, HandlingData.DriveBiasFront
, HandlingData.InitialDragCoefficient
, HandlingData.InitialDriveMaxFlatVelocity
, HandlingData.LowSpeedTractionLossMultiplier
, HandlingData.PopUpLightRotation
, HandlingData.RocketBoostCapacity
and HandlingData.TractionCurveLateral
Projectile.OwnerEntity
Projectile.Owner
obsolete as the projectile owner can be other physical entities such as vehicles. The property will be marked as obsolete only in v3 api and the return value of Projectile.Owner
will be Entity
in next major versions.PedHash
, VehicleHash
, WeaponHash
, WeaponComponentHash
, and BlipSprite
enumsCtrl + K
in consoleCtrl + U
in consoleHandlingData
gets data from or sets data to the CHandlingData
instance as is in the documentation comments, and thus some properties of HandlingData
may differ from the values in handling.meta
Ped.CurrentVehicle
in v3 API returning the last vehicle instead of the current vehicle in 1.0.2699.0
World.GetAllBlips()
and World.GetNearbyBlips()
not getting all blips and Blip.MemoryAddress
returning IntPtr.Zero
in 1.0.2699.0 or later versionsHandlingDataTractionLossMultiplier
not getting/setting the correct value. The property got/setted the value for fLowSpeedTractionLossMult
before.astron2
cyclone2
arbitergt
ignus2
s95
from the return values of Vehicle.GetAllModels()
, Vehicle.GetAllModelsOfClass()
, Vehicle.GetAllModelsOfClass()
, and Vehicle.GetAllModelsOfType()
Published by crosire almost 3 years ago
InteriorProxy
(which some native functions for interior use), AnimatedBuilding
, Building
, and InteriorInstance
.
InteriorProxy
, AnimatedBuilding
, Building
, and InteriorInstance
to World
class:
World.GetClosest()
overloads.Entity.FragmentGroupCount
, Entity.IsFragmentObject
, Entity.DetachFragmentPart()
, EntityBone.FragmentGroupIndex
, World.EntityColliderCount
, and Entity.EntityColliderCapacity
Ped.SeeingRange
, Ped.HearingRange
, Ped.VisualFieldMinAngle
, Ped.VisualFieldMaxAngle
, Ped.VisualFieldMinElevationAngle
, Ped.VisualFieldMaxElevationAngle
, Ped.VisualFieldPeripheralRange
, and Ped.VisualFieldCenterAngle
Ped.CauseOfDeath
, Ped.TimeOfDeath
, Ped.ClearKillerRecord()
, Ped.ClearCauseOfDeathRecord()
, and Ped.ClearTimeOfDeathRecord()
Ped.FiringPattern
Game.FindPattern()
Quaternion.LookRotation()
PedHash
, VehicleHash
, WeaponHash
, WeaponComponentHash
, RadioStation
, BlipSprite
, and ExplosionType
enumsoffset
to Entity.ApplyForce()
and Entity.ApplyForceRelative()
isAmmoLoaded
to WeaponCollection.Give()
Stop()
method of helper classes of Euphoria
not workingStart()
method of helper classes of Euphoria
not working properly when peds are ragdolled. Now the method can apply simultaneously just like in v2.10.10 or earlier versions.
Start()
method working when peds are ragdolled but not by SET_PED_TO_RAGDOLL
, which does not work in v2.10.10 or earlier versions.Vehicle.PassengerCount
not counting as intended in v1.0.2545.0 (or later versions) due to addition to parameters and implementation changesWeaponCollection.Give()
not selecting the weapon if equipNow
is set to true
and the ped did not have the weaponWeaponCollection.Give()
select the weapon only if equipNow
is set to true
when the ped had the weaponPublished by crosire about 3 years ago
VehicleWheel.IsTouchingSurface
crashing the game in some casesGTA.Script
not showing the correct API version in the log file and console log (although this did not affect determining the API version)Published by crosire about 3 years ago
Despite the minor version difference, this version is basically the same as v3.2.0 but with one bug fix, additional enum values for WeaponComponentHash
and WeaponAttachmentPoint
, and additional properties for missing enum values of WeaponAttachmentPoint
. v3.3.0 is skipped due to versioning issues.
NaturalMotion.Message
not properly sending Vector3
messagesWeaponComponentHash
and WeaponAttachmentPoint
WeaponComponentCollection.GetBarrelComponent()
, WeaponComponentCollection.BarrelVariationsCount
, WeaponComponentCollection.GetSuppressorOrMuzzleBrakeComponent()
, WeaponComponentCollection.SuppressorAndMuzzleBrakeVariationsCount
, WeaponComponentCollection.GetGunRootComponent()
, and WeaponComponentCollection.GunRootVariationsCount
WeaponComponentCollection.GetLuxuryFinishComponent()
obsoletePublished by crosire about 3 years ago
NativeHashes
enums are updated (v3 API only). Compiled scripts do not take effect since enums are embedded as constants when directly used. See f0ae67b for the changes.
Fixed NaturalMotion.Euphoria
. Now required memory offsets for the class are retrieved using memory patterns.
Added Native.Function.Call
overloads with 0 to 16 normal InputArgument
parameters. These overloads are provided mainly for performance.
Added GameVersionNotSupportedException
Added EntityDamageRecord
struct, EntityDamageRecordCollection
class, and Entity.DamageRecords
Added Projectile
class, World.GetAllProjectiles()
, World.GetNearbyProjectiles()
, World.GetClosestProjectile()
, World.ProjectileCount
, and World.ProjectileCapacity
Added MeasurementSystem
enum and Game.MeasurementSystem
Added PlayerTargetingMode
enum and Game.PlayerTargetingMode
Added Game.IsVibrationEnabled
and Game.GetProfileSetting()
Added EntityPopulationType
enums and Entity.PopulationType
Added the setter of Entity.RotationVelocity
, and Entity.WorldRotationVelocity
Added Model.IsAnimalPed
, Model.IsFemalePed
, Model.IsGangPed
, Model.IsHumanPed
, Model.IsMalePed
, Model.IsMotorcycle
, and Model.IsSubmarine
,
Added the getter of Ped.CanBeTargetted
Added Ped.SetIsPersistentNoClearTask()
and Ped.GetAllLoadedModelsAppropriateForAmbientPeds()
Added Player.LockedOnEntity
property
Added VehicleType
enum, Vehicle.Type
, Vehicle.IsRegularAutomobile
, Vehicle.IsAmphibiousAutomobile
, Vehicle.IsAutomobile
, Vehicle.IsRegularQuadBike
, Vehicle.IsAmphibiousQuadBike
, Vehicle.IsQuadBike
, Vehicle.IsAmphibious
, Vehicle.IsTrailer
, Vehicle.IsPlane
, Vehicle.IsHelicopter
, Vehicle.IsBlimp
, Vehicle.IsMotorcycle
, Vehicle.IsBicycle
, Vehicle.IsBike
, Vehicle.IsBoat
, Vehicle.IsTrain
, and Vehicle.IsSubmarine
Model
via Vehicle.Model
.Added Vehicle.IsConsideredDestroyed
, Vehicle.GetModelMakeName()
, Vehicle.GetModelType()
, Vehicle.GetAllModelsOfType()
, and Vehicle.GetAllLoadedModelsAppropriateForAmbientVehicles()
Added VehicleWheelBoneId
enum, VehicleWheel.MemoryAddress
, VehicleWheel.BoneId
, VehicleWheel.LastContactPosition
, VehicleWheel.SteeringLimitMultiplier
, VehicleWheel.Temperature
, VehicleWheel.IsTouchingSurface
, VehicleWheel.IsTireOnFire
, VehicleWheel.IsSteeringWheel
, VehicleWheel.IsDrivingWheel
, VehicleWheel.IsPunctured
, VehicleWheel.IsBursted
, VehicleWheel.Health
, VehicleWheel.TireHealth
, VehicleWheel.Fix()
with a bool
overload, VehicleWheel.Puncture()
, and VehicleWheel.Burst()
Added Weapon.GetAllWeaponHashesForHumanPeds()
, WeaponComponent.GetAllHashes()
WeaponAsset.IsValidAsWeaponHash
Added World.IsClockPaused
and World.MillisecondsPerGameMinute
Added a new overload for World.CreateRandomPed()
Added World.CreateRandomVehicle()
with a new signature
CreateRandomVehicle
since it did not work at all in all the versions of SHVDNAdded and PlayerTargetingMode
enums
Added Screen.AreScreenKillEffectsEnabled
, Screen.IsHelpTextDisplayed
,Screen.ShowSubtitle()
with additional parameters, and Screen.ClearHelpText()
Added new or missing peds, vehicles, weapons, weapon components, radio stations, blip sprites, explosion types, checkpoint icon type, radio station, and vehicle color to PedHash
, VehicleHash
, WeaponHash
, WeaponComponentHash
, RadioStation
, BlipSprite
, ExplosionType
, CheckpointIcon
, RadioStation
, and VehicleColor
enums
Added the correct enum names to RagdollType
and mark the old and incorrect enum names of RagdollType
as obsolete
Added additional shortcut to remove the right character of the cursor with Ctrl + D
in console
Added additional shortcut to remove the left character of the cursor with Ctrl + H
in console
Added the ability to transpose two characters around the cursor with Ctrl + T
in console
Added the ability to keep console history after reloading scripts
Fixed Blip.DisplayType
, Blip.CategoryType
, Blip.Priority
, Blip.NumberLabel
, Blip.Rotation
, Blip.RotationFloat
, Blip.ScaleY
returning a incorrect value in v1.0.877.1 or earlier versions
Fixed Model.IsBlimp
, Model.IsSubmarineCar
, Model.IsTrailer
returning a incorrect value in v1.0.877.1 or earlier versions
Fixed All of the properties of Checkpoint
and Checkpoint.Exists()
crashing the game on access
Fixed Weapon.GetDisplayNameFromHash
returning WT_INVALID
when some of the weapon hashes that are present in the stock game is present
Fixed Weapon.GetDisplayNameFromHash
returning WT_INVALID
when some of the weapon hashes that are present in the stock game is present
Fixed throwing NullReferenceException
when WeaponCompoent.Active
, WeaponCompoent.DisplayName
, WeaponCompoent.LocalizedName
is accessed via the instance for the invalid component. Now returns false
or the empty string if accessed via the instance for the invalid component.
Made Entity.MarkAsNoLongerNeeded()
in v3 API not setting the handle to zero (now behaves in the same way as that in v2 API)
Entity.Delete()
in v3 API still sets the handle to zero, so be aware! If you need to remove entities from collecitions such as Dictionary
, remove them from these collection before deting entities from the game.Made getting entities handles with the methods in World
class faster
Made pushing string
s to native functions faster
Made Entity.FromHandle
and Entity.EntityType
values faster
Made World.WaypointBlip
and World.WaypointPosition
get values faster
Made WeaponComponent.AttachmentPoint
get value faster
Made Weapon.Components
load all compatible weapon components faster
Made Screen.ShowHelpTextThisFrame()
show texts only one frame
Made all of the ped and vehicle properties that directly access to memory more future-proof by using memory patterns, preventing some scripts from easily not working by game updates
Published by crosire almost 4 years ago
You can now specify scripting API version to be used for source scripts via file name. For example, SHVDN runs "script.3.cs" using the v3 API.
Blip.MemoryAddress
, Blip.DisplayType
, Blip.CategoryType
, Blip.SecondaryColor
, Blip.DisplayNameHash
, Blip.RotationFloat
, Blip.ScaleX
, Blip.ScaleY
, Blip.FlashInterval
, Blip.FlashTimeLeft
, Blip.ShowsDollarSign
, Blip.ShowsHeadingIndicator
, Blip.ShowsOutlineIndicator
, Blip.ShowsFriendIndicator
, Blip.ShowsCrewIndicator
, Blip.IsHiddenOnLegend
, Blip.GetAppropriateName()
, Blip.ResetName()
, BlipCategoryType
, BlipDisplayType
, and World.GetNearbyBlips()
Blip.Priority
, Blip.NumberLabel
, Blip.Name
, Blip.Rotation
, and Blip.ShowRoute
Model.IsBig
, Model.HasBulletProofGlass
, Model.HasLowriderHydraulics
, Model.HasDonkHydraulics
, Model.HasParachute
, Model.HasRocketBoost
, Model.AllowRappel
, Model.CanStandOnTop
, and Model.CanJump
Vehicle.IsBigVehicle
, Vehicle.IsBus
, Vehicle.IsDonk
, Vehicle.IsElectricVehicle
, Vehicle.IsEmergencyVehicle
, Vehicle.IsLawEnforcementVehicle
, Vehicle.IsLowrider
, Vehicle.IsOffRoadVehicle
, Vehicle.IsSubmarineCar
, Vehicle.IsTank
, and Vehicle.IsVan
World.PedCount
, World.PropCount
, World.PickupObjectCount
, World.VehicleCapacity
, World.PedCapacity
, World.PropCapacity
, and World.PickupObjectCapacity
Entity.IsWaterCannonProof
, Entity.IsSteamProof
, Entity.IsSmokeProof
Vehicle.HandlingData
Ped.GetAllModels()
and Weapon.GetAllModels()
PedHash
, VehicleHash
, WeaponHash
, RadioStation
,BlipSprite
, and ExplosionType
enumsOpenWheel
to VehicleClass
enumControl
enumFiringPattern
enumLeaveVehicleFlags
enumVehicleLockStatus
and made confusing values obsoleteVehicle.OilVolume
and Vehicle.PetrolTankVolume
returning the wrong valueGame.TimeScale
not working in v1.0.2060.0 or higherEntityBone
not working in v1.0.2189.0 or higherGame.GetUserInput()
throwing exception for certain window titlesPed.SeatIndex
not necessarily returning the correct valueAudio.PlaySoundAt
and Audio.PlaySoundFrontend
not correctly tying the returning sound idNotification.Show()
, Screen.ShowSubtitle()
, Screen.ShowHelpTextThisFrame()
, the setter of TextElement.Caption
, TextElement.GetStringWidth()
, and TextElement.GetScaledStringWidth()
throwing exception when the text argument is null
(now work as if the text argument is the empty string)PedHash.Corpse01UMY
using the wrong valueWorld
and World.GetAllBlips()
(or World.GetActiveBlips()
in the v2 API)World.CreateRandomVehicle()
return immediately (the method does not work currently)World
return null
when the entity pool is full in order to prevent the game from crashingGameVersion
enum to contain newer versionsPublished by crosire over 4 years ago
VehicleHash
enumScreen.ShowHelpTextThisFrame()
to make beeping optionalWeaponCollection.Give()
overload which accepts a weapon namePed.VehicleWeapon
VehicleWindowTint.Invalid
enum value for when the native returns "-1"Ped.Kill()
World.CurrentDate
Vehicle.SteeringAngle
using radians instead of degreesPublished by crosire over 4 years ago
IsPersistent
and MarkAsNoLongerNeeded()
using the wrong nativesGameVersion
enum to contain newer versionsPublished by crosire about 5 years ago
Published by crosire about 5 years ago
You can now change the default key used to toggle the in-game console. Reloading via a key press in addition to the Reload()
command in the console is possible again too.
To modify those shortcut keys, edit ScriptHookVDotNet.ini
in the game folder (e.g.):
ReloadKey=Insert
ConsoleKey=F4
TypeLoadException
Published by crosire about 5 years ago
It's time to finally release the major v3 update. This includes a new in-game console with C# expression support, a cleaned up scripting API and support for using scripts written against different scripting API versions side by side (so you can continue to load old v2 scripts, but also new ones using the v3 API). All of this works automatically, just drop all scripts into the "scripts" directory as before and ScriptHookVDotNet will do the magic behind the scenes. This update also includes the v2.10.11
update to v2.
The console is opened with the F4
key. Open it and enter Help()
for more information on how to use it. It has full access to the scripting API, so is a powerful tool for all kinds of purposes (e.g. type V.Repair()
to repair your current vehicle). There is a command history, use the arrow up/down keys to go through it. Page up/down can be used to go through the log history.
ScriptHookVDotNet3.dll
for reference)Script.InstantiateScript
, requires v3 API)heading
parameter to Tasks.StartScenario
Weather.Halloween
Entity.Persistent = false
World.GetNearbyPeds()
and similar crashing the game when called with a modelGTA.UI.WorldToScreen
from v2 (impossible to implement due to how the new loader works)Published by crosire about 5 years ago
Starting from this version, required .NET Framework version has been changed to 4.8, and required Visual C++ redistributable version has been changed to 2019. Make sure you have these versions installed!!
Changing required versions basically don't affect existing scripts, because scripts run on the version of .NET Framework 4 you installed (e.g. if you have .NET Framework 4.8, all scripts will be run on .NET Framework 4.8, regardness of target Framework). See #839 for more information.
Native.Function.Call
in v2.10.9. This can be a problem and can make scripts not working properly, especially when C# version of scripts is lower than 8.0 and switch statements. are used.Vehicle.Acceleration
returning a wrong value in 1.0.1604.0 or laterVehicle.LandingGear
Scaleform.CallFunction
for char
argumentsVehicleWheelType
to add missing enumsPublished by crosire over 5 years ago
UI.Notify
not showing entire texts when texts contains any non-ASCII characters and the lengths in UTF-8 are more than 99 bytesNative.Function.Call
throwing a NullReferenceException
when the method calls from a thread other than the main thread of script and nativeCall
fails. Now the method throws InvalidOperationException
in that situation.Vehicle.HighGear
in 1.0.1604.0 to between 0 and 10 (inclusive), since the maximum supported vehicle gear is changed to 10 in 1.0.1604.0.BlipColor
and BlipSprite
to add missing enumsStrangersAndFreaks
and ArmoredTruck
values of BlipSprite
BlipColor
and BlipSprite
(most of them are wrongly named)GameVersion
enum to contain newer versionsPublished by crosire almost 6 years ago
GameVersion
enum to contain newer versionsPublished by crosire about 6 years ago
Game.RadioStation
not working properly when the value is RadioStation.Off
Unknown
to RadioStation
enum. When the Game.RadioStation
getter can't find the proper enum, this will be returned.GameVersion
enum to contain newer versionsPublished by crosire over 6 years ago
Ped.SeatIndex
not working in 1.0.1290.1 or laterGameVersion
enum to contain newer versionsPublished by crosire almost 7 years ago
Published by crosire almost 7 years ago
GameVersion
enum to contain newer versionsPublished by crosire about 7 years ago
Halloween
to the weather enumHakuchou2
hashWrold.CurrentDate
getter throwing exceptions when the value is invalid as a Gregorian calendar dayBlipSprite
enum