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

    1. GrandTheftAuto.net - Website Re-Launch

    1. GTA Online

      1. The Diamond Casino Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

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

      1. Events
    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA 6

    3. GTA V

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

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

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    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. DYOM
      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. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

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

    1. Announcements

    2. Support

    3. Suggestions

Sign in to follow this  
ISOFX

Attach Object To Player

Recommended Posts

ISOFX

Hello, I have tried attaching an object to my player but i cant get it working. an example of attaching an object to a bone would be helpful. I also found a native but i tried everything to get it working but it doesnt work. Thanks.

 

A Native i found :

 

static void ATTACH_ENTITY_TO_ENTITY(Entity entity1, Entity entity2, int boneIndex, float x, float y, float z, float xRot, float yRot, float zRot, BOOL p9, BOOL isRel, BOOL ignoreUpVec, BOOL p12, int unk, BOOL p14) { invoke<Void>(0x6B9BBD38AB0796DF, entity1, entity2, boneIndex, x, y, z, xRot, yRot, zRot, p9, isRel, ignoreUpVec, p12, unk, p14); } // 0x6B9BBD38AB0796DF 0xEC024237

 

Thanks :)

Share this post


Link to post
Share on other sites
Fireboyd78

Do you have any code you've tried using?

Share this post


Link to post
Share on other sites
Vrock_wave

Hello, I have tried attaching an object to my player but i cant get it working. an example of attaching an object to a bone would be helpful. I also found a native but i tried everything to get it working but it doesnt work. Thanks.

 

A Native i found :

 

static void ATTACH_ENTITY_TO_ENTITY(Entity entity1, Entity entity2, int boneIndex, float x, float y, float z, float xRot, float yRot, float zRot, BOOL p9, BOOL isRel, BOOL ignoreUpVec, BOOL p12, int unk, BOOL p14) { invoke<Void>(0x6B9BBD38AB0796DF, entity1, entity2, boneIndex, x, y, z, xRot, yRot, zRot, p9, isRel, ignoreUpVec, p12, unk, p14); } // 0x6B9BBD38AB0796DF 0xEC024237

 

Thanks :)

I gave you this on YouTube

simply create an object before it (obj.rit3)

ENTITY::ATTACH_ENTITY_TO_ENTITY(obj.rit3, PLAYER.PLAYER_PED_ID(), PED.GET_PED_BONE_INDEX(PLAYER.PLAYER_PED_ID(), 60309), 0.07, 0.10, 0.0, 0.0, -90.0, -90.0, 0, 0, 0, 0, 2, 1);

 

is if you work in Lua it must be so

ENTITY.ATTACH_ENTITY_TO_ENTITY(obj.rit3, PLAYER.PLAYER_PED_ID(), PED.GET_PED_BONE_INDEX(PLAYER.PLAYER_PED_ID(), 60309), 0.07, 0.10, 0.0, 0.0, -90.0, -90.0, false, false, false, false, 2, true);

Edited by Vrock_wave

Share this post


Link to post
Share on other sites
kr0wns

ATTACH_ENTITY_TO_ENTITY(object, PedID, 0, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, 0.0f);

Share this post


Link to post
Share on other sites
Ben Lahyene

try that :

 

ATTACH_ENTITY_TO_ENTITY(object, pedID, boneIndex, float x, float y, float z, float xRot, float yRot, float zRot, 1, 1, 0, 0, 2, 1);

Edited by Ben Lahyene

Share this post


Link to post
Share on other sites
ISOFX

 

Hello, I have tried attaching an object to my player but i cant get it working. an example of attaching an object to a bone would be helpful. I also found a native but i tried everything to get it working but it doesnt work. Thanks.

 

A Native i found :

 

static void ATTACH_ENTITY_TO_ENTITY(Entity entity1, Entity entity2, int boneIndex, float x, float y, float z, float xRot, float yRot, float zRot, BOOL p9, BOOL isRel, BOOL ignoreUpVec, BOOL p12, int unk, BOOL p14) { invoke<Void>(0x6B9BBD38AB0796DF, entity1, entity2, boneIndex, x, y, z, xRot, yRot, zRot, p9, isRel, ignoreUpVec, p12, unk, p14); } // 0x6B9BBD38AB0796DF 0xEC024237

 

Thanks :)

I gave you this on YouTube

simply create an object before it (obj.rit3)

