Jump to content

[Q]How can i change CJ's starting clothes?


Recommended Posts

DYOMMissionMaker
Hi,

what must i do because i want to change CJ's starting clothes?

 

When i start a new game CJ starts with a white vest,blue jeans and black shoes and cesar haircut.

So, what must i do because i want that he starts with other clothes and haircut?

 

Thanks.

Change the main.scm to load the clothes at the start of the game i'm not giving a tutorial though tounge2.gif

Ops.I have got a problem.I made cj start with The Blue hoody, the beige chinos and the brown boots (the clothes are from the clothes shop ZIP) and the cornrows haircut but,when i finish the mission Sweet e Kendl and i go to the Jhonson house and next to the wardrobe these clothes aren't in the wardrobe.How can i fix this problem?

  • 6 years later...
Hamzeol Murf

What Do You Mean By Line 988-991? There's This String For Intro Clothing

set_weather 1
Player.SetClothes($PLAYER_CHAR, "VEST", "VEST", Torso)
Player.SetClothes($PLAYER_CHAR, "JEANSDENIM", "JEANS", Legs)
Player.SetClothes($PLAYER_CHAR, "SNEAKERBINCBLK", "SNEAKER", Shoes)
Player.SetClothes($PLAYER_CHAR, "PLAYER_FACE", "HEAD", Head)
$2549 = 1
Player.Build($PLAYER_CHAR)
0793: save_player_clothes
0169: set_fade_color_RGB 0 0 0
fade 0 0
But The Game Crashes After I Change The Clothe Models

 

What Do You Mean By Line 988-991? There's This String For Intro Clothing

set_weather 1
Player.SetClothes($PLAYER_CHAR, "VEST", "VEST", Torso)
Player.SetClothes($PLAYER_CHAR, "JEANSDENIM", "JEANS", Legs)
Player.SetClothes($PLAYER_CHAR, "SNEAKERBINCBLK", "SNEAKER", Shoes)
Player.SetClothes($PLAYER_CHAR, "PLAYER_FACE", "HEAD", Head)
$2549 = 1
Player.Build($PLAYER_CHAR)
0793: save_player_clothes
0169: set_fade_color_RGB 0 0 0
fade 0 0
But The Game Crashes After I Change The Clothe Models

 

 

Don't Bump old threads, also make sure you have the TEXTURE First, and THEN THE DFF MODEL

 

so it does like this:

 

"PLAYER_TEXT", "DFFMODEL", Head

kYDAqWl.png

 

 

This right here.

 

Press F12 in sanny builder and this should come up:

 

 

VtI9RPt.png

 

 

 

 

This is the sanny builder help section.

 

 

Click on SCM Documentation

 

then Click on GTA SA

 

Then Click on one of the clothes options.

 

 

 

 

 

 

 

Send me your script.

Edited by deltaCJ

In case if you don't want to touch main.scm, here you go ;)

 

 

#include "plugin.h"#include "game_sa\CWorld.h"#include "game_sa\CRunningScript.h"using namespace plugin;class CustomClothes {public:    CustomClothes() {        static ThiscallEvent<AddressList<0x471A74, H_CALL>, PRIORITY_AFTER, ArgPickN<CRunningScript*, 0>, void(CRunningScript*, int)> onClothesOpcodeCollect;        static ThiscallEvent<AddressList<0x471AD0, H_CALL>, PRIORITY_AFTER, ArgPickN<int, 3>, void(void*, char *, char *, int)> onClothesOpcodeSetClothes;        static char *pszCurrentScriptName;        static int nCurrentPlayer;        static config_file config(PLUGIN_PATH("player_clothes.dat"));        onClothesOpcodeCollect += [](CRunningScript *script) {            pszCurrentScriptName = script->m_szName; // save current thread name            nCurrentPlayer = *reinterpret_cast<int *>(0xA43C78); // get player id        };        onClothesOpcodeSetClothes += [](int bodyPartId) {            if (!_stricmp(pszCurrentScriptName, "MAIN") && nCurrentPlayer == 0) { // if we are in MAIN thread                CPedClothesDesc *desc = CWorld::Players[0].m_pPed->m_pPlayerData->m_pPedClothesDesc;                switch (bodyPartId) {                case 0:                    CallMethod<0x5A8080>(desc, config["TORSO_TEXTURE"].asString("VEST").c_str(), config["TORSO_MODEL"].asString("VEST").c_str(), 0);                    break;                case 1:                    CallMethod<0x5A8080>(desc, config["HEAD_TEXTURE"].asString("PLAYER_FACE").c_str(), config["HEAD_MODEL"].asString("HEAD").c_str(), 1);                    break;                case 2:                    CallMethod<0x5A8080>(desc, config["LEGS_TEXTURE"].asString("JEANSDENIM").c_str(), config["LEGS_MODEL"].asString("JEANS").c_str(), 2);                    break;                case 3:                    CallMethod<0x5A8080>(desc, config["SHOES_TEXTURE"].asString("SNEAKERBINCBLK").c_str(), config["SHOES_MODEL"].asString("SNEAKER").c_str(), 3);                    break;                }            }        };    }} myPlugin;
And the config file will look like this

 

 

