Quantcast

Jump to content

» «
Photo

Ped Headshot/Mugshot TXD

5 replies to this topic
jedijosh920
  • jedijosh920

    ⭐⭐⭐⭐⭐

  • Members
  • Joined: 01 Mar 2012
  • United-States

#1

Posted 17 April 2017 - 03:55 AM Edited by jedijosh920, 17 April 2017 - 03:56 AM.

I want to document this here since it could be of use to other people and for myself to look at later on if I forget.

 

The natives we will be using are:

 

REGISTER_PEDHEADSHOT

GET_PEDHEADSHOT_TXD_STRING

UNREGISTER_PEDHEADSHOT

IS_PEDHEADSHOT_READY

IS_PEDHEADSHOT_VALID

 

First of all, what is a ped headshot? It's basically a picture or "mugshot" of the ped that you can use for various things. An example of this is shown in the pause menu.

 

00f551f9401943599a5f5f74e1530212.jpeg

 

I will be using ScriptHookVDotNet/C# for examples.

 

First you want to get the handle of the pedheadshot by calling REGISTER_PEDHEADSHOT and then the first and only argument will be the ped.

int handle = Function.Call<int>(Hash.REGISTER_PEDHEADSHOT, Game.Player.Character);

Next you want to wait a few seconds such as Script.Wait(5000); for the game to register and create a texture for it or you can use these functions and just pass the handle as the only argument:

 

IS_PEDHEADSHOT_READY

IS_PEDHEADSHOT_VALID

 

Then, you want to get the string/name of the texture or TXD by using GET_PEDHEADSHOT_TXD_STRING and the handle from the one we registered earlier.

string txdString = Function.Call<string>(Hash.GET_PEDHEADSHOT_TXD_STRING, handle);

Once you have the name of the texture you are good to go! You can use it for a variety of things such as notifications and drawing textures of the ped.

 

9bb5210324964f66af08cf642b79ff7f.jpeg

 

I hope this helps someone out!

  • stillhere, MrGTAmodsgerman, Unknown_Modder and 8 others like this

winject
  • winject

    Player Hater

  • Members
  • Joined: 23 Apr 2017
  • Antarctica

#2

Posted 23 April 2017 - 06:11 PM

Well done.

It must work in a similar way with online characters in the pause menu, or maybe it's using scaleforms to render it?


NoNameSet
  • NoNameSet

    Player Hater

  • Members
  • Joined: 22 Jul 2017
  • Germany

#3

Posted 18 September 2017 - 08:11 PM Edited by NoNameSet, 19 September 2017 - 03:00 PM.

mind telling me how this would work with RPH?

(the notification)


TaranVG
  • TaranVG

    Player Hater

  • New Members
  • Joined: 21 Sep 2017
  • Netherlands

#4

Posted 21 September 2017 - 05:08 PM

Well done.

It must work in a similar way with online characters in the pause menu, or maybe it's using scaleforms to render it?

I believe player models are displayed like this (didn't test)

if (ENTITY::DOES_ENTITY_EXIST(uParam0->f_483) && !ENTITY::IS_ENTITY_DEAD(uParam0->f_483, 0x00000000))
{
	iVar6 = PED::CLONE_PED(uParam0->f_483, 0x00000000, 0x00000000, 0x00000001);
	unk_0x027DB6817AB239EB(iVar6, 0x00000001, 0x00000000);
}
UI::GIVE_PED_TO_PAUSE_MENU(iVar6, 0x00000002);
UI::_0X3CA6050692BC61B0(0x00000001);
UI::_0XECF128344E9FF9F1(0x00000001);
  • jedijosh920 likes this

NoNameSet
  • NoNameSet

    Player Hater

  • Members
  • Joined: 22 Jul 2017
  • Germany

#5

Posted 14 October 2017 - 02:19 PM

nvm found out, for anyone searching the RagePluginHook way:

 

private uint handle

 

handle = NativeFunction.Natives.RegisterPedheadshot<uint>(Ped);
            if (NativeFunction.Natives.IsPedheadshotReady<bool>(handle))
            {
                string str = NativeFunction.Natives.GetPedheadshotTxdString<string>(handle);
                Game.DisplayNotification(str, str, "", "", "");
            }


Krlos_Rokr
  • Krlos_Rokr

    Player Hater

  • Members
  • Joined: 05 Apr 2014
  • Colombia

#6

Posted A week ago

You're the master bro!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users