ENTITY::ATTACH_ENTITY_TO_ENTITY(obj.rit3, PLAYER.PLAYER_PED_ID(), PED.GET_PED_BONE_INDEX(PLAYER.PLAYER_PED_ID(), 60309), 0.07, 0.10, 0.0, 0.0, -90.0, -90.0, 0, 0, 0, 0, 2, 1);

 

is if you work in Lua it must be so

ENTITY.ATTACH_ENTITY_TO_ENTITY(obj.rit3, PLAYER.PLAYER_PED_ID(), PED.GET_PED_BONE_INDEX(PLAYER.PLAYER_PED_ID(), 60309), 0.07, 0.10, 0.0, 0.0, -90.0, -90.0, false, false, false, false, 2, true);

 

Where does the name of the object or hash go?

Share this post


Link to post
Share on other sites
Ben Lahyene

 

 

Hello, I have tried attaching an object to my player but i cant get it working. an example of attaching an object to a bone would be helpful. I also found a native but i tried everything to get it working but it doesnt work. Thanks.

 

A Native i found :

 

static void ATTACH_ENTITY_TO_ENTITY(Entity entity1, Entity entity2, int boneIndex, float x, float y, float z, float xRot, float yRot, float zRot, BOOL p9, BOOL isRel, BOOL ignoreUpVec, BOOL p12, int unk, BOOL p14) { invoke<Void>(0x6B9BBD38AB0796DF, entity1, entity2, boneIndex, x, y, z, xRot, yRot, zRot, p9, isRel, ignoreUpVec, p12, unk, p14); } // 0x6B9BBD38AB0796DF 0xEC024237

 

Thanks :)

I gave you this on YouTube

simply create an object before it (obj.rit3)

ENTITY::ATTACH_ENTITY_TO_ENTITY(obj.rit3, PLAYER.PLAYER_PED_ID(), PED.GET_PED_BONE_INDEX(PLAYER.PLAYER_PED_ID(), 60309), 0.07, 0.10, 0.0, 0.0, -90.0, -90.0, 0, 0, 0, 0, 2, 1);

 

is if you work in Lua it must be so

ENTITY.ATTACH_ENTITY_TO_ENTITY(obj.rit3, PLAYER.PLAYER_PED_ID(), PED.GET_PED_BONE_INDEX(PLAYER.PLAYER_PED_ID(), 60309), 0.07, 0.10, 0.0, 0.0, -90.0, -90.0, false, false, false, false, 2, true);

 

Where does the name of the object or hash go?

 

 

object = CREATE_OBJECT(get_hash_key("name of your prop"), float x, float y, float z, 1, 1, 0)
or
object = CREATE_OBJECT(hash of your prop, float x, float y, float z, 1, 1, 0)
add that before your attach entity to entity
Edited by Ben Lahyene

Share this post


Link to post
Share on other sites
ISOFX

 

 

 

Hello, I have tried attaching an object to my player but i cant get it working. an example of attaching an object to a bone would be helpful. I also found a native but i tried everything to get it working but it doesnt work. Thanks.

 

A Native i found :

 

static void ATTACH_ENTITY_TO_ENTITY(Entity entity1, Entity entity2, int boneIndex, float x, float y, float z, float xRot, float yRot, float zRot, BOOL p9, BOOL isRel, BOOL ignoreUpVec, BOOL p12, int unk, BOOL p14) { invoke<Void>(0x6B9BBD38AB0796DF, entity1, entity2, boneIndex, x, y, z, xRot, yRot, zRot, p9, isRel, ignoreUpVec, p12, unk, p14); } // 0x6B9BBD38AB0796DF 0xEC024237

 

Thanks :)

I gave you this on YouTube

simply create an object before it (obj.rit3)

ENTITY::ATTACH_ENTITY_TO_ENTITY(obj.rit3, PLAYER.PLAYER_PED_ID(), PED.GET_PED_BONE_INDEX(PLAYER.PLAYER_PED_ID(), 60309), 0.07, 0.10, 0.0, 0.0, -90.0, -90.0, 0, 0, 0, 0, 2, 1);

 

is if you work in Lua it must be so

ENTITY.ATTACH_ENTITY_TO_ENTITY(obj.rit3, PLAYER.PLAYER_PED_ID(), PED.GET_PED_BONE_INDEX(PLAYER.PLAYER_PED_ID(), 60309), 0.07, 0.10, 0.0, 0.0, -90.0, -90.0, false, false, false, false, 2, true);

 

