Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How can I make my spawned ped hold an object (i.e. a cigar, cellphone, etc..)?

Featured Replies

So I have been trying to use functions like

void GIVE_WEAPON_OBJECT_TO_PED(Object weaponObject, Ped ped)

and

void ATTACH_ENTITY_TO_ENTITY(Entity entity1, Entity entity2, int boneIndex,
  ...)

or

.AttachTo();

to try and make my spawned ped hold a cigar in his/her hand but none of them have worked.

The closest I have gotten was to just spawn the cigar in game (floating in mid-air or on the ground), without the peds holding them like they should.

Does somebody know of a good (or working) way to make a spawned ped hold a spawned object?

Thanks,

minipunch

Edited by minipunch

I have some code for this back home but am traveling at the moment. For weapons the process is different from objects. For objects, first spawn the object, then use .AttachTo. The difficult part is getting the right bone ID. You have to use a native for it, and pass in one of the ped bone ID enum values. There's example code our there on the web, but if you havent figured it out by the time I get home I'll post some code for you. 

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

  • Author
12 hours ago, PNWParksFan said:

I have some code for this back home but am traveling at the moment. For weapons the process is different from objects. For objects, first spawn the object, then use .AttachTo. The difficult part is getting the right bone ID. You have to use a native for it, and pass in one of the ped bone ID enum values. There's example code our there on the web, but if you havent figured it out by the time I get home I'll post some code for you. 

You have the right idea I believe! Because the post below explains what you say to do pretty much!

3 hours ago, ainesophaur said:

Was going through the rage forums last night and came across this

http://forums.ragepluginhook.net/default.aspx?g=posts&t=543

I think that's it! I am going to try it out right now. Thanks a lot partner!!

I'll edit this post right down here to let you know if it works like I want after I try it out!

EDIT: yes, it works like a charm. Thank you @ainesophaur and @PNWParksFan!

Edited by minipunch

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

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.