spinhack

社区服务
高级搜索
猴岛论坛CSGO反恐精英CS作弊器交流讨论spinhack
发帖 回复
正序阅读 最近浏览的帖子最近浏览的版块
1个回复

spinhack

楼层直达
莎仕芘亞

ZxID:1171401

等级: 元老
猴岛国防部部长

举报 只看楼主 使用道具 楼主   发表于: 2007-07-25 0
Before CL_CreateMove:

Code:
#define SPIN_REVS_PER_SECOND cvar.spin_speed

void FixupAngleDifference(usercmd_t *cmd)
{
    cl_entity_t *pLocal;
    Vector viewforward, viewright, viewup, aimforward, aimright, aimup, vTemp;
    float newforward, newright, newup, newmagnitude, fTime;
    float forward = g_Originalcmd.forwardmove;
    float right = g_Originalcmd.sidemove;
    float up = g_Originalcmd.upmove;

    pLocal = gEngfuncs.GetLocalPlayer();
    if(!pLocal)
        return;

  if(pLocal->curstate.movetype == MOVETYPE_WALK)
    {
        gEngfuncs.pfnAngleVectors(Vector(0.0f, g_Originalcmd.viewangles.y, 0.0f), viewforward, viewright, viewup);
    }
    else
    {
        gEngfuncs.pfnAngleVectors(g_Originalcmd.viewangles, viewforward, viewright, viewup);
    }

    int iHasShiftHeld = GetAsyncKeyState(VK_LSHIFT);
    if(pLocal->curstate.movetype == MOVETYPE_WALK && !iHasShiftHeld && !(cmd->buttons & IN_ATTACK) && !(cmd->buttons & IN_USE))
    {
        fTime = gEngfuncs.GetClientTime();
        cmd->viewangles.y = fmod(fTime * SPIN_REVS_PER_SECOND * 360.0f, 360.0f);
    }

  if(pLocal->curstate.movetype == MOVETYPE_WALK)
    {
        gEngfuncs.pfnAngleVectors(Vector(0.0f, cmd->viewangles.y, 0.0f), aimforward, aimright, aimup);
    }
    else
    {
        gEngfuncs.pfnAngleVectors(cmd->viewangles, aimforward, aimright, aimup);
    }

        newforward = DotProduct(forward * viewforward.Normalize(), aimforward) + DotProduct(right * viewright.Normalize(), aimforward) + DotProduct(up * viewup.Normalize(), aimforward);
        newright = DotProduct(forward * viewforward.Normalize(), aimright) + DotProduct(right * viewright.Normalize(), aimright) + DotProduct(up * viewup.Normalize(), aimright);
        newup = DotProduct(forward * viewforward.Normalize(), aimup) + DotProduct(right * viewright.Normalize(), aimup) + DotProduct(up * viewup.Normalize(), aimup);

    cmd->forwardmove = newforward;
    cmd->sidemove = newright;
    cmd->upmove = newup;



Inside CL_CreateMove:

Make sure you put this above cvar.spin inside CL_CreateMove
Code:
memcpy(&g_Originalcmd, cmd, sizeof(usercmd_t));


You can put this anywhere below the code above. Make sure it is inside CL_CreateMove though
Code:
if (cvar.spin) { FixupAngleDifference(cmd); }


Now register your spin & spin_speed cvars. Make sure you register spin_speed as a float. If you have any problems please let me know.
10727465

ZxID:1237036

等级: 新兵
举报 只看该作者 沙发   发表于: 2007-08-02 0
我是水王。。。杜绝0回复。。。
« 返回列表
发帖 回复