CLEO Help C++ to CLEO

CLEO related
Status
Not open for further replies.

dphome

Well-known member
Joined
Mar 21, 2020
Messages
478
Solutions
9
Reaction score
172
Location
Poland
Code:
void DM_Noreload()
{
    if (set.dmnoreload)
    {
        actor_info *info = actor_info_get(ACTOR_SELF, 0);
        if (info && ACTOR_IS_DEAD(info)) return;

        int weapon_id = info->weapon[info->weapon_slot].id;
        if (weapon_id >= 22 && weapon_id <= 42) {
            if (info->weapon[info->weapon_slot].ammo_clip == 1) {
                pPedSelf->GiveWeapon(eWeaponType(weapon_id), 0);
            }
        }
    }
}
void DM_Nospread()
{
    traceLastFunc("DM_Nospread()");
    static float standVal[11][4]; static bool active = false;

    if (set.dmnospread) {
        if (active == false) {
            for (int i = WEAPONSKILL_POOR; i <= WEAPONSKILL_SPECIAL; i++) {
                for (int x = WEAPONTYPE_PISTOL; x <= WEAPONTYPE_TEC9; x++) {
                    CWeaponInfo *pWeaponInfo = pGame->GetWeaponInfo((eWeaponType)x, (eWeaponSkill)i);
                    standVal[x - 22][i] = pWeaponInfo->GetAccuracy();
                    pWeaponInfo->SetAccuracy(10.0f);
                }
            } active = true;
        }
    }
    else if (active == true) {
        for (int i = WEAPONSKILL_POOR; i <= WEAPONSKILL_SPECIAL; i++) {
            for (int x = WEAPONTYPE_PISTOL; x <= WEAPONTYPE_TEC9; x++) {
                CWeaponInfo *pWeaponInfo = pGame->GetWeaponInfo((eWeaponType)x, (eWeaponSkill)i);
                pWeaponInfo->SetAccuracy(standVal[x - 22][i]);
            }
        }
        active = false;
    }
}
void DM_Nostuns()
{
    traceLastFunc("DM_Nostuns()");
    struct actor_info *self = actor_info_get(ACTOR_SELF, 0);
    static bool install = false;
    if (set.dmnostuns) {
        if (install == false) {
            self->pedFlags.bUpperBodyDamageAnimsOnly = true;
            install = true;
        }
    }
    else if (install) {
        self->pedFlags.bUpperBodyDamageAnimsOnly = false;
        install = false;
    }
    else install = false;

}
void DM_Fastcrosshair()
{
    traceLastFunc("DM_Fastcrosshair()");
    if (set.dmfastcrosshair) 
    {
        memcpy_safe((void*)0x0058E1D9, "\xEB", 1);
    }
    else 
        memcpy_safe((void*)0x0058E1D9, "\x74", 1);
}
 
Status
Not open for further replies.
Top