Giter Site home page Giter Site logo

natives's Introduction

GTA V Natives Documentation

Documentation of GTA V's native function database.

https://runtime.fivem.net/doc/natives/

Contributing

Contributions are greatly appreciated! Before you submit a pull request, please read CONTRIBUTING.md.

Some topics to contribute on:

  • Documenting functionality of natives
  • Documenting parameter and return types
  • Naming unnamed natives appropriately
  • Adding example code to natives
  • Reviewing existing pull requests

Where are the CFX natives?

This repository only contains original GTA V natives. Natives from the CFX namespace can be found in the FiveM source.

FiveM documentation

Documentation for FiveM can be found here.

natives's People

Contributors

4mmonium avatar 92-smallo avatar aetaric avatar ahcenezdh avatar avarianknight avatar berkiebb avatar blattersturm avatar cerium-cfx avatar chipjpg avatar crocodildos avatar derdevhd avatar disquse avatar freedy69 avatar glitchdetector avatar gottfriedleibniz avatar gtasnail avatar itsjunction avatar korioz avatar logancyp avatar marcelo-fervi avatar niekschoemaker avatar pichotm avatar pongo1231 avatar stannum-cfx avatar technetium-cfx avatar thorium-cfx avatar titanium-cfx avatar tomgrobbe avatar tomstilson avatar xenos-ita avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

natives's Issues

How can I get intrinsic matrices and transformation matrices from depth to world corrdinate?

Thank you for the invaluable contribution to the GTA-V natives toolbox! I'm currently attempting to align point cloud data from RGBD collected in GTA-V. However, I'm struggling to find the appropriate intrinsic matrices. Moreover, I've been unable to locate the extrinsic matrix necessary to accurately transform the depth image to world coordinates. I suspect the depth images might not be in the camera coordinates, which means I can't directly apply the camera parameters for the transformation. Any insights or experience you could share would be greatly appreciated. Thank you in advance!

LUA native parameters does not fits the RAW declaration

Hello,

For example with the RemoveBlip native, the function takes 1 parameter (the blip) but for the LUA and JS part, the blip is shown as a return and not a parameter.
My guess is that in the RAW declaration, the type is not a standard one (Blip*) and the conversion is not done properly

RegisterCommand removes hashtags from args

Not sure if this is the right place but issues are disabled on citizenfx/fivem so I thought this would be the best place to post it. Please correct me if I'm wrong

Seems like if an argument contains a hashtag in the args table, it returns nil

RegisterCommand("test_command", function(source, args, raw)
    print(args[1])
    print(raw)
end)

/test_command #test

nil
test_command #test

Thought maybe it would only happen if it starts with a hashtag, that wasn't the case
/test_command t#test

nil
test_command t#test

Duplicated native

Hello, this native is twice in the natives documentation with the same name :
image

PAS Updates

Looked through this native repository for commands not caught by PAS. Ordered by usefulness.

// Return Types
// build,hash,cfx_result,nativedb_result,name
323,0x40F7E66472DF3E5C,Any,char*,UGC_GET_CACHED_DESCRIPTION // (!)
323,0xBF09786A7FCAB582,Any,char*,UGC_GET_CONTENT_NAME
323,0x703F12425ECA8BF5,Any,char*,UGC_GET_CONTENT_USER_NAME
323,0xC55A0B40FFB1ED23,Any,char*,UGC_GET_CREATE_CONTENT_ID
323,0x24409FC4C55CB22D,Any,char*,NETWORK_GET_PRESENCE_INVITE_CONTENT_ID

