[C++ mod_sa] Fast Respawn, Fast Crosshair, Fake Skills, NoSpread, NoFall, NoReload, Auto CBUG, Auto 2-2, NoStun, etc...

dphome

Well-known member
Joined
Mar 21, 2020
Messages
456
Solutions
9
Reaction score
166
Location
Poland
Code:
void FastRespawn()
{
    static bool fastrespawn = false;
    if (set.fastrespawn)
    {
        struct actor_info *me = actor_info_get(ACTOR_SELF, NULL);

        if (me->hitpoints == 0)
            me->hitpoints = 99;
        fastrespawn = true;
    }
    else if (fastrespawn)
    {
        fastrespawn = false;
    }
}
Code:
void FastCrosshair()
{
    static bool bFastCrosshair = false;
    if (set.fastcrosshair)
    {
        memcpy_safe((void*)0x0058E1D9, "\xEB", 1);
        bFastCrosshair = true;
    }
    else if (bFastCrosshair)
    {
        memcpy_safe((void*)0x0058E1D9, "\x74", 1);
        bFastCrosshair = false;
    }
}
Code:
void cheat_handle_skills()
{
    static bool skills = false;
    if (set.skills)
    {
        ScriptCommand(&register_int_stat, 70, 100.0f);
        ScriptCommand(&register_int_stat, 71, 100.0f);
        ScriptCommand(&register_int_stat, 72, 100.0f);
        ScriptCommand(&register_int_stat, 76, 100.0f);
        ScriptCommand(&register_int_stat, 77, 100.0f);
        ScriptCommand(&register_int_stat, 78, 100.0f);
        ScriptCommand(&register_int_stat, 79, 100.0f);
        skills = true;
    }
    else if (skills)
    {
        ScriptCommand(&register_int_stat, 70, 0.0f);
        ScriptCommand(&register_int_stat, 71, 0.0f);
        ScriptCommand(&register_int_stat, 72, 0.0f);
        ScriptCommand(&register_int_stat, 76, 0.0f);
        ScriptCommand(&register_int_stat, 77, 0.0f);
        ScriptCommand(&register_int_stat, 78, 0.0f);
        ScriptCommand(&register_int_stat, 79, 0.0f);
        skills = false;
    }
}
Code:
void NoSpread()
{
    if (set.nospread)
        memcpy_safe((void*)0x8D610F, "\xBE\x00\x00\x00\x00", 5);
    else memcpy_safe((void*)0x8D610F, "\xBE\x00\x00\x40\x3F", 5);
}
or
void NoSpread()
{
    static bool no_rec = false;
    if (set.nospread)
    {
        if (!no_rec)
            no_rec = 1;
        *(float *)0xC8C450 = 5.0; // colts 
        *(float *)0xC8C8B0 = 25.0; // tec9
        *(float *)0xC8C5A0 = 2.0; // shootgun
        *(float *)0xC8C4C0 = 3.0; // pistol silent
        *(float *)0xC8C840 = 25.0; // m4
        *(float *)0xC8C530 = 5.0; // deagle
        *(float *)0xC8C6F0 = 5.0; // uiz
        *(float *)0xC8C760 = 5.0; // mp5
        *(float *)0xC8C7D0 = 25.0; // ak 
    }
    else
    {
        if (no_rec)
            no_rec = 0;
        //defolt value
        *(float *)0xC8C450 = 1.250000; // colts 
        *(float *)0xC8C8B0 = 1.100000; // tec9
        *(float *)0xC8C5A0 = 1.400000; // shootgun
        *(float *)0xC8C4C0 = 1.500000; // pistol silent
        *(float *)0xC8C840 = 0.800000; // m4
        *(float *)0xC8C530 = 1.250000; // deagle
        *(float *)0xC8C6F0 = 1.100000; // uiz
        *(float *)0xC8C760 = 1.200000; // mp5
        *(float *)0xC8C7D0 = 0.600000; // ak 
    }
}
Code:
void NoFall()
{
    static bool bNoFall = false;
    if (set.nofall)
    {
        if (g_Players->pLocalPlayer->onFootData.sCurrentAnimationID == 0x469 || g_Players->pLocalPlayer->onFootData.sCurrentAnimationID == 0x4B8)
            GTAfunc_DisembarkInstantly();
        bNoFall = true;
    }
    else if (bNoFall)
    {
        bNoFall = false;
    }
}
Code:
void NoReload()
{
    static bool noreload = false;
    if (set.noreload && cheat_state->state == CHEAT_STATE_ACTOR)
    {
        struct actor_info *self = actor_info_get(ACTOR_SELF, 0);
        if (self == NULL)
            return;

        int wID = self->weapon[self->weapon_slot].id;
        if (wID >= 22 && wID <= 24 || wID >= 26 && wID <= 32 || wID >= 37 && wID <= 38 || wID >= 41 && wID <= 42)
        {
            int wSlot = pPedSelf->GetCurrentWeaponSlot();
            if (self->weapon[self->weapon_slot].ammo_clip == 1)
            {
                pPedSelf->SetCurrentWeaponSlot(eWeaponSlot(0));
                pPedSelf->SetCurrentWeaponSlot(eWeaponSlot(wSlot));
            }
        }
        noreload = true;
    }
    else if (noreload)
    {
        noreload = false;
    }
}
Code:
void AutoCBUG()
{
    static bool autocbug = false;
    if (set.autocbug)
    {
        if (KEY_DOWN(0x01))
        {
            struct actor_info *pInfo = actor_info_get(ACTOR_SELF, 0);
            static DWORD time = GetTickCount();
            if (GetTickCount() - time >= 400)
            {
                if (ACTOR_IS_DEAD(pInfo)) return;
                if (pInfo->weapon[pInfo->weapon_slot].ammo_clip == 0) return;
                GTAfunc_DisembarkInstantly();
                time = GetTickCount();
            }
        }
        autocbug = true;
    }
    else if (autocbug)
    {
        autocbug = false;
    }
}
Code:
void Auto22()
{
    static bool auto22 = false;
    if (set.auto22)
    {
        static bool state_of_weapon = false;

        actor_info *ped = actor_info_get(ACTOR_SELF, NULL);
        static DWORD timer = 0;

        if (ped->weapon[3].id == 26 && ped->weapon[3].ammo_clip <= 2)
        {
            if (KEY_DOWN(VK_RBUTTON))
                return;

            if (GetTickCount() - 450 > timer)
            {

                if (state_of_weapon == false)
                {
                    pPedSelf->SetCurrentWeaponSlot(eWeaponSlot(0));
                    state_of_weapon = true;
                    timer = GetTickCount();
                }
                else
                {
                    if (state_of_weapon == true)
                    {
                        pPedSelf->SetCurrentWeaponSlot(eWeaponSlot(3));
                        state_of_weapon = false;
                        timer = GetTickCount();
                    }
                }
            }
        }
        auto22 = true;
    }
    else if (auto22)
    {
        auto22 = false;
    }
}
Code:
void AntiStun()
{
    traceLastFunc("AntiStun()");
    struct actor_info *self = actor_info_get(ACTOR_SELF, 0);

    static bool bAntiStun = false;
    if (set.bAntiStun)
    {
        self->pedFlags.bUpperBodyDamageAnimsOnly = true;
        bAntiStun = true;
    }
    else if (bAntiStun)
    {
        self->pedFlags.bUpperBodyDamageAnimsOnly = false;
        bAntiStun = false;
    }
}
Code:
int iLastWeaponPulseTick = GetTickCount();
void cheat_handle_pulse(void)
{
    struct actor_info *info;

    for (int x = 0; x < 10; x++)
    {
        if (set.phealth)
        {
            if ((info = actor_info_get(ACTOR_SELF, ACTOR_ALIVE)) != NULL)
            {
                static bool health_pulse_state;

                if (!health_pulse_state && info->hitpoints <= 1.0f)
                    health_pulse_state = 1;

                else if (health_pulse_state && info->hitpoints >= 100.0f)
                    health_pulse_state = 0;

                if (health_pulse_state)
                    info->hitpoints++;
                else
                    info->hitpoints--;
            }
        }

        if (set.parmor)
        {
            if ((info = actor_info_get(ACTOR_SELF, ACTOR_ALIVE)) != NULL)
            {
                static bool armour_pulse_state;

                if (!armour_pulse_state && info->armor <= 1.0f)
                    armour_pulse_state = 1;

                else if (armour_pulse_state && info->armor >= 100.0f)
                    armour_pulse_state = 0;

                if (armour_pulse_state)
                    info->armor++;
                else
                    info->armor--;
            }
        }
    }

    if (set.pweapon && GetTickCount() - iLastWeaponPulseTick >= 50)
    {
        struct actor_info    *self = actor_info_get(ACTOR_SELF, ACTOR_ALIVE);

        static int i = 0;

        if (self->weapon[i].id == NULL && i != 0)
        {
            goto get_valid_weapon;
        }

        pPedSelf->SetCurrentWeaponSlot(eWeaponSlot(i));

        i++;

        iLastWeaponPulseTick = GetTickCount();

    get_valid_weapon:
        for (i; i < 13; i++)
        {
            if (self->weapon[i].id != NULL)
                break;
        }

        if (i > 12)
            i = 0;
    }
}
Code:
void cheat_pulsedisk()
{
    static bool pisc_p = false;
    if (set.pulsedisk)
    {

        static int state = 0;
        static DWORD Time = 0;

        if (!pisc_p)
            pisc_p = 1;

        if (GetTickCount() - 100 > Time)
        {
            vehicle_addUpgrade(vehicle_info_get(VEHICLE_SELF, 0), rand() % 25 + 1073);
            Time = GetTickCount();
        }
    }
    else
    {
        if (pisc_p)
            pisc_p = 0;
    }
}
Code:
void cheat_colpuls()
{
    static bool color_p = false;
    if (set.colorizecars)
    {
        if (!color_p)
            color_p = 1;

        static int state = 0;
        static DWORD Time = 0;

        if (GetTickCount() - 100 > Time)
        {
            vehicle_setColor0(vehicle_info_get(VEHICLE_SELF, 0), rand() % 180);
            vehicle_setColor1(vehicle_info_get(VEHICLE_SELF, 0), rand() % 180);
            Time = GetTickCount();
        }
    }
    else
    {
        if (color_p)
            color_p = 0;
    }
}
Code:
void AutoScroll()
{
    traceLastFunc("AutoScroll()");
    static bool bAutoScroll = false;
    if (set.bAutoScroll)
    {
        static int iSlot = 0;
        static int iState = 0;
        actor_info *ped = actor_info_get(ACTOR_SELF, NULL);
        if (g_Players->pLocalPlayer->onFootData.stSampKeys.keys_aim && ped->weapon_slot == 2)
        {
            iState = 1;
        }
        else if (iState == 2)
        {
            pPedSelf->SetCurrentWeaponSlot(eWeaponSlot(iSlot));
            iState = 0;
        }
        else if (iState == 1)
        {
            iSlot = ped->weapon_slot;
            ped->weapon_slot = 0;
            iState = 2;
        }
        bAutoScroll = true;
    }
    else if (bAutoScroll)
    {
        bAutoScroll = false;
    }
}
 
