[m0d_sa]Aim/nearest function

Статус
В этой теме нельзя размещать новые ответы.

mfn

Новичок
Автор темы
6
0
Привет всем, вот функция по умолчанию цель :
Код:
void cheat_handle_actor_autoaim ( struct actor_info *info, double time_diff )
{
    traceLastFunc( "cheat_handle_actor_autoaim()" );

    // toggle aimbot on/off
    if ( KEY_PRESSED(set.key_autoaim_toggle) )
    {
        cheat_state->actor.autoaim ^= 1;
        if ( set.use_gta_autoaim )
        {
            if ( cheat_state->actor.autoaim == 1 )
            {
                // set to default value, in case joypad aiming already activated
                *(char *)0x00B6EC2E = 1;
                *(char *)0x00BA6818 = 0;
                patcher_install( &patch_gta_auto_aim );
            }
            else
            {
                patcher_remove( &patch_gta_auto_aim );
            }
        }
    }

    if ( !set.use_gta_autoaim )
    {
        // should we be trying to aim or not?
        bool                        isAimKeyDown = false;
        CControllerConfigManager    *pPadConfig = pGameInterface->GetControllerConfigManager();

        // doesnt seem to work in single player with pPadConfig and keyboard input?
        if ( pPadConfig->GetInputType() )
        {
            // mouse + keyboard
            if ( KEY_DOWN(pPadConfig->GetControllerKeyAssociatedWithAction(AIM_WEAPON, MOUSE)) )
            {
                isAimKeyDown = true;
            }
            else if ( KEY_DOWN(pPadConfig->GetControllerKeyAssociatedWithAction(AIM_WEAPON, KEYBOARD)) )
            {
                isAimKeyDown = true;
            }
        }
        else
        {
            // gamepad
            if ( KEY_DOWN(pPadConfig->GetControllerKeyAssociatedWithAction(FIRE, JOYSTICK)) )
            {
                isAimKeyDown = true;
            }
        }

        // let's aim, shall we?
        if ( cheat_state->actor.autoaim && isAimKeyDown )
        {
            // only for certain weapons
            eWeaponSlot selfSlot = pPedSelf->GetCurrentWeaponSlot();
            switch ( selfSlot )
            {
            case WEAPONSLOT_TYPE_UNARMED:
            case WEAPONSLOT_TYPE_MELEE:
            case WEAPONSLOT_TYPE_THROWN:
            case WEAPONSLOT_TYPE_SPECIAL:
            case WEAPONSLOT_TYPE_GIFT:
            case WEAPONSLOT_TYPE_PARACHUTE:
            case WEAPONSLOT_TYPE_DETONATOR:
                // we don't want to aim for these weapons
                return;
            //case WEAPONSLOT_TYPE_HANDGUN:
            //case WEAPONSLOT_TYPE_SHOTGUN:
            //case WEAPONSLOT_TYPE_SMG:
            //case WEAPONSLOT_TYPE_MG:
            //case WEAPONSLOT_TYPE_RIFLE:
            //case WEAPONSLOT_TYPE_HEAVY:
            }


            static int            prev_id;
            static float        adj_rx, adj_rz, prev_rx, prev_rz;
            float                rx = *(float *)0x00B6F248;
            float                rz = *(float *)0x00B6F258;

            int                    nearest_id = actor_find_nearest( ACTOR_ALIVE );
            struct actor_info    *nearest;
            float                vect[3], ax, az;

            if ( nearest_id == -1 )
            {
                cheat_state_text( "No players found; auto aim disabled." );
                cheat_state->actor.autoaim = 0;
                return;
            }

            if ( nearest_id == prev_id )
            {
                adj_rx += rx - prev_rx;
                adj_rz += rz - prev_rz;
            }

            prev_id = nearest_id;

            if ( (nearest = actor_info_get(nearest_id, ACTOR_ALIVE)) == NULL )
                return; // won't happen

           

            // calculate distance vector
            vect3_vect3_sub( &nearest->base.matrix[4 * 3], &info->base.matrix[4 * 3], vect );

            // z angle
            az = atan2f( vect[0], vect[1] );

            // rotate around z axis
            vect[1] = sinf( az ) * vect[0] + cosf( az ) * vect[1];

            // x angle
            ax = atan2f( vect[1], vect[2] );

            ax = -ax + M_PI / 2.0f + adj_rx;
            az = -az - M_PI / 2.0f + adj_rz;

            if ( ax < -M_PI )
                ax = -M_PI;
            else if ( ax > M_PI )
                ax = M_PI;

            // XXX make function
            prev_rx = *(float *)0x00B6F248 = ax;
            prev_rz = *(float *)0x00B6F258 = az;
}
}
}

Кто-нибудь знает, как изменить цель состоит в том, чтобы не искать ближайший ID только острым предметом, например, как цели кожи (при наведении игрок решает, которые стремятся работать на нем цель) ?
 

mfn

Новичок
Автор темы
6
0
Nope i am not russian. All i wan't is change the way how this aimbot chooses its target because now it works like that:
if you press fire_key then find the nearest player around you and aim at this player.
A wan't it to work like borghack or any other aimbot wchich is :
if you press aim_key then find player nearest to your pointer(not around you) and aim at this player the same way, giving you oportunity to move your camera when aiming.
If you still don't understand me, i can record a movie and show you
 

mfn

Новичок
Автор темы
6
0
It looks like an skin aim and i don't wan't skin aim. I wan't the same aimbot( with free mouse when it is aiming at someone - not with locked x-axis when aiming) i wanted just to change the way how it is looking for right target
 

0pc0d3R

Потрачен
550
269
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
It looks like an skin aim and i don't wan't skin aim. I wan't the same aimbot( with free mouse when it is aiming at someone - not with locked x-axis when aiming) i wanted just to change the way how it is looking for right target
maybe you need something like a silent aim?
 

mfn

Новичок
Автор темы
6
0
No, silent aim won't work with lagshoot. Single aimbot which will allow me to adjust range from skin by myself using mouse is the best choice in my opinion and it works also for sniper rifle.
 

0pc0d3R

Потрачен
550
269
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.

mfn

Новичок
Автор темы
6
0
useless for me. Silent aim works only for skinshot servers and normal aimbot shoots directly in player skin.
 

mfn

Новичок
Автор темы
6
0
sure but i play in lagshoot ON servers only so skin aimbot is piece of crap for me
 
Статус
В этой теме нельзя размещать новые ответы.