SA-MP Forums Archive
Zombie not respawning - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Zombie not respawning (/showthread.php?tid=622791)



Zombie not respawning - Sp00l - 26.11.2016

PHP код:
fp SpawnarZumbi(id, data)
{
    if(
data == 1) return IsDeadNPC{id} = false;
    
    static
        
Float:nx, Float:px,
        
Float:ny, Float:py,
        
Float:nz, Float:pz,
        
bool:locked, proxs ;
    
locked = true;
    while(
locked) {
        
GetVectorPath(gSpawns, MRandom(MAX_SPAWNS), nx, ny, nz);
        
proxs = 0;
        for (new 
i = 0; i < vector_size(gPlayersOnline) ; i++) {
            
GetPlayerPos(vector_get(gPlayersOnline, i), px,py,pz);
            if(
distance(px, py, pz, nx, ny, nz) <= 150.0) {
                
proxs++;
                break;
            }
        }
        if(!
proxs) {
            
locked = false;
            break;
        }
    }
    
npc.SetPos(id, nx, ny, nz + 1.0);
    
SetTimerEx("SpawnarZumbi", 8000, false, "di", id,1);
    return 
1;
} 
Well, the problem is that the zombie is not respawning, I don't know why, been trying to figure it out for like an hour.


Re: Zombie not respawning - Sp00l - 26.11.2016

I need ideas, anyone?