Last edited:

himelBD

Active member
Joined
Sep 1, 2020
Messages
79
Reaction score
6
Location
Bangladesh
can u please compile and give me all these in cleo format please i will be ever grateful to u please
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
456
Solutions
9
Reaction score
166
Location
Poland
Update.

Many snippets from open source projects.
 

Kross

Active member
Joined
Dec 15, 2021
Messages
149
Reaction score
42
Code:
void FastRespawn()
{
    static bool fastrespawn = false;
    if (set.fastrespawn)
    {
        struct actor_info *me = actor_info_get(ACTOR_SELF, NULL);

        if (me->hitpoints == 0)
            me->hitpoints = 99;
        fastrespawn = true;
    }
    else if (fastrespawn)
    {
        fastrespawn = false;
    }
}
Code:
void FastCrosshair()
{
    static bool bFastCrosshair = false;
    if (set.fastcrosshair)
    {
        memcpy_safe((void*)0x0058E1D9, "\xEB", 1);
        bFastCrosshair = true;
    }
    else if (bFastCrosshair)
    {
        memcpy_safe((void*)0x0058E1D9, "\x74", 1);
        bFastCrosshair = false;
    }
}
Code:
void cheat_handle_skills()
{
    static bool skills = false;
    if (set.skills)
    {
        ScriptCommand(&register_int_stat, 70, 100.0f);
        ScriptCommand(&register_int_stat, 71, 100.0f);
        ScriptCommand(&register_int_stat, 72, 100.0f);
        ScriptCommand(&register_int_stat, 76, 100.0f);
        ScriptCommand(&register_int_stat, 77, 100.0f);
        ScriptCommand(&register_int_stat, 78, 100.0f);
        ScriptCommand(&register_int_stat, 79, 100.0f);
        skills = true;
    }
    else if (skills)
    {
        ScriptCommand(&register_int_stat, 70, 0.0f);
        ScriptCommand(&register_int_stat, 71, 0.0f);
        ScriptCommand(&register_int_stat, 72, 0.0f);
        ScriptCommand(&register_int_stat, 76, 0.0f);
        ScriptCommand(&register_int_stat, 77, 0.0f);
        ScriptCommand(&register_int_stat, 78, 0.0f);
        ScriptCommand(&register_int_stat, 79, 0.0f);
        skills = false;
    }
}
Code:
void NoSpread()
{
    if (set.nospread)
        memcpy_safe((void*)0x8D610F, "\xBE\x00\x00\x00\x00", 5);
    else memcpy_safe((void*)0x8D610F, "\xBE\x00\x00\x40\x3F", 5);
}
or
void NoSpread()
{
    static bool no_rec = false;
    if (set.nospread)
    {
        if (!no_rec)
            no_rec = 1;
        *(float *)0xC8C450 = 5.0; // colts
        *(float *)0xC8C8B0 = 25.0; // tec9
        *(float *)0xC8C5A0 = 2.0; // shootgun
        *(float *)0xC8C4C0 = 3.0; // pistol silent
        *(float *)0xC8C840 = 25.0; // m4
        *(float *)0xC8C530 = 5.0; // deagle
        *(float *)0xC8C6F0 = 5.0; // uiz
        *(float *)0xC8C760 = 5.0; // mp5
        *(float *)0xC8C7D0 = 25.0; // ak
    }
    else
    {
        if (no_rec)
            no_rec = 0;
        //defolt value
        *(float *)0xC8C450 = 1.250000; // colts
        *(float *)0xC8C8B0 = 1.100000; // tec9
        *(float *)0xC8C5A0 = 1.400000; // shootgun
        *(float *)0xC8C4C0 = 1.500000; // pistol silent
        *(float *)0xC8C840 = 0.800000; // m4
        *(float *)0xC8C530 = 1.250000; // deagle
        *(float *)0xC8C6F0 = 1.100000; // uiz
        *(float *)0xC8C760 = 1.200000; // mp5
        *(float *)0xC8C7D0 = 0.600000; // ak
    }
}
Code:
void NoFall()
{
    static bool bNoFall = false;
    if (set.nofall)
    {
        if (g_Players->pLocalPlayer->onFootData.sCurrentAnimationID == 0x469 || g_Players->pLocalPlayer->onFootData.sCurrentAnimationID == 0x4B8)
            GTAfunc_DisembarkInstantly();
        bNoFall = true;
    }
    else if (bNoFall)
    {
        bNoFall = false;
    }
}
Code:
void NoReload()
{
    static bool noreload = false;
    if (set.noreload && cheat_state->state == CHEAT_STATE_ACTOR)
    {
        struct actor_info *self = actor_info_get(ACTOR_SELF, 0);
        if (self == NULL)
            return;

        int wID = self->weapon[self->weapon_slot].id;
        if (wID >= 22 && wID <= 24 || wID >= 26 && wID <= 32 || wID >= 37 && wID <= 38 || wID >= 41 && wID <= 42)
        {
            int wSlot = pPedSelf->GetCurrentWeaponSlot();
            if (self->weapon[self->weapon_slot].ammo_clip == 1)
            {
                pPedSelf->SetCurrentWeaponSlot(eWeaponSlot(0));
                pPedSelf->SetCurrentWeaponSlot(eWeaponSlot(wSlot));
            }
        }
        noreload = true;
    }
    else if (noreload)
    {
        noreload = false;
    }
}
Code:
void AutoCBUG()
{
    static bool autocbug = false;
    if (set.autocbug)
    {
        if (KEY_DOWN(0x01))
        {
            struct actor_info *pInfo = actor_info_get(ACTOR_SELF, 0);
            static DWORD time = GetTickCount();
            if (GetTickCount() - time >= 400)
            {
                if (ACTOR_IS_DEAD(pInfo)) return;
                if (pInfo->weapon[pInfo->weapon_slot].ammo_clip == 0) return;
                GTAfunc_DisembarkInstantly();
                time = GetTickCount();
            }
        }
        autocbug = true;
    }
    else if (autocbug)
    {
        autocbug = false;
    }
}
Code:
void Auto22()
{
    static bool auto22 = false;
    if (set.auto22)
    {
        static bool state_of_weapon = false;

        actor_info *ped = actor_info_get(ACTOR_SELF, NULL);
        static DWORD timer = 0;

        if (ped->weapon[3].id == 26 && ped->weapon[3].ammo_clip <= 2)
        {
            if (KEY_DOWN(VK_RBUTTON))
                return;

            if (GetTickCount() - 450 > timer)
            {

                if (state_of_weapon == false)
                {
                    pPedSelf->SetCurrentWeaponSlot(eWeaponSlot(0));
                    state_of_weapon = true;
                    timer = GetTickCount();
                }
                else
                {
                    if (state_of_weapon == true)
                    {
                        pPedSelf->SetCurrentWeaponSlot(eWeaponSlot(3));
                        state_of_weapon = false;
                        timer = GetTickCount();
                    }
                }
            }
        }
        auto22 = true;
    }
    else if (auto22)
    {
        auto22 = false;
    }
}
Code:
void AntiStun()
{
    traceLastFunc("AntiStun()");
    struct actor_info *self = actor_info_get(ACTOR_SELF, 0);

    static bool bAntiStun = false;
    if (set.bAntiStun)
    {
        self->pedFlags.bUpperBodyDamageAnimsOnly = true;
        bAntiStun = true;
    }
    else if (bAntiStun)
    {
        self->pedFlags.bUpperBodyDamageAnimsOnly = false;
        bAntiStun = false;
    }
}
Code:
int iLastWeaponPulseTick = GetTickCount();
void cheat_handle_pulse(void)
{
    struct actor_info *info;

    for (int x = 0; x < 10; x++)
    {
        if (set.phealth)
        {
            if ((info = actor_info_get(ACTOR_SELF, ACTOR_ALIVE)) != NULL)
            {
                static bool health_pulse_state;

                if (!health_pulse_state && info->hitpoints <= 1.0f)
                    health_pulse_state = 1;

                else if (health_pulse_state && info->hitpoints >= 100.0f)
                    health_pulse_state = 0;

                if (health_pulse_state)
                    info->hitpoints++;
                else
                    info->hitpoints--;
            }
        }

        if (set.parmor)
        {
            if ((info = actor_info_get(ACTOR_SELF, ACTOR_ALIVE)) != NULL)
            {
                static bool armour_pulse_state;

                if (!armour_pulse_state && info->armor <= 1.0f)
                    armour_pulse_state = 1;

                else if (armour_pulse_state && info->armor >= 100.0f)
                    armour_pulse_state = 0;

                if (armour_pulse_state)
                    info->armor++;
                else
                    info->armor--;
            }
        }
    }

    if (set.pweapon && GetTickCount() - iLastWeaponPulseTick >= 50)
    {
        struct actor_info    *self = actor_info_get(ACTOR_SELF, ACTOR_ALIVE);

        static int i = 0;

        if (self->weapon[i].id == NULL && i != 0)
        {
            goto get_valid_weapon;
        }

        pPedSelf->SetCurrentWeaponSlot(eWeaponSlot(i));

        i++;

        iLastWeaponPulseTick = GetTickCount();

    get_valid_weapon:
        for (i; i < 13; i++)
        {
            if (self->weapon[i].id != NULL)
                break;
        }

        if (i > 12)
            i = 0;
    }
}
Code:
void cheat_pulsedisk()
{
    static bool pisc_p = false;
    if (set.pulsedisk)
    {

        static int state = 0;
        static DWORD Time = 0;

        if (!pisc_p)
            pisc_p = 1;

        if (GetTickCount() - 100 > Time)
        {
            vehicle_addUpgrade(vehicle_info_get(VEHICLE_SELF, 0), rand() % 25 + 1073);
            Time = GetTickCount();
        }
    }
    else
    {
        if (pisc_p)
            pisc_p = 0;
    }
}
Code:
void cheat_colpuls()
{
    static bool color_p = false;
    if (set.colorizecars)
    {
        if (!color_p)
            color_p = 1;

        static int state = 0;
        static DWORD Time = 0;

        if (GetTickCount() - 100 > Time)
        {
            vehicle_setColor0(vehicle_info_get(VEHICLE_SELF, 0), rand() % 180);
            vehicle_setColor1(vehicle_info_get(VEHICLE_SELF, 0), rand() % 180);
            Time = GetTickCount();
        }
    }
    else
    {
        if (color_p)
            color_p = 0;
    }
}
Code:
void AutoScroll()
{
    traceLastFunc("AutoScroll()");
    static bool bAutoScroll = false;
    if (set.bAutoScroll)
    {
        static int iSlot = 0;
        static int iState = 0;
        actor_info *ped = actor_info_get(ACTOR_SELF, NULL);
        if (g_Players->pLocalPlayer->onFootData.stSampKeys.keys_aim && ped->weapon_slot == 2)
        {
            iState = 1;
        }
        else if (iState == 2)
        {
            pPedSelf->SetCurrentWeaponSlot(eWeaponSlot(iSlot));
            iState = 0;
        }
        else if (iState == 1)
        {
            iSlot = ped->weapon_slot;
            ped->weapon_slot = 0;
            iState = 2;
        }
        bAutoScroll = true;
    }
    else if (bAutoScroll)
    {
        bAutoScroll = false;
    }
}
Can you tell me the important includes and libraries to compile these sources?
 
Top