07.10.2016, 23:05
I use RNPC script and zombies spawn under road. How to fix?
if(IsPlayerNPC(playerid))
{
new randomuladat = random(2);
new spawn = random(sizeof(ZombieSpawns));
SetPlayerPos(playerid, ZombieSpawns[spawn][0], ZombieSpawns[spawn][1], ZombieSpawns[spawn][2]);
if(randomuladat == 0)
{
zombiklasi[playerid] = 1;
SetPlayerSkin(playerid, 162);
SetRNPCHealth(playerid, 150);
}
if(randomuladat == 1)
{
zombiklasi[playerid] = 2;
SetRNPCHealth(playerid, 200);
SetPlayerSkin(playerid, ZSkins[random(4)]);
SetPlayerAttachedObject(playerid, 1, 2908, 2, 0.064999,0.045000,0.000999, 176.500000, 5.699998, 95.000007, 0.941999, 1.082999, 1.075000);
SetPlayerAttachedObject(playerid, 2, 2907, 1, 0.038000,0.051000,0.027000,-94.999984, -0.299995, 89.399932, 1.0, 0.739000, 1.211000);
SetPlayerAttachedObject(playerid, 3, 2906, 5, -0.146000,0.000000,-0.007000,10.299988,1.500002, -89.800010, 1.0, 1.0, 1.0);
SetPlayerAttachedObject(playerid, 4, 2905, 10, -0.176999,0.082000,0.005000, 0.000000, 0.000000, -92.700004,1.067999, 0.662999, 0.998000);
SetPlayerAttachedObject(playerid, 5, 2804, 8, 0.240999,0.034000,0.000000, 0.000000, 0.000000,91.499977, 0.757999, 1.000000, 1.214999);
SetPlayerAttachedObject(playerid, 5, 2803, 1,0.132999,-0.161000,0.000000, 0.000000,91.599998,102.699989, 0.259000,0.369999, 0.719000);
}
if(randomuladat == 2)
{
zombiklasi[playerid] = 3;
SetRNPCHealth(playerid, 350);
SetPlayerSkin(playerid, ZSkins[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..299: SPAO21{0.24, 0.06, 0.488, 14.699, -81.999, -0.398, 1.485, 1.413, 1.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..299: SPAO22{-0.051, 0.071, 0.033, 91.801, -172.199, -91.898, 2.157, 0.998, 2.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..299: SPAO23{0.622, 0.134, 0.045, 1.998, 170, -81.699, 2.674, 2.335, 2.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..299: SPAO24{0.324, 0.121, -0.359, 107.899, 95, -119.299, 1.876, 1.292, 1.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..299: SPAO25{-0.323, 0.226, 0.032, -4.499, -3.199, -77.899, 2.302, 1.278, 2.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..299: SPAO26{-0.26, 0.143, 0.064, -140, 174.901, 93, 2.573, 1.110, 2.330}
}
}
SetPlayerColor(playerid, ZOMBIE_COLOR);
RNPC_SetShootable(playerid, 1);
RNPC_ToggleVehicleCollisionCheck(playerid, 1);
GetZombieVictimID[playerid] = INVALID_PLAYER_ID;
return 1;
}
else
{
GetVictimDetectRange[playerid] = ZOMBIE_DETECT;
GetVictimTimerStatus[playerid] = 0;
}
public OnZombieAttack()
{
for(new npcid = 0; npcid < MAX_ZOMBIES; npcid++)
{
if(IsPlayerNPC(npcid))
{
if(GetRNPCHealth(npcid) > 0)
{
new victim = GetZombieVictim(npcid), Float:x, Float:y, Float:z, Float:health;
GetPlayerPos(npcid, x, y, z);
if(victim != INVALID_PLAYER_ID)
{
if(IsPlayerInRangeOfPoint(victim, GetVictimDetectRange[victim], x, y, z))
{
GetZombieVictimID[npcid] = victim;
if(IsPlayerInRangeOfPoint(victim, 1, x, y, z))
{
RNPC_CreateBuild(npcid, PLAYER_RECORDING_TYPE_ONFOOT);
RNPC_AddPause(100);
RNPC_SetKeys(KEY_FIRE);
RNPC_AddPause(100);
RNPC_SetKeys(0);
RNPC_FinishBuild();
RNPC_StartBuildPlayback(npcid);
GetPlayerHealth(victim, health);
SetPlayerHealth(victim, health - ZOMBIE_DAMAGE);
Player[victim][pBlood] -= random(3500);
continue;
}
GetPlayerPos(victim, x, y, z);
MoveRNPC(npcid, x, y, z, RNPC_SPEED_RUN, 1);
}
}
}
}
}
return 1;
}
public OnZombieRoam()
{
for(new npcid = 0; npcid < MAX_ZOMBIES; npcid++)
{
if(IsPlayerNPC(npcid))
{
if(GetRNPCHealth(npcid) > 0)
{
new victim = GetZombieVictim(npcid), Float:x, Float:y, Float:z;
GetPlayerPos(npcid, x, y, z);
if(victim == INVALID_PLAYER_ID)
{
new pos = random(4);
if(pos == 0) { x = x + 100.0; }
else if(pos == 1) { x = x - 100.0; }
else if(pos == 2) { y = y + 100.0; }
else if(pos == 3) { y = y - 100.0; }
GetZombieVictimID[npcid] = INVALID_PLAYER_ID;
RNPC_SetKeys(0);
MoveRNPC(npcid, x, y, z, RNPC_SPEED_WALK, 1);
}
}
}
}
return 1;
}
public ResetDetectRange(playerid)
{
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
{
GetVictimDetectRange[playerid] = (ZOMBIE_DETECT / 4);
GetVictimTimerStatus[playerid] = 1;
GetVictimResetTimer[playerid] = SetTimerEx("ResetDetectRange", 5000, false, "i", playerid);
return 1;
}
GetVictimTimerStatus[playerid] = 0;
GetVictimDetectRange[playerid] = ZOMBIE_DETECT;
return 1;
}
stock GetZombieVictim(npcid)
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if(!IsPlayerNPC(playerid) && IsPlayerConnected(playerid))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(npcid, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, GetVictimDetectRange[playerid], x, y, z) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && GetPlayerInterior(playerid) == 0 && GetPlayerVirtualWorld(playerid) == 0) return playerid;
}
}
return INVALID_PLAYER_ID;
}
stock GetMaxZombies()
{
return 350;
}
----------
Loaded log file: "server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team
[05:01:07] filterscripts = "" (string)
[05:01:07]
[05:01:07] Server Plugins
[05:01:07] --------------
[05:01:07] Loading plugin: streamer.so
[05:01:08]
*** Streamer Plugin v2.8.2 by Incognito loaded ***
[05:01:08] Loaded.
[05:01:08] Loading plugin: sscanf.so
[05:01:08]
[05:01:08] ===============================
[05:01:08] sscanf plugin loaded.
[05:01:08] Version: 2.8.1
[05:01:08] (c) 2012 Alex "******" Cole
[05:01:08] ===============================
[05:01:08] Loaded.
[05:01:08] Loading plugin: MapAndreas.so
[05:01:08] Loaded.
[05:01:08] Loading plugin: RNPC.so
[05:01:08] RNPC V0.4.1 by Mauzen (03.12.2014)
[05:01:08] Loaded.
[05:01:08] Loaded 4 plugins.
[05:01:08]
[05:01:08] Filterscripts
[05:01:08] ---------------
[05:01:08] Loaded 0 filterscripts.
[05:01:08] RNPC versionchecker: checking for updates...
[05:01:08] Setting server password to: "258"
[05:01:08] [connection] 217.106.106.116:47754 requests connection cookie.
[05:01:08] [connection] 217.106.106.116:58804 requests connection cookie.
[05:01:08] [connection] 217.106.106.116:34901 requests connection cookie.
[05:01:08] [connection] 217.106.106.116:60094 requests connection cookie.
[05:01:08] [connection] 217.106.106.116:42116 requests connection cookie.
[05:01:08] [connection] 217.106.106.116:33644 requests connection cookie.
[05:01:08] Chaitvirta: 13 Zombi
[05:01:08] [connection] 217.106.106.116:51040 requests connection cookie.
[05:01:08] [connection] 217.106.106.116:54419 requests connection cookie.
[05:01:08] [connection] 217.106.106.116:36938 requests connection cookie.
[05:01:08] [connection] 217.106.106.116:49631 requests connection cookie.
[05:01:08] [connection] 217.106.106.116:56713 requests connection cookie.
[05:01:08] [connection] 217.106.106.116:54416 requests connection cookie.
[05:01:08] Boxes loaded = 0
[05:01:08] [connection] 217.106.106.116:50160 requests connection cookie.
[05:01:08] Obieqtebi Failebidan: 0
[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 Version: v.0.0.4B |
[05:01:08] *--------------------------------------------------*
[05:01:08] Number of vehicle models: 22
[05:01:09] [connection] incoming connection: 217.106.106.116:47754 id: 0
[05:01:09] [connection] incoming connection: 217.106.106.116:58804 id: 1
[05:01:09] [connection] incoming connection: 217.106.106.116:34901 id: 2
[05:01:09] [connection] incoming connection: 217.106.106.116:42116 id: 3
[05:01:09] [connection] incoming connection: 217.106.106.116:60094 id: 4
[05:01:09] [connection] incoming connection: 217.106.106.116:33644 id: 5
[05:01:09] [connection] incoming connection: 217.106.106.116:51040 id: 6
[05:01:09] [connection] incoming connection: 217.106.106.116:54419 id: 7
[05:01:09] [connection] incoming connection: 217.106.106.116:36938 id: 8
[05:01:09] [connection] incoming connection: 217.106.106.116:49631 id: 9
[05:01:09] [connection] incoming connection: 217.106.106.116:56713 id: 10
[05:01:09] [connection] incoming connection: 217.106.106.116:54416 id: 11
[05:01:09] [connection] incoming connection: 217.106.106.116:50160 id: 12
[05:01:09] Total vehicles from files: 3000
[05:01:09] OneSecondTimers: 0 ms
[05:01:09] [npc:join] ZOMBIE[2] has joined the server (0:217.106.106.116)
[05:01:09] [npc:join] ZOMBIE[1] has joined the server (1:217.106.106.116)
[05:01:09] [npc:join] ZOMBIE[3] has joined the server (2:217.106.106.116)
[05:01:09] [npc:join] ZOMBIE[4] has joined the server (3:217.106.106.116)
[05:01:09] [npc:join] ZOMBIE[6] has joined the server (4:217.106.106.116)
[05:01:09] [npc:join] ZOMBIE[5] has joined the server (5:217.106.106.116)
[05:01:09] [npc:join] ZOMBIE[8] has joined the server (7:217.106.106.116)
[05:01:09] [npc:join] ZOMBIE[7] has joined the server (6:217.106.106.116)
[05:01:09] [npc:join] ZOMBIE[9] has joined the server (8:217.106.106.116)
[05:01:09] [npc:join] ZOMBIE[12] has joined the server (9:217.106.106.116)