Checking Ranges and respawning.
#2

Tried this and it exceeds heap size:
PHP код:
timer ZombieRespawnTimer[5000]()
{
    new 
Float:x,Float:y,Float:zcount_zombiesNPCSS[MAX_PLAYERS][MAX_PLAYERS], NPCSSID[MAX_PLAYERS][MAX_PLAYERS];
    
count_zombies=0;
     
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        
GetPlayerPos(i,x,y,z);
        for(new 
k=0k<MAX_PLAYERSk++)
        {
            if(
IsPlayerNPC(k))
            {
                if(
IsPlayerInRangeOfPoint(k50xyz))
                {
                    
NPCSS[i][k] ++;
                    
NPCSSID[i][k] = k;
                }
            }    
        }
    }
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        for(new 
k=0k<MAX_PLAYERSk++)
        {
            if(
NPCSS[i][k] > 20)
            {
                
printf("Found %d more zombies in a area, respawning...",NPCSS[i][k]-20);
                
FCNPC_Respawn(NPCSSID[i][k]);
            }
        }
    }         

Reply


Messages In This Thread
Checking Ranges and respawning. - by iLearner - 16.08.2017, 16:50
Re: Checking Ranges and respawning. - by iLearner - 16.08.2017, 17:02
Re: Checking Ranges and respawning. - by Paulice - 16.08.2017, 17:20
Re: Checking Ranges and respawning. - by ZiGGi - 16.08.2017, 18:46
Re: Checking Ranges and respawning. - by AbyssMorgan - 16.08.2017, 18:54
Re: Checking Ranges and respawning. - by Paulice - 16.08.2017, 19:23

Forum Jump:


Users browsing this thread: 1 Guest(s)