RNPC ZOMBIES
#1

I use RNPC script and zombies spawn under road. How to fix?
Reply
#2

BUMP HELP ME PLEAAASE (((
Reply
#3

Who knows.
Reply
#4

Give me a sec..i ask god:













....maybe post your code
Reply
#5

OK HERES MY CODE
PHP код:
    if(IsPlayerNPC(playerid))
    {
        new 
randomuladat random(2);
        new 
spawn random(sizeof(ZombieSpawns));
         
SetPlayerPos(playeridZombieSpawns[spawn][0], ZombieSpawns[spawn][1], ZombieSpawns[spawn][2]);
        if(
randomuladat == 0)
        {
            
zombiklasi[playerid] = 1;
               
SetPlayerSkin(playerid162);
               
SetRNPCHealth(playerid150);
           }
           if(
randomuladat == 1)
           {
               
zombiklasi[playerid] = 2;
               
SetRNPCHealth(playerid200);
               
SetPlayerSkin(playeridZSkins[random(4)]);
             
SetPlayerAttachedObject(playerid1290820.064999,0.045000,0.000999176.5000005.69999895.0000070.9419991.0829991.075000);
              
SetPlayerAttachedObject(playerid2290710.038000,0.051000,0.027000,-94.999984, -0.29999589.3999321.00.7390001.211000);
               
SetPlayerAttachedObject(playerid329065, -0.146000,0.000000,-0.007000,10.299988,1.500002, -89.8000101.01.01.0);
            
SetPlayerAttachedObject(playerid4290510, -0.176999,0.082000,0.0050000.0000000.000000, -92.700004,1.0679990.6629990.998000);
            
SetPlayerAttachedObject(playerid5280480.240999,0.034000,0.0000000.0000000.000000,91.4999770.7579991.0000001.214999);
            
SetPlayerAttachedObject(playerid528031,0.132999,-0.161000,0.0000000.000000,91.599998,102.6999890.259000,0.3699990.719000);
        }
        if(
randomuladat == 2)
        {
            
zombiklasi[playerid] = 3;
            
SetRNPCHealth(playerid350);
            
SetPlayerSkin(playeridZSkins[random(4)]);
            switch(
GetPlayerSkin(playerid))
            {
                  
#define SPAO21{%0,%1,%2,%3,%4,%5,%6,%7,%8} SetPlayerAttachedObject(playerid, 0, 2906, 1, (%0), (%1), (%2), (%3), (%4), (%5), (%6), (%7), (%8));
                  
case 1..299SPAO21{0.240.060.48814.699, -81.999, -0.3981.4851.4131.547}
             }
             switch(
GetPlayerSkin(playerid))
             {
                  
#define SPAO22{%0,%1,%2,%3,%4,%5,%6,%7,%8} SetPlayerAttachedObject(playerid, 1, 2907, 1, (%0), (%1), (%2), (%3), (%4), (%5), (%6), (%7), (%8));
                  
case 1..299SPAO22{-0.0510.0710.03391.801, -172.199, -91.8982.1570.9982.815}
             }
             switch(
GetPlayerSkin(playerid))
             {
                  
#define SPAO23{%0,%1,%2,%3,%4,%5,%6,%7,%8} SetPlayerAttachedObject(playerid, 2, 2908, 1, (%0), (%1), (%2), (%3), (%4), (%5), (%6), (%7), (%8));
                  
case 1..299SPAO23{0.6220.1340.0451.998170, -81.6992.6742.3352.368}
             }
               switch(
GetPlayerSkin(playerid))
             {
                  
#define SPAO24{%0,%1,%2,%3,%4,%5,%6,%7,%8} SetPlayerAttachedObject(playerid, 3, 2906, 1, (%0), (%1), (%2), (%3), (%4), (%5), (%6), (%7), (%8));
                  
case 1..299SPAO24{0.3240.121, -0.359107.89995, -119.2991.8761.2921.250}
             }
             switch(
GetPlayerSkin(playerid))
             {
                 
#define SPAO25{%0,%1,%2,%3,%4,%5,%6,%7,%8} SetPlayerAttachedObject(playerid, 4, 2905, 10, (%0), (%1), (%2), (%3), (%4), (%5), (%6), (%7), (%8));
                  
case 1..299SPAO25{-0.3230.2260.032, -4.499, -3.199, -77.8992.3021.2782.686}
             }
              switch(
GetPlayerSkin(playerid))
             {
                 
#define SPAO26{%0,%1,%2,%3,%4,%5,%6,%7,%8} SetPlayerAttachedObject(playerid, 5, 2905, 9, (%0), (%1), (%2), (%3), (%4), (%5), (%6), (%7), (%8));
                  
case 1..299SPAO26{-0.260.1430.064, -140174.901932.5731.1102.330}
               }
        }
           
SetPlayerColor(playeridZOMBIE_COLOR);
           
RNPC_SetShootable(playerid1);
        
RNPC_ToggleVehicleCollisionCheck(playerid1);
        
GetZombieVictimID[playerid] = INVALID_PLAYER_ID;
        return 
1;
    }
    else
    {
        
GetVictimDetectRange[playerid] = ZOMBIE_DETECT;
        
GetVictimTimerStatus[playerid] = 0;
    }
public 
OnZombieAttack()
{
    for(new 
npcid 0npcid MAX_ZOMBIESnpcid++)
    {
        if(
IsPlayerNPC(npcid))
        {
            if(
GetRNPCHealth(npcid) > 0)
            {
                new 
victim GetZombieVictim(npcid), Float:xFloat:yFloat:zFloat:health;
                
GetPlayerPos(npcidxyz);
                if(
victim != INVALID_PLAYER_ID)
                {
                    if(
IsPlayerInRangeOfPoint(victimGetVictimDetectRange[victim], xyz))
                    {
                        
GetZombieVictimID[npcid] = victim;

                        if(
IsPlayerInRangeOfPoint(victim1xyz))
                        {
                            
RNPC_CreateBuild(npcidPLAYER_RECORDING_TYPE_ONFOOT);
                            
RNPC_AddPause(100);
                            
RNPC_SetKeys(KEY_FIRE);
                            
RNPC_AddPause(100);
                            
RNPC_SetKeys(0);
                            
RNPC_FinishBuild();
                            
RNPC_StartBuildPlayback(npcid);
                            
GetPlayerHealth(victimhealth);
                              
SetPlayerHealth(victimhealth ZOMBIE_DAMAGE);
                              
Player[victim][pBlood] -= random(3500);
                            continue;
                        }
                        
GetPlayerPos(victimxyz);
                        
MoveRNPC(npcidxyzRNPC_SPEED_RUN1);
                    }
                }
            }
        }
    }
    return 
1;
}

public 
OnZombieRoam()
{
    for(new 
npcid 0npcid MAX_ZOMBIESnpcid++)
    {
        if(
IsPlayerNPC(npcid))
        {
            if(
GetRNPCHealth(npcid) > 0)
            {
                new 
victim GetZombieVictim(npcid), Float:xFloat:yFloat:z;
                
GetPlayerPos(npcidxyz);
                if(
victim == INVALID_PLAYER_ID)
                  {
                    new 
pos random(4);
                    if(
pos == 0) { 100.0; }
                    else if(
pos == 1) { 100.0; }
                    else if(
pos == 2) { 100.0; }
                    else if(
pos == 3) { 100.0; }

                    
GetZombieVictimID[npcid] = INVALID_PLAYER_ID;

                    
RNPC_SetKeys(0);

                    
MoveRNPC(npcidxyzRNPC_SPEED_WALK1);
                 }
            }
        }
    }
    return 
1;
}

public 
ResetDetectRange(playerid)
{
    if(
GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
    {
        
GetVictimDetectRange[playerid] = (ZOMBIE_DETECT 4);
        
GetVictimTimerStatus[playerid] = 1;
        
GetVictimResetTimer[playerid] = SetTimerEx("ResetDetectRange"5000false"i"playerid);
        return 
1;
    }

    
GetVictimTimerStatus[playerid] = 0;
    
GetVictimDetectRange[playerid] = ZOMBIE_DETECT;
    return 
1;
}
stock GetZombieVictim(npcid)
{
    for(new 
playerid 0playerid MAX_PLAYERSplayerid++)
    {
        if(!
IsPlayerNPC(playerid) && IsPlayerConnected(playerid))
        {
            new 
Float:xFloat:yFloat:z;
            
GetPlayerPos(npcidxyz);
            if(
IsPlayerInRangeOfPoint(playeridGetVictimDetectRange[playerid], xyz) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && GetPlayerInterior(playerid) == && GetPlayerVirtualWorld(playerid) == 0) return playerid;
        }
    }
    return 
INVALID_PLAYER_ID;
}
stock GetMaxZombies()
{
    return 
350;

Reply
#6

Make sure that

ZombieSpawns

contains valid coordinates, and check if MapAndreas is initialized correctly (should be in the log). Apart from that the code seems fine after a quick look.
Reply
#7

PHP код:
----------
Loaded log file"server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team
[05:01:07filterscripts ""  (string)
[
05:01:07
[
05:01:07Server Plugins
[05:01:07] --------------
[
05:01:07]  Loading pluginstreamer.so
[05:01:08
*** 
Streamer Plugin v2.8.2 by Incognito loaded ***
[
05:01:08]   Loaded.
[
05:01:08]  Loading pluginsscanf.so
[05:01:08
[
05:01:08]  ===============================
[
05:01:08]       sscanf plugin loaded.     
[
05:01:08]          Version:  2.8.1        
[05:01:08]    (c2012 Alex "******" Cole  
[05:01:08]  ===============================
[
05:01:08]   Loaded.
[
05:01:08]  Loading pluginMapAndreas.so
[05:01:08]   Loaded.
[
05:01:08]  Loading pluginRNPC.so
[05:01:08RNPC V0.4.1 by Mauzen (03.12.2014)
[
05:01:08]   Loaded.
[
05:01:08]  Loaded 4 plugins.
[
05:01:08
[
05:01:08Filterscripts
[05:01:08] ---------------
[
05:01:08]   Loaded 0 filterscripts.
[
05:01:08]   RNPC versioncheckerchecking for updates...
[
05:01:08Setting server password to"258"
[05:01:08] [connection217.106.106.116:47754 requests connection cookie.
[
05:01:08] [connection217.106.106.116:58804 requests connection cookie.
[
05:01:08] [connection217.106.106.116:34901 requests connection cookie.
[
05:01:08] [connection217.106.106.116:60094 requests connection cookie.
[
05:01:08] [connection217.106.106.116:42116 requests connection cookie.
[
05:01:08] [connection217.106.106.116:33644 requests connection cookie.
[
05:01:08Chaitvirta13 Zombi
[05:01:08] [connection217.106.106.116:51040 requests connection cookie.
[
05:01:08] [connection217.106.106.116:54419 requests connection cookie.
[
05:01:08] [connection217.106.106.116:36938 requests connection cookie.
[
05:01:08] [connection217.106.106.116:49631 requests connection cookie.
[
05:01:08] [connection217.106.106.116:56713 requests connection cookie.
[
05:01:08] [connection217.106.106.116:54416 requests connection cookie.
[
05:01:08Boxes loaded 0
[05:01:08] [connection217.106.106.116:50160 requests connection cookie.
[
05:01:08Obieqtebi Failebidan0
[05:01:08] Иконок загружено 2
[05:01:08] *--------------------------------------------------*
[
05:01:08] |      Fear The Walking Dead OFFICIAL SERVER       |
[
05:01:08] |  Gamemode by Giorgi Medzvelia Erekle Basiladze |
[
05:01:08] |              Gamemode Versionv.0.0.4B                |
[
05:01:08] *--------------------------------------------------*
[
05:01:08Number of vehicle models22
[05:01:09] [connectionincoming connection217.106.106.116:47754 id0
[05:01:09] [connectionincoming connection217.106.106.116:58804 id1
[05:01:09] [connectionincoming connection217.106.106.116:34901 id2
[05:01:09] [connectionincoming connection217.106.106.116:42116 id3
[05:01:09] [connectionincoming connection217.106.106.116:60094 id4
[05:01:09] [connectionincoming connection217.106.106.116:33644 id5
[05:01:09] [connectionincoming connection217.106.106.116:51040 id6
[05:01:09] [connectionincoming connection217.106.106.116:54419 id7
[05:01:09] [connectionincoming connection217.106.106.116:36938 id8
[05:01:09] [connectionincoming connection217.106.106.116:49631 id9
[05:01:09] [connectionincoming connection217.106.106.116:56713 id10
[05:01:09] [connectionincoming connection217.106.106.116:54416 id11
[05:01:09] [connectionincoming connection217.106.106.116:50160 id12
[05:01:09Total vehicles from files3000
[05:01:09OneSecondTimers0 ms
[05:01:09] [npc:joinZOMBIE[2has joined the server (0:217.106.106.116)
[
05:01:09] [npc:joinZOMBIE[1has joined the server (1:217.106.106.116)
[
05:01:09] [npc:joinZOMBIE[3has joined the server (2:217.106.106.116)
[
05:01:09] [npc:joinZOMBIE[4has joined the server (3:217.106.106.116)
[
05:01:09] [npc:joinZOMBIE[6has joined the server (4:217.106.106.116)
[
05:01:09] [npc:joinZOMBIE[5has joined the server (5:217.106.106.116)
[
05:01:09] [npc:joinZOMBIE[8has joined the server (7:217.106.106.116)
[
05:01:09] [npc:joinZOMBIE[7has joined the server (6:217.106.106.116)
[
05:01:09] [npc:joinZOMBIE[9has joined the server (8:217.106.106.116)
[
05:01:09] [npc:joinZOMBIE[12has joined the server (9:217.106.106.116
Reply
#8

BUMP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)