Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // st1ks version
- #include "stdafx.h"
- bool isshooting = false;
- Vector viewAngles;
- Vector punchAngles;
- Vector NewAngles;
- bool GetRCSKey()
- {
- return (GetAsyncKeyState(0x01));
- }
- void NoRecoil()
- {
- IClientEntity* pLocalEntity = pClientEntList->GetClientEntity(pEngine->GetLocalPlayer());
- if(!pLocalEntity)
- return;
- if(cEng.IsAlive(pLocalEntity))
- {
- if(GetRCSKey())
- {
- isshooting = true;
- }else
- {
- isshooting = false;
- }
- if(!isshooting)//If you arent pressing mouse1
- {
- viewAngles = pLocalEntity->GetAngles();//Gets Viewangles
- punchAngles = cEng.GetPunchAng(pLocalEntity);//Gets punchAngles.
- }
- else if(isshooting)//If you are pressing mouse1
- {
- punchAngles = cEng.GetPunchAng(pLocalEntity);//Gets punchAngles.
- if(punchAngles.X == 0.0f && punchAngles.Y == 0.0f && punchAngles.Z == 0.0f)//So it doesnt lock xhair when using grenades/knife/c4.
- return;
- NewAngles = viewAngles - punchAngles *2.f;
- pEngine->SetViewAngles(NewAngles);//Sets new Viewangles
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment