CocaColaBear / types-ragemp-c

Rage:MP TypeScript type definition for Client-side
https://rage.mp/
MIT License
53 stars 60 forks source link

PedMp costumization #56

Closed ynhhoJ closed 4 years ago

pixlcrashr commented 4 years ago

Where is the changelog source for these changes?

ynhhoJ commented 4 years ago

You can test it on RAGE MP. For players works variant from wiki: https://wiki.rage.mp/index.php?title=Player::setHeadOverlay - player.setHeadOverlay(1, 4, 0.99, 1, 1);

But if you try to use that on ped, this way doesn't work.

You need to use 3 arguments, like in native: image And then change color of element with setHeadOverlayColor. Idk why, but for ped costumization we need to use that way.

// Doesn't work
mp.keys.bind(0x71, true, function() { // F2
    const ped = mp.peds.new(mp.game.joaat('mp_m_freemode_01'), mp.players.local.position, mp.players.local.getHeading(), mp.players.local.dimension);
    setTimeout(() => {
        ped.setHeadBlendData(1, 1, 0, 1, 1, 0, 1, 1, 0, false);
        ped.setHeadOverlay(1, 4, 0.99, 1, 1);
    }, 500);
});
//works 
mp.keys.bind(0x71, true, function() { // F2
    const ped = mp.peds.new(mp.game.joaat('mp_m_freemode_01'), mp.players.local.position, mp.players.local.getHeading(), mp.players.local.dimension);
    setTimeout(() => {
        ped.setHeadBlendData(1, 1, 0, 1, 1, 0, 1, 1, 0, false);
        ped.setHeadOverlay(1, 4, 0.99);
        ped.setHeadOverlayColor(1, 1, 1, 1);
    }, 500);
});
pixlcrashr commented 4 years ago

Good job so far but you are missing one method setHeadBlendData.

pixlcrashr commented 4 years ago

Just to be sure: Are these changes related to the upcoming v. 1.0 or are these changes also valid for v. 0.3.7.2?

ynhhoJ commented 4 years ago

Like i know, It should works in 0.3.7 in the same way. But we need to do some tests to be shure 100%

pixlcrashr commented 4 years ago

Please test it, since we would merge directly into master.

ynhhoJ commented 4 years ago

Yep, it's also works in 0.3.7!