AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Reducing Recoil In CS: Source (https://forums.alliedmods.net/showthread.php?t=94249)

SamuraiBarbi 06-08-2009 21:52

Reducing Recoil In CS: Source
 
Does anyone know how I can reduce recoil for clients but from the serverside in Counter Strike Source? I looked over some weaponmod script for eventscripts that has a recoil modification feature but it's been ages since I've coded anything in ES and it all just looks like <insert foreign language here>.

Greyscale 06-08-2009 22:46

Re: Reducing Recoil In CS: Source
 
I believe recoil uses vecPunch (or something like that) so resetting that to 0 on weapon_fire works.. kinda. It's really choppy. And that makes no recoil at all, limiting would be a little more complicated.

SamuraiBarbi 06-08-2009 23:10

Re: Reducing Recoil In CS: Source
 
When I try doing the following during weapon_fire event, it doesn't seem to reduce recoil at all.

Code:

new Float:attacker_playerPunchAnglePost[3] = {0.0,0.0,0.0};

SetEntPropVector(attacker_playerClient, Prop_Send, "m_vecPunchAngle", attacker_playerPunchAnglePost);

What am I doing wrong here?

SAMURAI16 06-09-2009 05:21

Re: Reducing Recoil In CS: Source
 
set that in ClientPrethink

SamuraiBarbi 06-09-2009 10:54

Re: Reducing Recoil In CS: Source
 
I'm sorry to be a stick in the mud but is it necessary that I set it in ClientPrethink? The first two posts here, https://forums.alliedmods.net/showth...chAngle&page=2 , seem to imply that it can be done in weapon_fire.

SAMURAI16 06-09-2009 10:59

Re: Reducing Recoil In CS: Source
 
IIRC last time I used in Prethink

SamuraiBarbi 06-10-2009 12:25

Re: Reducing Recoil In CS: Source
 
Ok I'm still working on this. When setting modifying recoil in event pre weapon_fire I noticed two things

Code:

new Float:attacker_playerPunchAnglePost[3] = {0.0,0.0,0.0};
                        SetEntDataVector(attacker_playerClient,offset_PlayerPunchAngle,attacker_playerPunchAnglePost,false);

Does nothing. But... changing

Code:

new Float:attacker_playerPunchAnglePost[3] = {600.250,0.0,140.0};
Makes me look in a ton of different directions.

I'm still trying to hook this on weapon_fire as I'm convinced by Fredd and SumGuys posts that you can change recoil to 0 without resorting to Prethink. Can anyone help?

Greyscale 06-11-2009 20:15

Re: Reducing Recoil In CS: Source
 
Code:

new Float:attacker_playerPunchAnglePost[3] = {0.0,0.0,0.0};
                        SetEntDataVector(attacker_playerClient,offset_PlayerPunchAngle,attacker_playerPunchAnglePost,true);

Try that in weapon_fire.

What exactly is ClientPreThink? I've never seen or used it.

DJ Tsunami 06-12-2009 06:59

Re: Reducing Recoil In CS: Source
 
It's a hook that DukeHacks has, it fires every frame for every client, before what they're going to do actually happens. Thus you can for example check if they're going to attack and then block it.

Greyscale 06-13-2009 16:45

Re: Reducing Recoil In CS: Source
 
That sounds extremely useful.


All times are GMT -4. The time now is 21:46.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.