TORSO_TEXTURE "TSHIRTMADDGREY"TORSO_MODEL   "TSHIRT"HEAD_TEXTURE  "PLAYER_FACE"HEAD_MODEL    "HEAD"LEGS_TEXTURE  "SHORTSKHAKI"LEGS_MODEL    "SHORTS"SHOES_TEXTURE "BASK1ERIS"SHOES_MODEL   "BASK1"
CustomClothes.asi

player_clothes.dat

Edited by DK22Pac
  • 1 year later...
On 12/30/2010 at 12:30 PM, ValerioV said:

Ops.I have got a problem.I made cj start with The Blue hoody, the beige chinos and the brown boots (the clothes are from the clothes shop ZIP) and the cornrows haircut but,when i finish the mission Sweet e Kendl and i go to the Jhonson house and next to the wardrobe these clothes aren't in the wardrobe.How can i fix this problem?

Quick question, how in the name of hell did you manage to do that? I am editing the starting clothes in main.scm and nothing is changing. 

  • 1 year later...
  • 2 years later...
  • 8 months later...
topraksaymann
On 4/22/2017 at 3:12 AM, DK22Pac said:

In case if you don't want to touch main.scm, here you go

 

 

#include "plugin.h"#include "game_sa\CWorld.h"#include "game_sa\CRunningScript.h"using namespace plugin;class CustomClothes {public:    CustomClothes() {        static ThiscallEvent<AddressList<0x471A74, H_CALL>, PRIORITY_AFTER, ArgPickN<CRunningScript*, 0>, void(CRunningScript*, int)> onClothesOpcodeCollect;        static ThiscallEvent<AddressList<0x471AD0, H_CALL>, PRIORITY_AFTER, ArgPickN<int, 3>, void(void*, char *, char *, int)> onClothesOpcodeSetClothes;        static char *pszCurrentScriptName;        static int nCurrentPlayer;        static config_file config(PLUGIN_PATH("player_clothes.dat"));        onClothesOpcodeCollect += [](CRunningScript *script) {            pszCurrentScriptName = script->m_szName; // save current thread name            nCurrentPlayer = *reinterpret_cast<int *>(0xA43C78); // get player id        };        onClothesOpcodeSetClothes += [](int bodyPartId) {            if (!_stricmp(pszCurrentScriptName, "MAIN") && nCurrentPlayer == 0) { // if we are in MAIN thread                CPedClothesDesc *desc = CWorld::Players[0].m_pPed->m_pPlayerData->m_pPedClothesDesc;                switch (bodyPartId) {                case 0:                    CallMethod<0x5A8080>(desc, config["TORSO_TEXTURE"].asString("VEST").c_str(), config["TORSO_MODEL"].asString("VEST").c_str(), 0);                    break;                case 1:                    CallMethod<0x5A8080>(desc, config["HEAD_TEXTURE"].asString("PLAYER_FACE").c_str(), config["HEAD_MODEL"].asString("HEAD").c_str(), 1);                    break;                case 2:                    CallMethod<0x5A8080>(desc, config["LEGS_TEXTURE"].asString("JEANSDENIM").c_str(), config["LEGS_MODEL"].asString("JEANS").c_str(), 2);                    break;                case 3:                    CallMethod<0x5A8080>(desc, config["SHOES_TEXTURE"].asString("SNEAKERBINCBLK").c_str(), config["SHOES_MODEL"].asString("SNEAKER").c_str(), 3);                    break;                }            }        };    }} myPlugin;

