Jump to content

How to make ped shoot from car and how to make ped have beer bottle in hand


OneSimpleDuck

Recommended Posts

Alright, 2 questions in one go. 

 

1) How do I have ped have an alcohol bottle in hand? I know it is probably something like ped.Inventory.GiveNewWeapon() but I don't know what the WeaponHash for an alcohol bottle is. I have tried to search it, did not find anything. It should be like a beer bottle, a full big beer bottle.

 

2) How do I make the ped shoot from inside the car? I have tried everything I can thing of but the pet just would not shoot at the player when inside the car. How can I fix this?

GRAY

Link to comment
Share on other sites

For first one I am not sure about that but you can try this to obtain an object like bottle (Entity.AttachTo) you can also use an animation to make a ped drunk.

 

For second one you can try this native...

 

NativeFunction.Natives.SetPedCombatAttributes(suspect, 1, true);

//This allows the driver to stay in the vehicle,and he will drive the vehicle as long as it's possible. Then you can call the fight
suspect.Tasks.FightAgainst(Game.LocalPlayer.Character);
Edited by Dark Devil
Link to comment
Share on other sites

2 hours ago, Dark Devil said:

For first one I am not sure about that but you can try this to obtain an object like bottle (Entity.AttachTo) you can also use an animation to make a ped drunk.

 

For second one you can try this native...

 

NativeFunction.Natives.SetPedCombatAttributes(suspect, 1, true);

//This allows the driver to stay in the vehicle,and he will drive the vehicle as long as it's possible. Then you can call the fight
suspect.Tasks.FightAgainst(Game.LocalPlayer.Character);

Thanks, godsend

Edited by PTurtle

GRAY

Link to comment
Share on other sites

  • 2 weeks later...
On 10/13/2021 at 4:25 PM, Dark Devil said:

For first one I am not sure about that but you can try this to obtain an object like bottle (Entity.AttachTo) you can also use an animation to make a ped drunk.

 

For second one you can try this native...

 

NativeFunction.Natives.SetPedCombatAttributes(suspect, 1, true);

//This allows the driver to stay in the vehicle,and he will drive the vehicle as long as it's possible. Then you can call the fight
suspect.Tasks.FightAgainst(Game.LocalPlayer.Character);

Hey, another clarification. Is is supposed to be FightAgainst or FireWeaponAt is also fine?

GRAY

Link to comment
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.



×
×
  • Create New...