citizenfx / natives Goto Github PK
View Code? Open in Web Editor NEWGTA V Natives Documentation
Home Page: https://docs.fivem.net/natives/
GTA V Natives Documentation
Home Page: https://docs.fivem.net/natives/
Whenever I try to use this native I doesn't work properly.
Artifact Version: 2430
F8 Error: https://i.imgur.com/L3ZuXCp.png
N_0x4757f00bc6323cfe(GetHashKey("WEAPON_NIGHTSTICK"), 0.1)
like title
bool p8: if true ped will shoot; false - will not
bool p11: if true ped will stay still; false - will not
i'm try latest artifact this, and this function return -105003971 like one integer
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
Clicking "Improve" on https://docs.fivem.net/natives/?_0x829F2E2 sends you to https://github.com/citizenfx/fivem/edit/master/ext/native-decls/SetPedPropIndex.md (Error 404)
it should send you to https://github.com/citizenfx/natives/edit/master/PED/SetPedPropIndex.md
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
Since docs are not adapted for long natives name like this one, it should handle the text smaller to prevent UI with "..."
as stated here https://runtime.fivem.net/doc/natives/?_0xB135472B
in c# native is reported to need a string value as second param.. but in API it wants a long value.. forcing everyone to use Function.Call instead calling the Native directly
GetEntityScript is not working on server side (return nil all time)
AddEventHandler('entityCreating', function(entity)
print(GetEntityScript(entity))
end)
result : nil
The image preview link doesn't work anymore.
https://github.com/citizenfx/natives/edit/master/HUD/SetRadiusBlipEdge.md
On the native website, CREATE_PED and CREATE_OBJECT_NO_OFFSET are tagged as RPC natives but those aren't RPC natives anymore, because of this a lot of people are not aware those server setters exist
https://docs.fivem.net/docs/scripting-reference/runtimes/lua/functions/Citizen.CreateThread
Is word "thread" in this article mean real thread?
As i understand scheduler code - thread is not real thread and just wrapper around coroutine.
So all coroutines execute one by one without parallelisation.
Am i right?
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
?
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!
Hey, loading this page : https://docs.fivem.net/natives/?_0x9CFBE10D= takes quite a while but the client implementation loads just fine. I believe it is related to the formatting not being correctly applied in the server side RPC native :
VS
Is it possible to make the lightning strike in a specific location or even create an effect or particle from it? Like in this video: https://www.youtube.com/watch?v=FERnq6VVy7M I've really searched everywhere but haven't found a solution.
https://runtime.fivem.net/doc/natives/#_0xAC253D7842768F48 Only works in cars, doesnt work in bikes or motorcycles
See "SET_RETICLE_STYLE" string references in EXE.
For one, the SET_PED_CAN_BE_TARGETTED_BY_PLAYER
bit field.
_SET_OBJECT_COLOUR has 0x3B2FD68DB5F8331C hash in docs which is wrong. The correct one would be 0x5F048334B4A4E774
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.
We should find a way to centralize all enums, bones, etc. At the moment, these are only documented in specific natives, and it's not easy to find them. For example, see here: https://docs.fivem.net/natives/?_0x57C51E6BAD752696.
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
the following native should be taking a playersrc as argument:
https://runtime.fivem.net/doc/natives/?_0x8689A825
Calling it is trowing an error:
Hey, why are server-side natives in the FiveM repository and not this one? All natives could be centralized here no?
Gg
The docs states that the metro variation is 24 before 2372 and 25 after, it is also 26 after 2802
Native reference doesn't have the ability to search using the joaat hash, rather it only allows searching using the 64bit value.
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;
0x9A9D1BA639675CF1
This native is not in the document.
When? Vespura has pretty good ones, but official ones would be a lot better
Details on replicating the bug:
Spawn in kamacho
.
Call the GetVehicleModelNumberOfSeats(vehicleModel)
function, where vehicleModel = GetHashKey('kamacho')
, the value returned is 4 - correct.
Despawn the vehicle.
Redo step 2, the value returned is 2 - incorrect.
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.
H
// 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.
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)
Would this be possible in way? Is there any instance in GTA where this is done or could be done?
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:
0x40F7E66472DF3E5C
and 0x8A4416C0DB05FA66
expose the content buffer (ASLR).GET_ENTITY_ADDRESS
could be no-op'd on release builds (PAS may not sanitize those addresses).Native included in #35 doesn't have the right name, can't add it right now so here's an issue to track it.
Was looking up information on the native IsFirstPersonAimCamActive and was directed to core files through a Google search:
However, Natives documentation lacks this info:
https://docs.fivem.net/natives/?_0x5E346D934122613F
Is this intended? Just casually scrolling through this, it seems like a lot of this should be in the documentation and isn't. Is it worth making a PR with info manually found in these files, or is this an issue that CFX could solve in a more efficient/automated manner?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.