And the config file will look like this

 

 

TORSO_TEXTURE "TSHIRTMADDGREY"TORSO_MODEL   "TSHIRT"HEAD_TEXTURE  "PLAYER_FACE"HEAD_MODEL    "HEAD"LEGS_TEXTURE  "SHORTSKHAKI"LEGS_MODEL    "SHORTS"SHOES_TEXTURE "BASK1ERIS"SHOES_MODEL   "BASK1"

CustomClothes.asi

player_clothes.dat

So uh, both of these files are gone.
What do I do?

Edited by topraksaymann
forgot things
1 hour ago, topraksaymann said:

So uh, both of these files are gone.
What do I do?

your code is broken.. use these instead..

 

#include "plugin.h"
#include "game_sa\CWorld.h"
#include "game_sa\CRunningScript.h"

using namespace plugin;

class CustomClothes {
public:
    CustomClothes() {
        static ThiscallEvent<AddressList<0x471A74, H_CALL>, PRIORITY_AFTER, ArgPickN<CRunningScript*, 0>, void(CRunningScript*, int)> onClothesOpcodeCollect;
        static ThiscallEvent<AddressList<0x471AD0, H_CALL>, PRIORITY_AFTER, ArgPickN<int, 3>, void(void*, char *, char *, int)> onClothesOpcodeSetClothes;
        static char *pszCurrentScriptName;
        static int nCurrentPlayer;

        static config_file config(PLUGIN_PATH("player_clothes.dat"));

        onClothesOpcodeCollect += [](CRunningScript *script) {
            pszCurrentScriptName = script->threadName; // save current thread name
            nCurrentPlayer = *reinterpret_cast<int *>(0xA43C78); // get player id
        };

        onClothesOpcodeSetClothes += [](int bodyPartId) {
            if (!_stricmp(pszCurrentScriptName, "MAIN") && nCurrentPlayer == 0) { // if we are in MAIN thread
                CClothes *desc = CWorld::Players[0].m_pPed->m_pPlayerData->m_pClothes;
                switch (bodyPartId) {
                case 0:
                    CallMethod<0x5A8080>(desc, config["TORSO_TEXTURE"].asString("VEST").c_str(), config["TORSO_MODEL"].asString("VEST").c_str(), 0);
                    break;
                case 1:
                    CallMethod<0x5A8080>(desc, config["HEAD_TEXTURE"].asString("PLAYER_FACE").c_str(), config["HEAD_MODEL"].asString("HEAD").c_str(), 1);
                    break;
                case 2:
                    CallMethod<0x5A8080>(desc, config["LEGS_TEXTURE"].asString("JEANSDENIM").c_str(), config["LEGS_MODEL"].asString("JEANS").c_str(), 2);
                    break;
                case 3:
                    CallMethod<0x5A8080>(desc, config["SHOES_TEXTURE"].asString("SNEAKERBINCBLK").c_str(), config["SHOES_MODEL"].asString("SNEAKER").c_str(), 3);
                    break;
                }
            }
        };
    }
} myPlugin;

 

TORSO_TEXTURE "TSHIRTMADDGREY"
TORSO_MODEL   "TSHIRT"
HEAD_TEXTURE  "PLAYER_FACE"
HEAD_MODEL    "HEAD"
LEGS_TEXTURE  "SHORTSKHAKI"
LEGS_MODEL    "SHORTS"
SHOES_TEXTURE "BASK1ERIS"
SHOES_MODEL   "BASK1"

and his asi/dat files seems no longer exist.. you should try send a P.M instead of writing here 🙂

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
  • 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.