Jump to content

[V] Script/Native Documentation and Research


Recommended Posts

Alexander Blade

You can use speedometer srcs to see how it works and also read comments in the main.h for these functions .

Alexander, How do you get these natives? For example the Lowrider DLC has new natives like _SET_VEHICLE_DASHBOARD_COLOUR but i was looking on NativeDB and in natives.h and found none of that. So im looking for all the Lowrider DLC natives or is that all that was added?

Thanks :)

Alexander, How do you get these natives? For example the Lowrider DLC has new natives like _SET_VEHICLE_DASHBOARD_COLOUR but i was looking on NativeDB and in natives.h and found none of that. So im looking for all the Lowrider DLC natives or is that all that was added?

Thanks :)

1. He uses a native dumper

2. In carmod_shop etc. it's obvious:

void sub_f0ff(auto a_0, auto a_1, auto a_2, auto a_3) {

if (a_1._f46 == 0) {

a_1._f46 = 1;

}

sub_1156b(a_0, a_1, a_2, a_3);

if (!(a_1._f4E == -1)) {

if (a_1._f9[14/*1*/] == -1) {

AUDIO::OVERRIDE_VEH_HORN(a_0, 1, a_1._f4E);

}

}

VEHICLE::_SET_VEHICLE_PAINT_FADE(a_0, a_1._f4F);

$F40DD601A65F7F19(a_0, a_1._f60);

$6089CDF6A57F326C(a_0, a_1._f62);

if (($5ECB40269053C0D4(a_0) > 1) && (a_1._f61 >= 0)) {

$A6D3A8750DC73270(a_0, a_1._f61);

}

if (GAMEPLAY::IS_BIT_SET(a_1._f5E, 0)) {

sub_f2b1(a_0, &a_1._f50);

}

switch (a_1._f5D) {

case 0:

break;

case 1:

if (GAMEPLAY::IS_BIT_SET(a_1._f5E, 1) && GAMEPLAY::IS_BIT_SET(a_1._f5E, 2)) {

if (GAMEPLAY::IS_BIT_SET(a_1._f5E, 3)) {

} else { }

} else if (DECORATOR::DECOR_IS_REGISTERED_AS_TYPE("Player_Vehicle", 3)) {

DECORATOR::DECOR_SET_INT(a_0, "Player_Vehicle", -1);

}

break;

case 2:

if (GAMEPLAY::IS_BIT_SET(a_1._f5E, 1) && GAMEPLAY::IS_BIT_SET(a_1._f5E, 2)) {

if (DECORATOR::DECOR_IS_REGISTERED_AS_TYPE("Veh_Modded_By_Player", 3)) {

DECORATOR::DECOR_SET_INT(a_0, "Veh_Modded_By_Player", GAMEPLAY::GET_HASH_KEY(PLAYER::GET_PLAYER_NAME(PLAYER::PLAYER_ID())));

}

} else if (DECORATOR::DECOR_IS_REGISTERED_AS_TYPE("Veh_Modded_By_Player", 3)) {

if (sub_f2a1(a_1._f50) && NETWORK::NETWORK_IS_GAMER_IN_MY_SESSION(&a_1._f50)) {

v_6 = NETWORK::NETWORK_MEMBER_ID_FROM_GAMER_HANDLE(&a_1._f50);

DECORATOR::DECOR_SET_INT(a_0, "Veh_Modded_By_Player", GAMEPLAY::GET_HASH_KEY(v_6));

} else {

DECORATOR::DECOR_SET_INT(a_0, "Veh_Modded_By_Player", -1);

}

}

break;

case 3:

break;

case 4:

break;

}

}

  • 2 weeks later...

I assume this goes here with any other questions related to coding GTA V Mods; does anyone know how to make an event or multiple events happen when the player walks into a marker?

How would I go about coding it so that the game detects when the two collide? Preferably to draw a menu to the screen with options to choose from.

There's no actual guides on how to go about doing things so you're left to your own to figure it out, or get help from others in tiny fragments.

 

Sorry if its the wrong place.

I assume this goes here with any other questions related to coding GTA V Mods; does anyone know how to make an event or multiple events happen when the player walks into a marker?

How would I go about coding it so that the game detects when the two collide? Preferably to draw a menu to the screen with options to choose from.

There's no actual guides on how to go about doing things so you're left to your own to figure it out, or get help from others in tiny fragments.

 

Sorry if its the wrong place.

 

Check the distance.

 

I assume this goes here with any other questions related to coding GTA V Mods; does anyone know how to make an event or multiple events happen when the player walks into a marker?

How would I go about coding it so that the game detects when the two collide? Preferably to draw a menu to the screen with options to choose from.

