The FiveM developer’s field guide
Know the native.
Build the world.
Engine functions, framework docs, and game assets.
One reference. From the first lookup to the last line.
knowledge base
Explore / FiveM
Native reference
- GRAPHICSvoid
DRAW_SPRITE
``` Draws a 2D sprite on the screen. Parameters: textureDict - Name of texture dictionary to load texture from (e.g. "CommonMenu", "MPWeaponsCommon", etc.) textureName - Name of texture to load from texture dictionary (e.g. "last_team_standing_icon", "tennis_icon", etc.) screenX/Y - Screen offset (0.5 = center) scaleX/Y - Texture scaling. Negative values can be used to flip the texture on that axis. (0.5 = half) heading - Texture rotation in degrees (default = 0.0) positive is clockwise, measured in degrees red,green,blue - Sprite color (default = 255/255/255) alpha - opacity level ``` ``` NativeDB Added Parameter 12: BOOL p11 ```
0xE7FFAE5EBF23D890 - GRAPHICSvoid
_DRAW_SPRITE_POLY_2
Used for drawling Deadline trailing lights, see deadline.ytd Each vertex has its own colour that is blended/illuminated on the texture. Additionally, the R, G, and B components are floats that are int-casted internally. For UVW mapping (u,v,w parameters), reference your favourite internet resource for more details.
0x736D7AA1B750856B - GRAPHICSvoid
_DRAW_SPRITE_UV
Similar to DRAW_SPRITE, but allows to specify the texture coordinates used to draw the sprite. u1, v1 - texture coordinates for the top-left corner u2, v2 - texture coordinates for the bottom-right corner ``` NativeDB Introduced: v1868 ```
0x95812F9B26074726 - GRAPHICSvoid
DRAW_TEXTURED_POLY
This native draws a textured polygon between three vectors in the game world. It's commonly utilized for rendering deadline trailing lights, with additional details available in the `deadline.ytd` file. UVW mapping details (u,v,w parameters) can be found on various internet resources. This native is specifically used for drawing textured polygons on the screen, where UV coordinates define the texture mapping and color/alpha parameters define the appearance of the polygon. This native should be called every frame for continuous rendering. ``` NativeDB Introduced: v877 ```
0x29280002282F1928 - GRAPHICSvoid
DRAW_TV_CHANNEL
``` All calls to this native are preceded by calls to GRAPHICS::_0x61BB1D9B3A95D802 and GRAPHICS::_0xC6372ECD45D73BCD, respectively. "act_cinema.ysc", line 1483: HUD::SET_HUD_COMPONENT_POSITION(15, 0.0, -0.0375); HUD::SET_TEXT_RENDER_ID(l_AE); GRAPHICS::_0x61BB1D9B3A95D802(4); GRAPHICS::_0xC6372ECD45D73BCD(1); if (GRAPHICS::_0x0AD973CA1E077B60(${movie_arthouse})) { GRAPHICS::DRAW_TV_CHANNEL(0.5, 0.5, 0.7375, 1.0, 0.0, 255, 255, 255, 255); } else { GRAPHICS::DRAW_TV_CHANNEL(0.5, 0.5, 1.0, 1.0, 0.0, 255, 255, 255, 255); } "am_mp_property_int.ysc", line 102545: if (ENTITY::DOES_ENTITY_EXIST(a_2._f3)) { if (HUD::IS_NAMED_RENDERTARGET_LINKED(ENTITY::GET_ENTITY_MODEL(a_2._f3))) { HUD::SET_TEXT_RENDER_ID(a_2._f1); GRAPHICS::_0x61BB1D9B3A95D802(4); GRAPHICS::_0xC6372ECD45D73BCD(1); GRAPHICS::DRAW_TV_CHANNEL(0.5, 0.5, 1.0, 1.0, 0.0, 255, 255, 255, 255); if (GRAPHICS::GET_TV_CHANNEL() == -1) { sub_a8fa5(a_2, 1); } else { sub_a8fa5(a_2, 1); GRAPHICS::ATTACH_TV_AUDIO_TO_ENTITY(a_2._f3); } HUD::SET_TEXT_RENDER_ID(HUD::GET_DEFAULT_SCRIPT_RENDERTARGET_RENDER_ID()); } } ```
0xFDDC2B4ED3C69DF0 - GRAPHICSvoid
ENABLE_ALIEN_BLOOD_VFX
Creates a motion-blur sort of effect, this native does not seem to work, however by using the [`ANIMPOSTFX_PLAY`](#\_0x2206BF9A37B7F724) native with `"DrugsMichaelAliensFight"` as the effect parameter, you should be able to get the effect. This native does not seem to work, however by using the [ANIMPOSTFX_PLAY](#\_0x2206BF9A37B7F724) native with "DrugsMichaelAliensFight" as the effect parameter, you should be able to get the effect.
0x9DCE1F0F78260875 - GRAPHICSvoid
ENABLE_CLOWN_BLOOD_VFX
If true, this native will create purple explosions upon projectile impact, add comic-like PTFX when firing a weapon, create a sound on bullet impact and have its own "blood effect". If the PTFX asset "scr_rcbarry2" is not requested using ([`RequestNamedPtfxAsset`](#\_0xD821490579791273)) then this native **will not work as intended**. Excerpt from fm_content_drug_lab_work.c: ``` STREAMING::REQUEST_NAMED_PTFX_ASSET("scr_rcbarry2"); if (STREAMING::HAS_NAMED_PTFX_ASSET_LOADED("scr_rcbarry2")) { GRAPHICS::ENABLE_CLOWN_BLOOD_VFX(true); AUDIO::START_AUDIO_SCENE("DLC_CM2022_DRUG_TRIP_SPRINKLERS_SCENE"); func_720(26); } ```
0xD821490579791273 - GRAPHICSvoid
ENABLE_MOON_CYCLE_OVERRIDE
Enable a custom moon cycle, allowing control of which lunar phase the moon is in. Valid values are from `0.0` to `1.0`, with `0.5` representing a full moon. | Value | Lunar Phase | | :---: | :-------------: | | `0.1` | Waxing Crescent | | `0.2` | First Quarter | | `0.3` | Waxing Gibbous | | `0.5` | Full Moon | | `0.7` | Waning Gibbous | | `0.8` | Third Quarter | | `0.9` | Waning Crescent | The moon phase can be disabled with [DISABLE_MOON_CYCLE_OVERRIDE](#\_0x2BF72AD5B41AA739)
0x2C328AF17210F009 - GRAPHICSvoid
ENABLE_MOVIE_KEYFRAME_WAIT
Description not yet documented
0x74C180030FDE4B69 - GRAPHICSvoid
ENABLE_MOVIE_SUBTITLES
Description not yet documented
0x873FA65C778AD970 - GRAPHICSvoid
END_PETROL_TRAIL_DECALS
Description not yet documented
0x0A123435A26C36CD - GRAPHICSvoid
END_SCALEFORM_MOVIE_METHOD
``` Pops and calls the Scaleform function on the stack ```
0xC6796A8FFA375E53 - GRAPHICSint
END_SCALEFORM_MOVIE_METHOD_RETURN_VALUE
Description not yet documented
0xC50AA39A577AF886 - GRAPHICSvoid
END_TEXT_COMMAND_SCALEFORM_STRING
Description not yet documented
0x362E2D3FE93A9959 - GRAPHICSvoid
END_TEXT_COMMAND_UNPARSED_SCALEFORM_STRING
Same as END_TEXT_COMMAND_SCALEFORM_STRING but does not perform HTML conversion for text tokens. Also useful for when you are trying to add blips and inputs in your scaleform (If the scaleform supports it).
0xAE4E8157D9ECF087 - GRAPHICSvoid
FADE_DECALS_IN_RANGE
Description not yet documented
0xD77EDADB0420E6E0 - GRAPHICSvoid
FADE_UP_PED_LIGHT
Description not yet documented
0xC9B18B4619F48F7B - GRAPHICSvoid
FORCE_RENDER_IN_GAME_UI
Description not yet documented
0xDC459CFA0CCE245B - GRAPHICSvoid
FREE_MEMORY_FOR_HIGH_QUALITY_PHOTO
Description not yet documented
0xD801CC02177FA3F1 - GRAPHICSvoid
FREE_MEMORY_FOR_LOW_QUALITY_PHOTO
Description not yet documented
0x6A12D88881435DCA - GRAPHICSvoid
FREE_MEMORY_FOR_MISSION_CREATOR_PHOTO
Description not yet documented
0x0A46AF8A78DC5E0A - GRAPHICSvoid
GET_ACTUAL_SCREEN_RESOLUTION
Returns current screen resolution. ``` NativeDB Introduced: v323 ```
0x873C9F3104101DD3 - GRAPHICSfloat
GET_ASPECT_RATIO
This native retrieves the aspect ratio of the game window. If `physicalAspect` is `true`, it returns the physical aspect ratio of the game window, which is useful for 3x1 modes. Otherwise, it returns the aspect ratio of the main game window, considering any custom overrides from the settings menu. ``` NativeDB Introduced: v323 ```
0xF1307EF624A80D87 - GRAPHICSfloat
_GET_BINK_MOVIE_TIME
In percentage: 0.0 - 100.0 ``` NativeDB Introduced: v1734 ```
0x8E17DDD6B9D5BF29 - GRAPHICSint
GET_CURRENT_NUMBER_OF_CLOUD_PHOTOS
Description not yet documented
0x473151EBC762C6DA - GRAPHICSfloat
GET_DECAL_WASH_LEVEL
Description not yet documented
0x323F647679A09103 - GRAPHICSint
_GET_EXTRA_TIMECYCLE_MODIFIER_INDEX
See [`GET_TIMECYCLE_MODIFIER_INDEX`](#\_0xFDF3D97C674AFB66) for use, works the same just for the secondary timecycle modifier.
0xBB0527EC6341496D - GRAPHICSBOOL
GET_IS_HIDEF
This native indicates whether the game is running in high-definition (HD) resolution. It returns `false` if the resolution is less than `1280x720` and `true` if it's equal to or greater than `1280x720`. ``` NativeDB Introduced: v323 ```
0x84ED31191CC5D2C9 - GRAPHICSBOOL
GET_IS_PETROL_DECAL_IN_RANGE
Description not yet documented
0x2F09F7976C512404 - GRAPHICSBOOL
GET_IS_WIDESCREEN
This native retrieves whether the game is running in widescreen mode or not. ``` NativeDB Introduced: v323 ```
0x30CF4BDA4FCB1905 - GRAPHICSint
GET_MAXIMUM_NUMBER_OF_CLOUD_PHOTOS
``` This function is hard-coded to always return 96. ```
0xDC54A7AF8B3A14EF - GRAPHICSint
GET_MAXIMUM_NUMBER_OF_PHOTOS
``` This function is hard-coded to always return 0. ```
0x34D23450F028B0BF - GRAPHICSBOOL
GET_REQUESTINGNIGHTVISION
Description not yet documented
0x35FB78DC42B7BD21 - GRAPHICSfloat
GET_SAFE_ZONE_SIZE
``` Gets the scale of safe zone. if the safe zone size scale is max, it will return 1.0. ```
0xBAF107B6BB2C97F0 - GRAPHICSBOOL
GET_SCALEFORM_MOVIE_METHOD_RETURN_VALUE_BOOL
Description not yet documented
0xD80A80346A45D761 - GRAPHICSint
GET_SCALEFORM_MOVIE_METHOD_RETURN_VALUE_INT
Used to get a return value from a scaleform function. Returns an int in the same way GET_SCALEFORM_MOVIE_METHOD_RETURN_VALUE_STRING returns a string.
0x2DE7EFA66B906036 - GRAPHICSchar*
GET_SCALEFORM_MOVIE_METHOD_RETURN_VALUE_STRING
Used to get a return value from a scaleform function. Returns a string in the same way GET_SCALEFORM_MOVIE_METHOD_RETURN_VALUE_INT returns an int.
0xE1E258829A885245 - GRAPHICSfloat
GET_SCREENBLUR_FADE_CURRENT_TIME
Description not yet documented
0x5CCABFFCA31DDE33 - GRAPHICSBOOL
GET_SCREEN_COORD_FROM_WORLD_COORD
``` Convert a world coordinate into its relative screen coordinate. (WorldToScreen) Returns a boolean; whether or not the operation was successful. It will return false if the coordinates given are not visible to the rendering camera. For .NET users... VB: Public Shared Function World3DToScreen2d(pos as vector3) As Vector2 Dim x2dp, y2dp As New Native.OutputArgument Native.Function.Call(Of Boolean)(Native.Hash.GET_SCREEN_COORD_FROM_WORLD_COORD , pos.x, pos.y, pos.z, x2dp, y2dp) Return New Vector2(x2dp.GetResult(Of Single), y2dp.GetResult(Of Single)) End Function C#: Vector2 World3DToScreen2d(Vector3 pos) { var x2dp = new OutputArgument(); var y2dp = new OutputArgument(); Function.Call<bool>(Hash.GET_SCREEN_COORD_FROM_WORLD_COORD , pos.X, pos.Y, pos.Z, x2dp, y2dp); return new Vector2(x2dp.GetResult<float>(), y2dp.GetResult<float>()); } //USE VERY SMALL VALUES FOR THE SCALE OF RECTS/TEXT because it is dramatically larger on screen than in 3D, e.g '0.05' small. Used to be called _WORLD3D_TO_SCREEN2D I thought we lost you from the scene forever. It does seem however that calling SET_DRAW_ORIGIN then your natives, then ending it. Seems to work better for certain things such as keeping boxes around people for a predator missile e.g. ```
0x34E82F05DF2974F5 - GRAPHICSvoid
GET_SCREEN_RESOLUTION
Hardcoded to always return 1280x720. Use [`_GET_ACTIVE_SCREEN_RESOLUTION`](#\_0x873C9F3104101DD3) to retrieve the correct screen resolution.
0x888D57E407E63624
A living reference. Documentation coverage varies by native and source.