ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!
Home
Upgrade
Credits
Help
Search
Awards
Achievements
 2258

Need Help Attaching Ped to SelectedPlayer

by XBLxPhantom - 11-26-2018 - 09:03 PM
#1
Quote:
Code:
void AttachMurderer(Hash model)
{
    int onped = PLAYER::GET_PLAYER_PED(selectedPlayer);
    Vector3 pedcoords = ENTITY::GET_ENTITY_COORDS(onped, true);
    int head65 = PED::GET_PED_BONE_INDEX(PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()), 31086);
    int PedHash = (model);
    if (STREAMING::IS_MODEL_IN_CDIMAGE(PedHash))
    {
        if (STREAMING::IS_MODEL_VALID(PedHash))
        {
            STREAMING::REQUEST_MODEL(PedHash);
            if (STREAMING::HAS_MODEL_LOADED(PedHash))
            {
                int ped = PED::CREATE_PED(21, PedHash, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, true, false);
                ENTITY::ATTACH_ENTITY_TO_ENTITY(ped, onped, head65, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, 0.0f, 0.0f, true, true, true, false, 1, false);
                ENTITY::ATTACH_ENTITY_TO_ENTITY_PHYSICALLY(ped, onped, pedcoords.x, pedcoords.y, pedcoords.x, pedcoords.y, pedcoords.z, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, 0.0f, 0.0f, true, true, true, false, true, true);
                ENTITY::SET_ENTITY_PROOFS(ped, true, true, true, false, true, true, true, true);
                WEAPON::GIVE_DELAYED_WEAPON_TO_PED(ped, 0x63AB0442, 9999, true);
                WEAPON::SET_PED_INFINITE_AMMO_CLIP(ped, true);
                AI::TASK_SHOOT_AT_ENTITY(ped, onped, 5000, 0xC6EE6B4C);
                NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(ped);
            }
        }
    }
}

This is what i've gotten so far. It spawns the ped on the player coords  BUT it will not attach. what am I missing?
Reply
#2
(11-26-2018 - 09:03 PM)XBLxPhantom Wrote:
Quote:
Code:
void AttachMurderer(Hash model)
{
    int onped = PLAYER::GET_PLAYER_PED(selectedPlayer);
    Vector3 pedcoords = ENTITY::GET_ENTITY_COORDS(onped, true);
    int head65 = PED::GET_PED_BONE_INDEX(PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()), 31086);
    int PedHash = (model);
    if (STREAMING::IS_MODEL_IN_CDIMAGE(PedHash))
    {
        if (STREAMING::IS_MODEL_VALID(PedHash))
        {
            STREAMING::REQUEST_MODEL(PedHash);
            if (STREAMING::HAS_MODEL_LOADED(PedHash))
            {
                int ped = PED::CREATE_PED(21, PedHash, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, true, false);
                ENTITY::ATTACH_ENTITY_TO_ENTITY(ped, onped, head65, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, 0.0f, 0.0f, true, true, true, false, 1, false);
                ENTITY::ATTACH_ENTITY_TO_ENTITY_PHYSICALLY(ped, onped, pedcoords.x, pedcoords.y, pedcoords.x, pedcoords.y, pedcoords.z, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, 0.0f, 0.0f, true, true, true, false, true, true);
                ENTITY::SET_ENTITY_PROOFS(ped, true, true, true, false, true, true, true, true);
                WEAPON::GIVE_DELAYED_WEAPON_TO_PED(ped, 0x63AB0442, 9999, true);
                WEAPON::SET_PED_INFINITE_AMMO_CLIP(ped, true);
                AI::TASK_SHOOT_AT_ENTITY(ped, onped, 5000, 0xC6EE6B4C);
                NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(ped);
            }
        }
    }
}

This is what i've gotten so far. It spawns the ped on the player coords  BUT it will not attach. what am I missing?

Code:
int head65 = PED::GET_PED_BONE_INDEX(PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()), 31086);
//to
int head65 = PED::GET_PED_BONE_INDEX(onped, 31086);
This account is currently banned
Ban reason: Leeching and Spamming is not allowed, please read the forum Rules upon your return.
Reply
#3
(11-26-2018 - 09:10 PM)NoNameV2345 Wrote:
(11-26-2018 - 09:03 PM)XBLxPhantom Wrote:
Quote:
Code:
void AttachMurderer(Hash model)
{
    int onped = PLAYER::GET_PLAYER_PED(selectedPlayer);
    Vector3 pedcoords = ENTITY::GET_ENTITY_COORDS(onped, true);
    int head65 = PED::GET_PED_BONE_INDEX(PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()), 31086);
    int PedHash = (model);
    if (STREAMING::IS_MODEL_IN_CDIMAGE(PedHash))
    {
        if (STREAMING::IS_MODEL_VALID(PedHash))
        {
            STREAMING::REQUEST_MODEL(PedHash);
            if (STREAMING::HAS_MODEL_LOADED(PedHash))
            {
                int ped = PED::CREATE_PED(21, PedHash, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, true, false);
                ENTITY::ATTACH_ENTITY_TO_ENTITY(ped, onped, head65, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, 0.0f, 0.0f, true, true, true, false, 1, false);
                ENTITY::ATTACH_ENTITY_TO_ENTITY_PHYSICALLY(ped, onped, pedcoords.x, pedcoords.y, pedcoords.x, pedcoords.y, pedcoords.z, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, 0.0f, 0.0f, true, true, true, false, true, true);
                ENTITY::SET_ENTITY_PROOFS(ped, true, true, true, false, true, true, true, true);
                WEAPON::GIVE_DELAYED_WEAPON_TO_PED(ped, 0x63AB0442, 9999, true);
                WEAPON::SET_PED_INFINITE_AMMO_CLIP(ped, true);
                AI::TASK_SHOOT_AT_ENTITY(ped, onped, 5000, 0xC6EE6B4C);
                NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(ped);
            }
        }
    }
}

