[Plugin] FCNPC - Fully Controllable NPC (Russian Thread)
#58

Quote:
Originally Posted by Bombo
View Post
Не срабатывает функция MeleeAttack() :
PHP Code:
    //далее функция рассчитана на плагин FCNPC
    
for(0MAX_PLAYERS; ++i)
    {
        
//если это игрок - пропускаем
        
if(IsPlayerNPC(i) && FCNPC_IsSpawned(i) && !FCNPC_IsDead(i))
        {
            
//ищем ближайшего игрока
            
for(0MAX_PLAYERS; ++j)
            {
                if(
miss_player[j])
                    continue;
                
dx floatsub(fPlayersCoords[i][f_X],fPlayersCoords[j][f_X]);
                
dy floatsub(fPlayersCoords[i][f_Y],fPlayersCoords[j][f_Y]);
                
dz floatsub(fPlayersCoords[i][f_Z],fPlayersCoords[j][f_Z]);
                
len VectorSize(dx,dy,dz);
                
//если игрок в зоне досягаемости зомби - атака
                
if(len 1.2)
                {
                    
//наводимся
                    
FCNPC_AimAt(ifPlayersCoords[j][f_X], fPlayersCoords[j][f_Y], fPlayersCoords[j][f_Z], false);
                    
//атакуем
                    
FCNPC_MeleeAttack(i100true);
                    break;
                }
                
//если игрок в поле зрения зомби - преследование
                
if(len 99.0)
                {
                    
//если за игроком уже бегжит 5 или более зомби - ищем другого игрока поблизости
                    
if(>= MAX_ZOMBIES_ON_PLAYER)
                        continue;
                    
//если зомби поворачивается в сторону игрока - отбой
                    
if(FCNPC_IsAiming(i))
                    {
                        
FCNPC_StopAttack(i);
                        
FCNPC_StopAim(i);
                    }
                    
//преследуем
                    
FCNPC_GoTo(ifloatadd(fPlayersCoords[j][f_X],floatdiv(floatmul(0.5,dx),len)), floatadd(fPlayersCoords[j][f_Y],floatdiv(floatmul(0.5,dy),len)), fPlayersCoords[j][f_Z], MOVE_TYPE_RUN0.8true);
                    break;
                }
            }
            
//если в поле зрения зомби никого нету - останавливаем его
            
if(FCNPC_IsAiming(i))
            {
                
FCNPC_StopAttack(i);
                
FCNPC_StopAim(i);
            }
        }
    } 
Если же в обоих местах закомментировать FCNPC_StopAttack(i), то MeleeAttack() срабатывает, но при этом анимация бега иногда заменяется анимацией атаки.
Ну, естественно оно не срабатывает - ты сразу же, после прицеливания, останавливаешь атаку, анимация просто не успевает сработать. А замена анимации бега на анимацию атаки - это тоже нормально, потому что движком н игры не предусмотрен бег и атака с помощью боевого стиля.
Reply


Messages In This Thread
FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 16.03.2016, 12:17
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Stuntff - 16.03.2016, 13:01
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Romz - 16.03.2016, 13:15
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Untonyst - 16.03.2016, 13:23
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Bombo - 21.06.2016, 17:02
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Romz - 21.06.2016, 17:19
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 21.06.2016, 20:56
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Bombo - 22.06.2016, 22:13
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 22.06.2016, 23:32
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Bombo - 23.06.2016, 04:00
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 10.07.2016, 09:42
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 12.07.2016, 22:59
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Bombo - 12.07.2016, 23:16
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Romz - 13.07.2016, 01:01
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 13.07.2016, 09:37
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Romz - 13.07.2016, 14:36
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by OmegaKiller72 - 20.07.2016, 12:00
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 20.07.2016, 14:38
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by OmegaKiller72 - 20.07.2016, 16:15
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 20.07.2016, 20:01
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by OmegaKiller72 - 22.07.2016, 11:47
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 27.07.2016, 17:58
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by OKStyle - 27.07.2016, 20:37
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 27.07.2016, 21:37
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Imperealist - 29.07.2016, 12:11
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 29.07.2016, 13:41
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Imperealist - 01.08.2016, 00:50
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 01.08.2016, 16:13
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Imperealist - 01.08.2016, 23:36
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 03.08.2016, 07:04
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Bombo - 04.08.2016, 12:05
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 04.08.2016, 12:36
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 09.08.2016, 05:13
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Art4D - 20.08.2016, 04:09
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by OKStyle - 20.08.2016, 08:40
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 20.08.2016, 15:20
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 26.08.2016, 15:42
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by OKStyle - 28.08.2016, 12:57
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 28.08.2016, 14:48
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 28.08.2016, 17:24
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by OKStyle - 29.08.2016, 15:26
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 29.08.2016, 21:50
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by OKStyle - 30.08.2016, 14:49
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 02.09.2016, 06:35
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 18.01.2017, 13:05
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by DANGER1979 - 19.01.2017, 12:14
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by DANGER1979 - 20.01.2017, 11:52
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 22.01.2017, 09:34
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 26.03.2017, 14:51
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by DANGER1979 - 27.03.2017, 07:40
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 02.04.2017, 11:31
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 02.04.2017, 11:41
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 16.04.2017, 15:08
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Kolstin - 16.04.2017, 17:56
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 16.04.2017, 18:21
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 01.05.2017, 06:23
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 14.06.2017, 14:06
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 25.10.2017, 10:15
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Bombo - 25.10.2017, 15:56
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Romz - 19.11.2017, 19:08
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 20.11.2017, 14:50
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by OKStyle - 20.11.2017, 15:29
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Romz - 21.11.2017, 01:09
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 21.11.2017, 03:27
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 05.01.2018, 13:28
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by MrStead - 21.01.2018, 10:52
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 22.01.2018, 05:07
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by MrStead - 25.01.2018, 14:46
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 25.01.2018, 15:46
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by eakwarp - 27.01.2018, 13:38
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 27.01.2018, 21:05
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Jasno - 29.01.2018, 09:01
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by eakwarp - 29.01.2018, 09:20
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Jasno - 29.01.2018, 09:23
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 29.01.2018, 10:06
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 29.01.2018, 17:27
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by eakwarp - 29.01.2018, 19:06
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 29.01.2018, 19:10
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by eakwarp - 29.01.2018, 19:12
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 29.01.2018, 19:14
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by eakwarp - 29.01.2018, 19:20
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by eakwarp - 29.01.2018, 19:22
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 29.01.2018, 19:22
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by eakwarp - 29.01.2018, 19:25
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 29.01.2018, 19:26
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by eakwarp - 29.01.2018, 19:27
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 30.01.2018, 16:14
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by eakwarp - 31.01.2018, 11:36
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by MrStead - 02.02.2018, 14:40
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by MrStead - 03.02.2018, 05:41
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by MrStead - 06.02.2018, 14:07
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by Anomis - 20.06.2018, 09:35
Re: FCNPC - Fully Controllable NPC (Russian Thread) - by ZiGGi - 20.06.2018, 19:57

Forum Jump:


Users browsing this thread: 4 Guest(s)