There's no actual guides on how to go about doing things so you're left to your own to figure it out, or get help from others in tiny fragments.

 

Sorry if its the wrong place.

 

Check the distance.

 

I'm so sorry for even asking, I can't believe what a tit I am for not thinking of using the distance between the player and a Vector3 position, I was keep trying to name a marker and use some kind of make believe function like "marker1.IsTouchingPlayer" lol, thanks!

Hi there, I have a couple of things to add:

 

void DISPLAY_SNIPER_SCOPE_THIS_FRAME() really should be void DISPLAY_RETICLE_THIS_FRAME()

 

The real use of BOOL IS_PED_ARMED(Ped ped, int p1) is not as simple as described in the docs. p1 can be interpreted as the bit position of a 32-bit integer value (therefore p1 ranges from 0 to 31). If you test all the bit positions and do the bit manipulation to recover an integer, you get the following:

Unarmed: 0x00,
Guns: 0xF0F0F0F0
Launchers: 0xFCFCFCFC
Throwables: 0xCCCCCCCC
Melee: 0xAAAAAAAA
So it basically describes the type of weapon. It's sufficient to read bits for p1 = 2, 3 and 4 to fully differentiate them.
On a separate topic, a question: How do I force the player to throw a throwable (e.g. grenade) towards an arbitrary coordinate or direction?
Another question: How do I force the player to walk backwards?
darkphoenixxx

Hey there, what is the best say to align animations to props? i use ATTACH_ENTITY_TO_ENTITY with 180 on Z axis (at lest ped looks in right direction, but the height is wrong). Is there like specific bone index, or ones of the parameters? Had anyone done somethign like this? I am trying to make sitting anim work with chair.

 

EDIT:Scratch that, its properly done like this:

http://gtaforums.com/topic/799949-tutorial-creating-synchronized-animations-gtalua/page-1?do=findComment&comment=1067594716

Edited by darkphoenixxx

Alexander, who and why changed name for 0x238FFE5C7B0498A6 native from _DRAW_TOOLTIP_NOTIFICATION to _DISPLAY_HELP_TEXT_FROM_STRING_LABEL ?

Because it's the real name of 0x238FFE5C7B0498A6.

_DISPLAY_HELP_TEXT_FROM_STRING_LABEL: 539 matches.

_DRAW_TOOLTIP_NOTIFICATION: 0 matches.

Edited by Unknown_Modder
  • Like 1

 

Alexander, who and why changed name for 0x238FFE5C7B0498A6 native from _DRAW_TOOLTIP_NOTIFICATION to _DISPLAY_HELP_TEXT_FROM_STRING_LABEL ?

Because it's the real name of 0x238FFE5C7B0498A6.

_DISPLAY_HELP_TEXT_FROM_STRING_LABEL: 539 matches.

_DRAW_TOOLTIP_NOTIFICATION: 0 matches.

 

matches? in decompiled scripts? if it starts with a _ it's not matched to a legacy console hash, and decompiled scripts use the new name as they were generated with the new hash/name mapping, nothing related to being the 'real name'...

 

Alexander, who and why changed name for 0x238FFE5C7B0498A6 native from _DRAW_TOOLTIP_NOTIFICATION to _DISPLAY_HELP_TEXT_FROM_STRING_LABEL ?

Because it's the real name of 0x238FFE5C7B0498A6.

_DISPLAY_HELP_TEXT_FROM_STRING_LABEL: 539 matches.

_DRAW_TOOLTIP_NOTIFICATION: 0 matches.

 

 

Real name must have a matching hash, they both doesn't yet introduce confusion.

Where are your "539 matches" coming from?

 

 

Alexander, who and why changed name for 0x238FFE5C7B0498A6 native from _DRAW_TOOLTIP_NOTIFICATION to _DISPLAY_HELP_TEXT_FROM_STRING_LABEL ?

Because it's the real name of 0x238FFE5C7B0498A6.

_DISPLAY_HELP_TEXT_FROM_STRING_LABEL: 539 matches.

_DRAW_TOOLTIP_NOTIFICATION: 0 matches.

 

matches? in decompiled scripts? if it starts with a _ it's not matched to a legacy console hash, and decompiled scripts use the new name as they were generated with the new hash/name mapping, nothing related to being the 'real name'...

 

I'm not talking about console and with "real name" I mean the one that can be found in the scripts.

(_DISPLAY_HELP_TEXT_FROM_STRING_LABEL is also more informative about what the function does imo)

 

 

 

 

Alexander, who and why changed name for 0x238FFE5C7B0498A6 native from _DRAW_TOOLTIP_NOTIFICATION to _DISPLAY_HELP_TEXT_FROM_STRING_LABEL ?

