running speed

user666

New member
Joined
Mar 26, 2020
Messages
2
Reaction score
0
Location
Spain
hello. i want to make a fast run in c++.
i have no idea how to get offsets (like to speed the game on the running animation).
tried setting this to a value but isn't working g_Players->pLocalPlayer->pSAMP_Actor->pGTA_Ped->runspeed.
thanks
 
D

Deleted member 46270

Guest
A Code from my Project Attack.
Code:
void H_SpeedWalk()
{
    traceLastFunc("H_SpeedWalk()");
    if (cheat_state->genelhileler.iSpeedWalk)
    {
        struct actor_info *self = actor_info_get(ACTOR_SELF, ACTOR_ALIVE);
        if (self == NULL || ACTOR_IS_DEAD(self))
            return;
        if (KEY_DOWN('W'))
        {
            float fPos[3] = { pPedSelf->GetPosition()->fX, pPedSelf->GetPosition()->fY, pPedSelf->GetPosition()->fZ };
            fPos[0] += sinf(-self->fCurrentRotation) * set.General.SpeedWalk_X;
            fPos[1] += cosf(-self->fCurrentRotation) * set.General.SpeedWalk_X;
            fPos[2] += 0.00f;

            pPedSelf->SetPosition(fPos[0], fPos[1], fPos[2]);
        }
    }
}
 

StickeyAdv

Member
Joined
Sep 27, 2018
Messages
16
Reaction score
2
C++:
DWORD dwAddr = *(DWORD*)((DWORD)g_Players->pLocalPlayer->pSAMP_Actor->pGTA_Ped + 0x14);
dwAddr += 0x30;
*(float*)dwAddr += g_Players->pLocalPlayer->onFootData.fMoveSpeed[0] * 0.135f;
dwAddr += 0x04;
*(float*)dwAddr += g_Players->pLocalPlayer->onFootData.fMoveSpeed[1] * 0.135f;

//Credit: s0b
 
Top