Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Contract
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

[C++] Proper Online character model in Singleplayer (not the default m


Flying Scotsman
 Share

Recommended Posts

Flying Scotsman

I've spent a few days trying to figure out how to get your Online character model as a swappable model in Singleplayer but the closest I could get is the default model (blue t-shirt, bald head); Setting the ped to the default components doesn't seem to work (in the vain hope it did something like it does to other models).

 

I know it's possible to get the proper Online model in Singleplayer as mods such as Skin-Control have done it.

 

Anyone know where I'm going wrong/what I need to do to get this to work?

 

*Edit* Noticed I've mistakenly hit the title character limit. Would be great to be able to change the title to fix it.

Edited by Zemanez
Link to comment
Share on other sites

ClareXoBearrx3R9

I think you would need to use something like SET_PED_VARIATION you get the clothes, torso, and other body parts that you want. I've never done it myself but from past research from GTA IV, that's what I've read.

 

I have no idea what parameters correspond to what in the function but hopefully some research may yield some helpful results. Hope that this at least gets you started.

Edited by ClareXoBearrx3
Link to comment
Share on other sites

DWORD model = GAMEPLAY::GET_HASH_KEY((char *)"mp_f_freemode_01");DWORD model = GAMEPLAY::GET_HASH_KEY((char *)"mp_m_freemode_01");for (int i = 0; i < 12; i++){PED::SET_PED_COMPONENT_VARIATION(model , i, rand() % 10, rand() % 10, 0);}

they won't be your exact toon, but it will be a model of a online male or female

Edited by adv0cate
Link to comment
Share on other sites

Flying Scotsman

Thanks for the replies! Looks like I'll be using the component method until I can get a reply back from the author of Skin Control.

Link to comment
Share on other sites

  • 3 months later...

Sorry for bumping relatively old topic but I've a problem setting a ped to the player (the same skin of this topic). My goal is to set the player to the Male of GTA Online (mp_m_freemode_01).

I already made this code, that works for every skin except mp_m_freemode_01 and mp_f_freemode_01, the ones I need:

...DWORD freemodeMale = GAMEPLAY::GET_HASH_KEY((char *)"mp_m_freemode_01");if (STREAMING::IS_MODEL_IN_CDIMAGE(freemodeMale) && STREAMING::IS_MODEL_VALID(freemodeMale)) {  STREAMING::REQUEST_MODEL(freemodeMale);  while (!STREAMING::HAS_MODEL_LOADED(freemodeMale))    WAIT(0);  PLAYER::SET_PLAYER_MODEL(playerID, freemodeMale);  PED::SET_PED_DEFAULT_COMPONENT_VARIATION(playerPed);}...

The lines or code are the same of Native Trainer of Alexander.

Someone can tell me why this code works for other skins except the 2 skins mentioned above?

I can load these skins with ENT or Skin Control mods, but not with this code.

 

Edited by FunGt
Link to comment
Share on other sites

Flying Scotsman

 

Sorry for bumping relatively old topic but I've a problem setting a ped to the player (the same skin of this topic). My goal is to set the player to the Male of GTA Online (mp_m_freemode_01).

I already made this code, that works for every skin except mp_m_freemode_01 and mp_f_freemode_01, the ones I need:

...DWORD freemodeMale = GAMEPLAY::GET_HASH_KEY((char *)"mp_m_freemode_01");if (STREAMING::IS_MODEL_IN_CDIMAGE(freemodeMale) && STREAMING::IS_MODEL_VALID(freemodeMale)) {  STREAMING::REQUEST_MODEL(freemodeMale);  while (!STREAMING::HAS_MODEL_LOADED(freemodeMale))    WAIT(0);  PLAYER::SET_PLAYER_MODEL(playerID, freemodeMale);  PED::SET_PED_DEFAULT_COMPONENT_VARIATION(playerPed);}...

The lines or code are the same of Native Trainer of Alexander.

Someone can tell me why this code works for other skins except the 2 skins mentioned above?

I can load these skins with ENT or Skin Control mods, but not with this code.

 

 

 

Try changing it into:

DWORD freemodeMale = GAMEPLAY::GET_HASH_KEY("mp_m_freemode_01"); ////Don't need the (char *) unless you're storing it in a variable. Can also be Hash freemodeMale = ... if your types.h has it//if (STREAMING::IS_MODEL_IN_CDIMAGE(freemodeMale) && STREAMING::IS_MODEL_VALID(freemodeMale)) {  STREAMING::REQUEST_MODEL(freemodeMale);  while (!STREAMING::HAS_MODEL_LOADED(freemodeMale))    WAIT(0);  PLAYER::SET_PLAYER_MODEL(playerID, freemodeMale);  PED::SET_PED_DEFAULT_COMPONENT_VARIATION(playerPed);}

Alternatively replace freemodeMale with "GAMEPLAY::GET_HASH_KEY("mp_m_freemode_01")" in the code and see if it works that way (clunky I know, but it'll help debug).

 

You also only need to create a pointer to the model ((char *)) if the argument you're passing into the GET_HASH_KEY() native is a variable holding the model name (for example, in A.B's code and in ENT, the player selects a model, which is stored in DWORD model, which is passed into the spawn code above, and the hash is generated from the model pointer. You need a pointer to tell it where model is, so it can get the hash). Since you're not storing the model name in a variable, you can just put it in directly like I did above.

 

The same sort of setup works for spawning cars and other things.

Edited by Zemanez
Link to comment
Share on other sites

Here are a couple of natives that might be useful for you:

PED::SET_PED_COMPONENT_VARIATION
PED::SET_PED_PROP_INDEX
PED::GET_PED_DRAWABLE_VARIATION
PED::GET_PED_TEXTURE_VARIATION
PED::GET_PED_PALETTE_VARIATION
PED::GET_PED_PROP_INDEX
PED::GET_PED_PROP_TEXTURE_INDEX
Link to comment
Share on other sites

Using PLAYER::PLAYER_ID() instead of a variable it worked. Probably I assigned playerID too early with respect to the code where I use it.

The problem was not the assign of freemodeMale var.

Link to comment
Share on other sites

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
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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