This is what i've gotten so far. It spawns the ped on the player coords  BUT it will not attach. what am I missing?

Code:
int head65 = PED::GET_PED_BONE_INDEX(PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()), 31086);
//to
int head65 = PED::GET_PED_BONE_INDEX(onped, 31086);
ahh okay. thanks.
Reply
#4
(11-26-2018 - 09:10 PM)NoNameV2345 Wrote:
(11-26-2018 - 09:03 PM)XBLxPhantom Wrote:
Quote:
Code:
void AttachMurderer(Hash model)
{
    int onped = PLAYER::GET_PLAYER_PED(selectedPlayer);
    Vector3 pedcoords = ENTITY::GET_ENTITY_COORDS(onped, true);
    int head65 = PED::GET_PED_BONE_INDEX(PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()), 31086);
    int PedHash = (model);
    if (STREAMING::IS_MODEL_IN_CDIMAGE(PedHash))
    {
        if (STREAMING::IS_MODEL_VALID(PedHash))
        {
            STREAMING::REQUEST_MODEL(PedHash);
            if (STREAMING::HAS_MODEL_LOADED(PedHash))
            {
                int ped = PED::CREATE_PED(21, PedHash, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, true, false);
                ENTITY::ATTACH_ENTITY_TO_ENTITY(ped, onped, head65, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, 0.0f, 0.0f, true, true, true, false, 1, false);
                ENTITY::ATTACH_ENTITY_TO_ENTITY_PHYSICALLY(ped, onped, pedcoords.x, pedcoords.y, pedcoords.x, pedcoords.y, pedcoords.z, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, 0.0f, 0.0f, true, true, true, false, true, true);
                ENTITY::SET_ENTITY_PROOFS(ped, true, true, true, false, true, true, true, true);
                WEAPON::GIVE_DELAYED_WEAPON_TO_PED(ped, 0x63AB0442, 9999, true);
                WEAPON::SET_PED_INFINITE_AMMO_CLIP(ped, true);
                AI::TASK_SHOOT_AT_ENTITY(ped, onped, 5000, 0xC6EE6B4C);
                NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(ped);
            }
        }
    }
}

This is what i've gotten so far. It spawns the ped on the player coords  BUT it will not attach. what am I missing?

Code:
int head65 = PED::GET_PED_BONE_INDEX(PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()), 31086);
//to
int head65 = PED::GET_PED_BONE_INDEX(onped, 31086);

ped still doesn't attach lol
Reply
#5
(11-30-2018 - 05:00 PM)XBLxPhantom Wrote:
(11-26-2018 - 09:10 PM)NoNameV2345 Wrote:
(11-26-2018 - 09:03 PM)XBLxPhantom Wrote:
Quote:
Code:
void AttachMurderer(Hash model)
{
    int onped = PLAYER::GET_PLAYER_PED(selectedPlayer);
    Vector3 pedcoords = ENTITY::GET_ENTITY_COORDS(onped, true);
    int head65 = PED::GET_PED_BONE_INDEX(PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()), 31086);
    int PedHash = (model);
    if (STREAMING::IS_MODEL_IN_CDIMAGE(PedHash))
    {
        if (STREAMING::IS_MODEL_VALID(PedHash))
        {
            STREAMING::REQUEST_MODEL(PedHash);
            if (STREAMING::HAS_MODEL_LOADED(PedHash))
            {
                int ped = PED::CREATE_PED(21, PedHash, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, true, false);
                ENTITY::ATTACH_ENTITY_TO_ENTITY(ped, onped, head65, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, 0.0f, 0.0f, true, true, true, false, 1, false);
                ENTITY::ATTACH_ENTITY_TO_ENTITY_PHYSICALLY(ped, onped, pedcoords.x, pedcoords.y, pedcoords.x, pedcoords.y, pedcoords.z, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, 0.0f, 0.0f, true, true, true, false, true, true);
                ENTITY::SET_ENTITY_PROOFS(ped, true, true, true, false, true, true, true, true);
                WEAPON::GIVE_DELAYED_WEAPON_TO_PED(ped, 0x63AB0442, 9999, true);
                WEAPON::SET_PED_INFINITE_AMMO_CLIP(ped, true);
                AI::TASK_SHOOT_AT_ENTITY(ped, onped, 5000, 0xC6EE6B4C);
                NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(ped);
            }
        }
    }
}