Because it's the real name of 0x238FFE5C7B0498A6.

_DISPLAY_HELP_TEXT_FROM_STRING_LABEL: 539 matches.

_DRAW_TOOLTIP_NOTIFICATION: 0 matches.

 

Real name must have a matching hash, they both doesn't yet introduce confusion.

Where are your "539 matches" coming from?

 

Decompiled scripts.

Edited by Unknown_Modder

 

Decompiled scripts.

LOL.

I'm certain they are generated with names taken from DB wiki.

 

If you don't like _DISPLAY_HELP_TEXT_FROM_STRING_LABEL just change it back to _DRAW_TOOLTIP_NOTIFICATION but imo _DISPLAY_HELP_TEXT_FROM_STRING_LABEL is more informative about what the function does. :bored:

If you don't like _DISPLAY_HELP_TEXT_FROM_STRING_LABEL just change it back to _DRAW_TOOLTIP_NOTIFICATION but imo _DISPLAY_HELP_TEXT_FROM_STRING_LABEL is more informative about what the function does. :bored:

 

I believe i did, but later find out it is the same _DISPLAY_HELP_TEXT_FROM_STRING_LABEL.

I have natives.h dated "Creation time: 22.08.2015" where this native is under the name of _DRAW_TOOLTIP_NOTIFICATION.

Alexander Blade

Instead of arguing about renamed natives one could go and name some yet unknown natives .

  • Like 3
Alexander Blade

Well change it to the normal value and reload natives.h

 

 

wtf in the recent natives.h someone put float:

 

static Ped GET_PLAYER_PED(float player) { return invoke<Ped>(0x43A66C31C68491C0, player); } // 0x43A66C31C68491C0 0x6E31E993

 

Edited by Alexander Blade
  • Like 1

Alexander Blade

Add 0x36ECDA4DD9A3F08D to the Native DB. I don't know how this differs from REQUEST_SCALEFORM_MOVIE but there might be a small difference.

Any _REQUEST_SCALEFORM_MOVIE4(char* scaleformName) // 0x36ECDA4DD9A3F08D
Edited by Unknown_Modder

Instead of arguing about renamed natives one could go and name some yet unknown natives .

NETWORK::NETWORK_ACCESS_TUNABLE_INT   // 0x8BE1146DFD5D4468 0xE4B3726ANETWORK::NETWORK_ACCESS_TUNABLE_FLOAT // 0xE5608CA7BC163A5F 0x41E8912ANETWORK::NETWORK_ACCESS_TUNABLE_BOOL  // 0xAA6A47A573ABB75A 0x8A04E1FENETWORKCASH::NETWORK_REFUND_CASH      // 0xF9C812CD7C46E817 0x07C92F21NETWORKCASH::NETWORK_INITIALIZE_CASH  // 0x3DA5ECD1A56CBA6D 0x66DA9935

blackhat.gif:whistle:

 

EDIT: Added to Native DB.

 

Edited by Unknown_Modder
  • 3 weeks later...

Native hash translation table from b505 to b573

 

http://pastebin.com/n4bnZ62M

 

And now we wait for the PC version to get ruined again. (Unless you found some new, viable anti-cheat measures in the data?)

This one is interesting. It's used for displaying HUD components like the rank bar from multiplayer.

 

 

Any _REQUEST_HUD_SCALEFORM(int hudComponent) // 0x9304881D6F6537EA
Component IDs:

 

 

static var HUD = 0;

static var HUD_WANTED_STARS = 1;

static var HUD_WEAPON_ICON = 2;

static var HUD_CASH = 3;

static var HUD_MP_CASH = 4;

static var HUD_MP_MESSAGE = 5;

static var HUD_VEHICLE_NAME = 6;

static var HUD_AREA_NAME = 7;

static var HUD_VEHICLE_CLASS = 8;

static var HUD_STREET_NAME = 9;

static var HUD_HELP_TEXT = 10;

static var HUD_FLOATING_HELP_TEXT_1 = 11;

static var HUD_FLOATING_HELP_TEXT_2 = 12;

static var HUD_CASH_CHANGE = 13;

static var HUD_RETICLE = 14;

static var HUD_SUBTITLE_TEXT = 15;

static var HUD_RADIO_STATIONS = 16;

static var HUD_SAVING_GAME = 17;

static var HUD_GAME_STREAM = 18;

static var HUD_WEAPON_WHEEL = 19;

static var HUD_WEAPON_WHEEL_STATS = 20;

static var MAX_HUD_COMPONENTS = 21;

static var MAX_HUD_WEAPONS = 22;

 

 

Edited by CamxxCore
  • Like 2
Alexander Blade

Few natives in DB are updated to match b573 param count .

  • Like 3

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.