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.
Changelog
- Added
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, andWorld.GetNearbyBlips() - Added the getters of
Blip.Priority,Blip.NumberLabel,Blip.Name,Blip.Rotation, andBlip.ShowRoute - Added
Model.IsBig,Model.HasBulletProofGlass,Model.HasLowriderHydraulics,Model.HasDonkHydraulics,Model.HasParachute,Model.HasRocketBoost,Model.AllowRappel,Model.CanStandOnTop, andModel.CanJump - Added
Vehicle.IsBigVehicle,Vehicle.IsBus,Vehicle.IsDonk,Vehicle.IsElectricVehicle,Vehicle.IsEmergencyVehicle,Vehicle.IsLawEnforcementVehicle,Vehicle.IsLowrider,Vehicle.IsOffRoadVehicle,Vehicle.IsSubmarineCar,Vehicle.IsTank, andVehicle.IsVan - Added
World.PedCount,World.PropCount,World.PickupObjectCount,World.VehicleCapacity,World.PedCapacity,World.PropCapacity, andWorld.PickupObjectCapacity - Added
Entity.IsWaterCannonProof,Entity.IsSteamProof,Entity.IsSmokeProof - Added the property
Vehicle.HandlingData - Added
Ped.GetAllModels()andWeapon.GetAllModels() - Added new peds, vehicles, weapons, radio stations, blip sprites, and explosion types to
PedHash,VehicleHash,WeaponHash,RadioStation,BlipSprite, andExplosionTypeenums - Added
OpenWheeltoVehicleClassenum - Added missing control values to
Controlenum - Added missing firing pattern values to
FiringPatternenum - Added missing flag values to
LeaveVehicleFlagsenum - Added more accurate values to
VehicleLockStatusand made confusing values obsolete - Added countermeasure against removing vehicles added in Arena War or later updates (Lowriders or later updates in 1.0.505.2 to 1.0.1493.1), using memory patterns
- Fixed
Vehicle.OilVolumeandVehicle.PetrolTankVolumereturning the wrong value - Fixed the getter of
Game.TimeScalenot working in v1.0.2060.0 or higher - Fixed some properties and methods of
EntityBonenot working in v1.0.2189.0 or higher - Fixed
Game.GetUserInput()throwing exception for certain window titles - Fixed
Ped.SeatIndexnot necessarily returning the correct value - Fixed
Audio.PlaySoundAtandAudio.PlaySoundFrontendnot correctly tying the returning sound id - Fixed
Notification.Show(),Screen.ShowSubtitle(),Screen.ShowHelpTextThisFrame(), the setter ofTextElement.Caption,TextElement.GetStringWidth(), andTextElement.GetScaledStringWidth()throwing exception when the text argument isnull(now work as if the text argument is the empty string) - Fixed
PedHash.Corpse01UMYusing the wrong value - Improved performance of methods for getting entities in
WorldandWorld.GetAllBlips()(orWorld.GetActiveBlips()in the v2 API) - Made
World.CreateRandomVehicle()return immediately (the method does not work currently) - Made methods for creating entities in
Worldreturnnullwhen the entity pool is full in order to prevent the game from crashing - Made some vehicle properties more future-proof by using memory patterns, preventing some scripts from easily not working by game updates
- Updated
GameVersionenum to contain newer versions
Assets
3
Changelog
- Added new vehicles to
VehicleHashenum - Added overload to
Screen.ShowHelpTextThisFrame()to make beeping optional - Added
WeaponCollection.Give()overload which accepts a weapon name - Added setter for
Ped.VehicleWeapon - Added
VehicleWindowTint.Invalidenum value for when the native returns "-1" - Fixed
Ped.Kill() - Fixed wrong date being set and returned by
World.CurrentDate - Fixed setter for
Vehicle.SteeringAngleusing radians instead of degrees - Fixed file version information for ScriptHookVDotNet2.dll
Assets
3
Changelog
- Fixed missing multiply operator in quaternion class for v2 API
- Fixed
IsPersistentandMarkAsNoLongerNeeded()using the wrong natives - Updated
GameVersionenum to contain newer versions
Assets
3
Changelog
- Fixed "//0" being added to INI value when saving script settings
- Fixed keyboard state not updating correctly when pressing modifier keys (like Ctrl or Shift)
- Fixed scripts that were installed to subdirectories of "scripts" not loading
This should never have worked, but did in v2 because of an oversight. Unfortunately some scripts rely on this, so enabling that behavior again.
Assets
3
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
Changelog
- Added reload key again and support for changing the console toggle key
- Fixed some scripts failing to load with a
TypeLoadException - Fixed characters going missing when rendering strings greater than 198 characters
Assets
3
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.
Changelog
- Added in-game console
- Added in-game notification when a script crashes
- Added new scripting API with lots of new features, like particles, advanced notifications, ... (see
ScriptHookVDotNet3.dllfor reference) - Added support for spawning additional instances of a script (check out
Script.InstantiateScript, requires v3 API) - Added missing
headingparameter toTasks.StartScenario - Fixed
Weather.Halloween - Fixed potential crash when calling
Entity.Persistent = false - Fixed
World.GetNearbyPeds()and similar crashing the game when called with a model - Removed support for loading script assemblies from a subdirectory inside "scripts"
- Removed
GTA.UI.WorldToScreenfrom v2 (impossible to implement due to how the new loader works)
Scripts using this method won't work unfortunately. They need to be compiled against the v3 API.
Assets
3
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.
Changelog
- Use memory patterns for some vehicle properties to make the properties future-proof, preventing some scripts from easily not working by game updates
- Fixed returning true whose internal value is not 1 from
Native.Function.Callin 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. - Fixed the possible problem where some native calls doesn't work properly
- Fixed
Vehicle.Accelerationreturning a wrong value in 1.0.1604.0 or later - Fixed the getter of
Vehicle.LandingGear - Fixed
Scaleform.CallFunctionforchararguments - Updated
VehicleWheelTypeto add missing enums - Updated GameVersion enum to contain newer versions
Assets
3
Changelog
- Improved performance of the loader and native calls
- Fixed memory offsets that were changed in 1.0.1604.0
- Fixed some methods such as
UI.Notifynot showing entire texts when texts contains any non-ASCII characters and the lengths in UTF-8 are more than 99 bytes - Fixed
Native.Function.Callthrowing aNullReferenceExceptionwhen the method calls from a thread other than the main thread of script andnativeCallfails. Now the method throwsInvalidOperationExceptionin that situation. - Extended the acceptable range of
Vehicle.HighGearin 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. - Updated enums with ped, vehicle hashes, weapons, and weapon components
- Updated
BlipColorandBlipSpriteto add missing enums - Fixed the
StrangersAndFreaksandArmoredTruckvalues ofBlipSprite - Added summaries to some enums in
BlipColorandBlipSprite(most of them are wrongly named) - Updated
GameVersionenum to contain newer versions
Assets
3
Changelog
- Updated
GameVersionenum to contain newer versions
Assets
3
Changelog
- Fixed
Game.RadioStationnot working properly when the value isRadioStation.Off - Added
UnknowntoRadioStationenum. When theGame.RadioStationgetter can't find the proper enum, this will be returned. - Updated enums with vehicle hashes and radio stations
- Updated
GameVersionenum to contain newer versions