This is what i've gotten so far. It spawns the ped on the player coords  BUT it will not attach. what am I missing?

Code:
int head65 = PED::GET_PED_BONE_INDEX(PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()), 31086);
//to
int head65 = PED::GET_PED_BONE_INDEX(onped, 31086);

ped still doesn't attach lol

edit current natives to:
Code:
void ATTACH_ENTITY_TO_ENTITY(Entity entity1, Entity entity2, int boneIndex, float xPos, float yPos, float zPos, float xRot, float yRot, float zRot, BOOL p9, BOOL useSoftPinning, BOOL collision, BOOL isPed, int vertexIndex, BOOL fixedRot)
This account is currently banned
Ban reason: Leeching and Spamming is not allowed, please read the forum Rules upon your return.
Reply
#6
(11-30-2018 - 08:01 PM)NoNameV2345 Wrote:
(11-30-2018 - 05:00 PM)XBLxPhantom Wrote:
(11-26-2018 - 09:10 PM)NoNameV2345 Wrote:
(11-26-2018 - 09:03 PM)XBLxPhantom Wrote:
Quote:
Code:
void AttachMurderer(Hash model)
{
    int onped = PLAYER::GET_PLAYER_PED(selectedPlayer);
    Vector3 pedcoords = ENTITY::GET_ENTITY_COORDS(onped, true);
    int head65 = PED::GET_PED_BONE_INDEX(PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()), 31086);
    int PedHash = (model);
    if (STREAMING::IS_MODEL_IN_CDIMAGE(PedHash))
    {
        if (STREAMING::IS_MODEL_VALID(PedHash))
        {
            STREAMING::REQUEST_MODEL(PedHash);
            if (STREAMING::HAS_MODEL_LOADED(PedHash))
            {
                int ped = PED::CREATE_PED(21, PedHash, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, true, false);
                ENTITY::ATTACH_ENTITY_TO_ENTITY(ped, onped, head65, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, 0.0f, 0.0f, true, true, true, false, 1, false);
                ENTITY::ATTACH_ENTITY_TO_ENTITY_PHYSICALLY(ped, onped, pedcoords.x, pedcoords.y, pedcoords.x, pedcoords.y, pedcoords.z, pedcoords.x, pedcoords.y, pedcoords.z, 0.0f, 0.0f, 0.0f, true, true, true, false, true, true);
                ENTITY::SET_ENTITY_PROOFS(ped, true, true, true, false, true, true, true, true);
                WEAPON::GIVE_DELAYED_WEAPON_TO_PED(ped, 0x63AB0442, 9999, true);
                WEAPON::SET_PED_INFINITE_AMMO_CLIP(ped, true);
                AI::TASK_SHOOT_AT_ENTITY(ped, onped, 5000, 0xC6EE6B4C);
                NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(ped);
            }
        }
    }
}

This is what i've gotten so far. It spawns the ped on the player coords  BUT it will not attach. what am I missing?

Code:
int head65 = PED::GET_PED_BONE_INDEX(PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()), 31086);
//to
int head65 = PED::GET_PED_BONE_INDEX(onped, 31086);

ped still doesn't attach lol

edit current natives to:
Code:
void ATTACH_ENTITY_TO_ENTITY(Entity entity1, Entity entity2, int boneIndex, float xPos, float yPos, float zPos, float xRot, float yRot, float zRot, BOOL p9, BOOL useSoftPinning, BOOL collision, BOOL isPed, int vertexIndex, BOOL fixedRot)

cool thank u :)
Reply
#7
(12-01-2018 - 02:48 PM)JeffDev Wrote:
(11-30-2018 - 08:01 PM)NoNameV2345 Wrote:
(11-30-2018 - 05:00 PM)XBLxPhantom Wrote:
(11-26-2018 - 09:10 PM)NoNameV2345 Wrote:
(11-26-2018 - 09:03 PM)XBLxPhantom Wrote: This is what i've gotten so far. It spawns the ped on the player coords  BUT it will not attach. what am I missing?

Code:
int head65 = PED::GET_PED_BONE_INDEX(PLAYER::GET_PLAYER_PED(PLAYER::PLAYER_ID()), 31086);
//to
int head65 = PED::GET_PED_BONE_INDEX(onped, 31086);

ped still doesn't attach lol

edit current natives to:
Code:
void ATTACH_ENTITY_TO_ENTITY(Entity entity1, Entity entity2, int boneIndex, float xPos, float yPos, float zPos, float xRot, float yRot, float zRot, BOOL p9, BOOL useSoftPinning, BOOL collision, BOOL isPed, int vertexIndex, BOOL fixedRot)

cool thank u :)

np
This account is currently banned
Ban reason: Leeching and Spamming is not allowed, please read the forum Rules upon your return.
Reply
#8
Very useful this post, will help many people. Thank you all.
[Image: a8keeuutawx01.gif]
Reply

Users browsing: 1 Guest(s)