// Parameters
// build,hash,cfx_type,nativedb_type,name
323,0x1162EA8AE9D24EEA,float,float*,OVERRIDE_SAVE_HOUSE
323,0x1162EA8AE9D24EEA,float,Vector3*,OVERRIDE_SAVE_HOUSE
573,0x6BC0ACD0673ACEBE,Any,int*,N_0x6BC0ACD0673ACEBE // x2
1290,0x8A4416C0DB05FA66,Any,Any*,N_0x8A4416C0DB05FA66 // (!)
1103,0xDAB963831DBFD3F4,int,int*,_IS_ANY_AIR_DEFENSE_ZONE_INSIDE_SPHERE
463,0x83660B734994124D,Any,int*,N_0x83660B734994124D
463,0x2DA41ED6E1FCD7A5,Any,int*,N_0x2DA41ED6E1FCD7A5
463,0xC434133D9BA52777,Any,int*,N_0xC434133D9BA52777
463,0x1A8EA222F9C67DBB,Any,float*,N_0x1A8EA222F9C67DBB
463,0xF11F01D98113536A,Any,float*,N_0xF11F01D98113536A
505,0x2E4C123D1C8A710E,Any,int*,N_0x2E4C123D1C8A710E // x2
1290,0xE42D626EEC94E5D9,Any,int*,N_0xE42D626EEC94E5D9 // x3
463,0xB09D25E77C33EB3F,int,int*,IS_PED_EXCLUSIVE_DRIVER_OF_VEHICLE
323,0xA4822F1CF23F4810,Any,Vector3*,GENERATE_VEHICLE_CREATION_POS_FROM_PATHS
2545,0x340A36A700E99699,,int*,N_0x340A36A700E99699
2545,0x40EB1EFD921822BC,,int*,N_0x40EB1EFD921822BC
2545,0x52F734CEBE20DFBA,,int*,N_0x52F734CEBE20DFBA // x2
2612,0xFCE2747EEF1D05FC,,Any*,N_0xFCE2747EEF1D05FC
2802,0x3DA8C28346B62CED,,Vector3*,N_0x3DA8C28346B62CED
2944,0x809549AFC7AEC597,,float*,N_0x809549AFC7AEC597
2944,0x809549AFC7AEC597,,Vector3*,N_0x809549AFC7AEC597

There are some other incorrectly documented natives that may trigger a false positive (unlikely). Other undocumented natives are presumed to be in-pointers.

Few other comments:

  1. 0x40F7E66472DF3E5C and 0x8A4416C0DB05FA66 expose the content buffer (ASLR).
  2. It would be nice if GET_ENTITY_ADDRESS could be no-op'd on release builds (PAS may not sanitize those addresses).

Native type declarations

The packages:

https://www.npmjs.com/package/@citizenfx/client
https://www.npmjs.com/package/@citizenfx/server

aren't open source, so i can't contribute to fix some declarations

to be more precise the native DrawMarker should accept some parameters value as NULL but it's only accepting strings

textureDict: A texture dictionary to draw the marker with, or NULL. Example: 'GolfPutting'
textureName: A texture name in textureDict to draw the marker with, or NULL. Example: 'PuttingMarker'

Current declaration

declare function DrawMarker(_type: number, posX: number, posY: number, posZ: number, dirX: number, dirY: number, dirZ: number, rotX: number, rotY: number, rotZ: number, scaleX: number, scaleY: number, scaleZ: number, red: number, green: number, blue: number, alpha: number, bobUpAndDown: boolean, faceCamera: boolean, p19: number, rotate: boolean, textureDict: string, textureName: string, drawOnEnts: boolean): void;

Correct declaration

declare function DrawMarker(_type: number, posX: number, posY: number, posZ: number, dirX: number, dirY: number, dirZ: number, rotX: number, rotY: number, rotZ: number, scaleX: number, scaleY: number, scaleZ: number, red: number, green: number, blue: number, alpha: number, bobUpAndDown: boolean, faceCamera: boolean, p19: number, rotate: boolean, textureDict: string | null, textureName: string | null, drawOnEnts: boolean): void;

RedM natives

When? Vespura has pretty good ones, but official ones would be a lot better

TASK/OpenSequenceTask broken after build 4173

Hello, after build 4173, OpenSequenceTask stopped working correctly
For comparison, the file generated in build 4172 looks like this:

--- NativeDB Return Type: void
function Global.OpenSequenceTask(taskSequenceId)
	return _in(0xE8854A4326B9E12B, _ii(taskSequenceId) --[[ may be optional ]], _ri)
end

And on the 4173 it's without the "_ri"

