NPCs don't detect crouching players
#1

So, I had an idea where NPCs don't detect crouching players. I just don't know how to add it. Here's the only info from my server that I can give.

PHP код:
#define ZOMBIE_DETECT 15
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(!
IsPlayerNPC(playerid))
    {
        if(
newkeys KEY_FIRE)
        {
            if(
GetPlayerWeapon(playerid) >= 22 && GetPlayerWeapon(playerid) <= 38)
            {
                
GetVictimDetectRange[playerid] = (ZOMBIE_DETECT 4);
                if(
GetVictimTimerStatus[playerid] == 1) { KillTimer(GetVictimResetTimer[playerid]); }
                
GetVictimTimerStatus[playerid] = 1;
                
GetVictimResetTimer[playerid] = SetTimerEx("ResetDetectRange"5000false"i"playerid);
            }
        }
        else if(
newkeys KEY_SPRINT && GetVictimTimerStatus[playerid] == 0)
        {
            
GetVictimDetectRange[playerid] = (ZOMBIE_DETECT 2);
            
GetVictimTimerStatus[playerid] = 1;
            
GetVictimResetTimer[playerid] = SetTimerEx("ResetDetectRange"5000false"i"playerid);
        }
    }
    return 
1;

Reply


Messages In This Thread
NPCs don't detect crouching players - by NealPeteros - 31.10.2016, 14:27
Re: NPCs don't detect crouching players - by Threshold - 31.10.2016, 16:23
Re: NPCs don't detect crouching players - by NealPeteros - 31.10.2016, 16:31
Re: NPCs don't detect crouching players - by Threshold - 31.10.2016, 16:48

Forum Jump:


Users browsing this thread: 1 Guest(s)