Jump to content

Pistol Whip Mod, camera problem


Slasher_101

Recommended Posts

Slasher_101

Hi, Im making it so that you can use pistol whip in the PC version of gtaIV. All it takes is modifying some xbox/ps controls to pc controls and bam, you can pistol whip. So the only problem I have now is that when you click the mouse to hit someone, the camera starts zooming in as if you were shooting the gun. I'm guessing that this is because mouse click is also shoot.

 

It looks to me like the only way to change this would be to somehow assign the xbox control to a keyboard button. The ControlMap.dat file is encoded so I cant see if there are unused xbox controls there. On PC we only get attack 1 & 2, but on xbox/ps there seems to be attacks 1 - 4 so Im hoping that if I can somehow assign a keyboard / mouse button to attacks 3 & 4 then I wouldn't have the camera problem.

 

Any advice?

Link to comment
Share on other sites

well this is a coding forum so code a pistol whip mod to use another key

Edited by byteMe420

ALLAH AKBAR!!!

Link to comment
Share on other sites

What do you mean? Like hitting a nearby person with the under side of the pistol? (ammo location)

Link to comment
Share on other sites

Slasher_101

Yes, hitting them with the underside of the gun. OK sorry to ask such a simple question here, but how would you make an lua script that says when a key is pressed then do a primary attack or secondary attack or kick? All I know is IsKeyPressed(key)

Link to comment
Share on other sites

Well I don't think many people code GTA in Lua... mostly people use c++ to write asi mods or .net (C# or VB so the shdn.asi will load)

 

1. You need to detect ped's within range and ensure player is armed with a weapon that could be used to pistol whip (smg's too)

2. When a ped is found play the pistol whip animation and most likely there is an animation for the victim when being hit, so u play at the same time on the victim.

3. Wait until the appropriate time in the animation to trigger blood ptfx and damage to the peds health

4. Optionally u can add sounds or apply force or whatever u can think of

 

There is no code to just do it, u have to recreate it. Bind all that to a keypress and ur done.

Edited by byteMe420

ALLAH AKBAR!!!

Link to comment
Share on other sites

Slasher_101

Thanks for the reply

So are you telling me there's no way to code a keypress to do something like crouch or reload? Without actually coding all the animations etc over again. Like something that would effectively be binding a key to a control?

Link to comment
Share on other sites

Thanks for the reply

So are you telling me there's no way to code a keypress to do something like crouch or reload? Without actually coding all the animations etc over again. Like something that would effectively be binding a key to a control?

The game is programmed to act a certain way when the binded control is pressed so if you are unable to go to the keybinds and make the correct edits then yeah i would just code what i needed and in a way to not conflict with the normal actions of the game.

 

Now is it possible to accomplish what u are intending... I am sure it is possible but I've never dealt with what you are trying to do so I don't know how that would work. Any behavior i need in a game I would just try to script it and load with the scripthooks.

Edited by byteMe420

ALLAH AKBAR!!!

Link to comment
Share on other sites

InfamousSabre

A workaround would be to make the aim camera the same distance from the player as the usual game camera.
To change it, just press the camera button ('V') while aiming.

 

I would understand if that isn't acceptable though.

Edited by InfamousSabre
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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