Getting the name of a pedModel

Hey there! I’m trying to make a script that saves the Ped Model, Position, and Weapons for a player. I’ve come a bit on the way, and encountered problems but managed to solve them. This problem though, I seem unable to find a solution.

When you’re getting the current ped model of a player, it seems only possible to get the Hashed ID, and no way to revert it. Although, when I’m spawning a certain ped to a player, it has to be either the name, for example, " a_f_m_bodybuild_01". But it can also be GetHashKey(" a_f_m_bodybuild_01").
If I, on the other hand, would have the specific hash for this ped and put it like this: model = “hash key” it doesn’t work.

Since I didn’t get that to work, I decided to look across the Native references, but the only thing similar I found was “GetDisplayNameFromVehicleModel”. Furthermore, I’ve looked across other posts, but found nothing.
Therefore, I’m making a post of my own hoping I’ll get help!

To shorten it up,
I need to set a ped model to a player by the HashID inside a string, or somehow revert the HashID to the Ped Name.
Thanks in advance for any help I receive!

3 Likes

Thank you very much! I solved it thanks to you!

Although, a similar question, can I get the name of a weapon that the current player has, if I have the hashkey?