Flying Scotsman Posted September 20, 2015 Share Posted September 20, 2015 (edited) 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 September 20, 2015 by Zemanez Link to comment Share on other sites More sharing options...
ClareXoBearrx3R9 Posted September 27, 2015 Share Posted September 27, 2015 (edited) 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 September 27, 2015 by ClareXoBearrx3 Link to comment Share on other sites More sharing options...
adv0cate Posted September 28, 2015 Share Posted September 28, 2015 (edited) 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 September 28, 2015 by adv0cate Link to comment Share on other sites More sharing options...
Flying Scotsman Posted September 28, 2015 Author Share Posted September 28, 2015 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 More sharing options...
FunGt Posted January 4, 2016 Share Posted January 4, 2016 (edited) 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 January 4, 2016 by FunGt Link to comment Share on other sites More sharing options...
Flying Scotsman Posted January 4, 2016 Author Share Posted January 4, 2016 (edited) 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 January 4, 2016 by Zemanez Link to comment Share on other sites More sharing options...
Zerovv Posted January 5, 2016 Share Posted January 5, 2016 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 More sharing options...
FunGt Posted January 6, 2016 Share Posted January 6, 2016 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now