Where does the name of the object or hash go?

 

 

object = CREATE_OBJECT(get_hash_key("name of your prop"), float x, float y, float z, 1, 1, 0)
or
object = CREATE_OBJECT(hash of your prop, float x, float y, float z, 1, 1, 0)
add that before your attach entity to entity

 

Can you give me an example of attaching an object to the players hand?

im confused on how to do it.

Thanks. :)

Share this post


Link to post
Share on other sites
Ben Lahyene

 

 

 

 

Hello, I have tried attaching an object to my player but i cant get it working. an example of attaching an object to a bone would be helpful. I also found a native but i tried everything to get it working but it doesnt work. Thanks.

 

A Native i found :

 

static void ATTACH_ENTITY_TO_ENTITY(Entity entity1, Entity entity2, int boneIndex, float x, float y, float z, float xRot, float yRot, float zRot, BOOL p9, BOOL isRel, BOOL ignoreUpVec, BOOL p12, int unk, BOOL p14) { invoke<Void>(0x6B9BBD38AB0796DF, entity1, entity2, boneIndex, x, y, z, xRot, yRot, zRot, p9, isRel, ignoreUpVec, p12, unk, p14); } // 0x6B9BBD38AB0796DF 0xEC024237

 

Thanks :)

I gave you this on YouTube

simply create an object before it (obj.rit3)

ENTITY::ATTACH_ENTITY_TO_ENTITY(obj.rit3, PLAYER.PLAYER_PED_ID(), PED.GET_PED_BONE_INDEX(PLAYER.PLAYER_PED_ID(), 60309), 0.07, 0.10, 0.0, 0.0, -90.0, -90.0, 0, 0, 0, 0, 2, 1);

 

is if you work in Lua it must be so

ENTITY.ATTACH_ENTITY_TO_ENTITY(obj.rit3, PLAYER.PLAYER_PED_ID(), PED.GET_PED_BONE_INDEX(PLAYER.PLAYER_PED_ID(), 60309), 0.07, 0.10, 0.0, 0.0, -90.0, -90.0, false, false, false, false, 2, true);

 

Where does the name of the object or hash go?

 

 

object = CREATE_OBJECT(get_hash_key("name of your prop"), float x, float y, float z, 1, 1, 0)
or
object = CREATE_OBJECT(hash of your prop, float x, float y, float z, 1, 1, 0)
add that before your attach entity to entity

 

Can you give me an example of attaching an object to the players hand?

im confused on how to do it.

Thanks. :)

 

 

change the bone index ( Right Hand = 57005 )

 

bone index : http://pastebin.com/D7JMnX1g

Edited by Ben Lahyene

Share this post


Link to post
Share on other sites
ffzero58

Here's the code sample in LUA (hope this works on mobile):

local DEV = {}	function DEV.spawnObject(modelName)		model = GAMEPLAY.GET_HASH_KEY(modelName)					if (STREAMING.IS_MODEL_IN_CDIMAGE(model) and STREAMING.IS_MODEL_VALID(model)) then				STREAMING.REQUEST_MODEL(model)				while (not STREAMING.HAS_MODEL_LOADED(model)) do wait(50) end				coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER.PLAYER_PED_ID(), 0.0, 5.0, 0.0)				obj = OBJECT.CREATE_OBJECT(model, coords.x, coords.y, coords.z, true, false, true)				OBJECT.PLACE_OBJECT_ON_GROUND_PROPERLY(obj)								STREAMING.SET_MODEL_AS_NO_LONGER_NEEDED(model)				ENTITY.SET_OBJECT_AS_NO_LONGER_NEEDED(obj)								return obj			else				print("Model hash not valid (" .. modelName .. ", ".. tostring(model))			end		end			function DEV.tick()		if(get_key_pressed(Keys.NumPad1)) then --N1 pressed			obj = DEV.spawnObject("p_cs_shot_glass_s")			ENTITY.ATTACH_ENTITY_TO_ENTITY(obj, PLAYER.PLAYER_PED_ID(), PED.GET_PED_BONE_INDEX(PLAYER.PLAYER_PED_ID(), 57005), 0.07, 0.10, 0.0, 0.0, -90.0, -90.0, false, false, false, false, 2, true);			wait(200)		end	end	return DEV

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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