function Global.OpenSequenceTask(taskSequenceId)
	return _in(0xE8854A4326B9E12B, _ii(taskSequenceId) --[[ may be optional ]])
end

I noticed that some VOID functions returns that contained "_r" or "_ri" were removed, but this function is an exception since it needs to return value passed by reference.

Update N_0x83a169eabcdb10a2

This native is referenced as PED::SET_PED_PHONE_PALETTE_IDX in nativedb: https://alloc8or.re/gta5/nativedb/?n=0x83A169EABCDB10A2

Would be nice to have the native name changed, and also documented, so future users won't need to dig through old code to find the native.

It has 2 params, first param is the ped ID, second is the ID of the phone palette. The pallets mimic the IDs of CELLPHONE_IFRUIT themes:

0=blue,
1=green,
2=red,
3=orange,
4=gray,
5=purple,
6=pink,
7 or more = dark-gray?

Current lua example:

N_0x83a169eabcdb10a2(PlayerPedId(), 3)

Example image of the phone case being changed:
image

Issue with ApplyPedBloodSpecific

There seems to be an issue with the ApplyPedBloodSpecific native, it expects p8 to be a number when it should be a string.

This is how I'm using it:

ApplyPedBloodSpecific(PlayerPedId(), 2, 0.35, 0.2, 0.0, 1.0, -1, 0.0, "BasicSlash")

This results in the error:

SCRIPT ERROR: ApplyPedBloodSpecific.lua:4: bad argument #1 to '_ii' (number expected, got string)
> ApplyPedBloodSpecific (ApplyPedBloodSpecific.lua:4)

It's expecting p8 to be a number, but according to the native reference it has the type Any. I used it 2 years ago, with this code:

Citizen.InvokeNative(0xEF0D582CBF2D9B0F, PlayerPedId(), 2, 0.35, 0.2, 0.0, 1.0, -1, 0.0, "BasicSlash")

This no longer works, but doesn't give any errors either.

I have also tried using the hash for BasicSlash, but it didn't work either.

--- ns: VEHICLE aliases: ["0x9D44FCCE98450843"] --- ## _SET_VEHICLE_SILENT ```c // 0x9D44FCCE98450843 0x968E5770 void _SET_VEHICLE_SILENT(Vehicle vehicle, BOOL toggle); ``` ``` If set to TRUE, it seems to suppress door noises and doesn't allow the horn to be continuous. ``` ## Parameters * **vehicle**: * **toggle**:


ns: VEHICLE
aliases: ["0x9D44FCCE98450843"]

_SET_VEHICLE_SILENT

// 0x9D44FCCE98450843 0x968E5770
void _SET_VEHICLE_SILENT(Vehicle vehicle, BOOL toggle);
If set to TRUE, it seems to suppress door noises and doesn't allow the horn to be continuous.  

Parameters

  • vehicle:
  • toggle:

0x2491A93618B7D838 native

The native is missing from the list. It's used to flip to the selfie camera on CellCamActivate(). Possible name: CellFrontCamActivate(). It has one boolean argument, when set to true it will use the front camera, and when set to false it returns to the back camera

Issue with GetVehicleModelNumberOfSeats

Details on replicating the bug:

  1. Spawn in kamacho.

  2. Call the GetVehicleModelNumberOfSeats(vehicleModel) function, where vehicleModel = GetHashKey('kamacho'), the value returned is 4 - correct.

  3. Despawn the vehicle.

  4. Redo step 2, the value returned is 2 - incorrect.

GetEntityScript

GetEntityScript is not working on server side (return nil all time)

AddEventHandler('entityCreating', function(entity)
print(GetEntityScript(entity))
end)
result : nil

Questions regarding two audio natives

Currently the repo has the wrong native pointed to AUDIO_IS_SCRIPTED_MUSIC_PLAYING

The current native is this which is actually AUDIO_IS_MUSIC_PLAYING

The actual native is this one

Would it be fine to move AUDIO_IS_MUSIC_PLAYING to its actual native declaration and move the proper AUDIO_IS_SCRIPTED_MUSIC_PLAYING?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.