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.

Dropping Weapons

Featured Replies

Hello!

I've been trying multiple times to make the player drop the weapon that is currently in his hand. I had tried DropToGround() but I think I didn't properly set it up and also I have tried the native, which is: 

NativeFunction.CallByName<uint>("SET_PED_DROPS_WEAPON", Game.LocalPlayer.Character);

That works, but the weapon is dropped right at the players feet, and he immediately picks the weapon up. 

How could I change it so he drops it a further in front of him?

Thanks!

“For a long time it puzzled me how something so expensive, so leading edge, could be so useless. And then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match.”

- Bill Bryson

  • Author
16 minutes ago, AlconH said:

Do you want to simply remove the weapon or do you want to create a pickup once dropped?

It doesn't matter, I would prefer to make it as a pickup.

Edited by CreepPork

“For a long time it puzzled me how something so expensive, so leading edge, could be so useless. And then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match.”

- Bill Bryson

  • Author
18 hours ago, Albo1125 said:

You could also set that the ped cannot pick weapons up if that's possible.

I don't think that exists, I'll do some digging, but if I set the player not to pick up weapons, that makes it more broken.

“For a long time it puzzled me how something so expensive, so leading edge, could be so useless. And then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match.”

- Bill Bryson

Why don't you create an object rather than a pickup?

/* Where modelHash is your weapon hash
* x,y,z is the ped position
* 1st bool is networkHandle
* 2nd bool is createHandle
* 3rd bool is dynamic
*/

NativeFunction.Natives.CreateObject(modelHash, x, y, z, true, true, true); 

or without the natives :

Rage.Object weapon;
Vector3 coords = myPed.Position;   // spawn position
string weaponModel = ""; // replace it with the objectname (not in hash)
weapon = new Rage.Object(weaponModel, coords); // as it is an object, it can not be picked up
NativeFunction.Natives.PlaceObjectOnGroundProperly(weapon); // just in case

 

Edited by winject

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.