This script is the first release of my NPC based Zombie System with Advanced AI using RNPC. The script is realistic with Sound Detection AI System making zombies more attracted to noise like gunshots, sprinting players and less attracted to crouching players allowing players to move around zombies undetected. Enjoy! |
1. Zombies will roam the map until they detect a victim, then they will attack. 2. Zombies will feast on killed victims and regain full health. 3. Zombies are more attracted to noise like gunshots and sprinting players. (AI) 4. Zombies are less attracted to crouching players, allowing players to move around zombies undetected. (AI) |
1. Install RNPC(0.4.1) and MapAndreas(v1.0 beta) if required via the links below. 2. Open the Pastebin link below and paste it into pawno. 3. Edit desired definitions and make sure you add spawn locations for zombies, then compile. (IMPORTANT!) 4. Place the compiled filterscript into you "filterscript" folder. 5. Open you "server.cfg" and edit your "filterscripts" and "plugins" lines and add the filterscript/plugins names. 6. Open you "server.cfg" and change "maxnpc" to the MAX_ZOMBIES amount. |
//Example Timer
public LoadZombies()//Modify to suit your server
{
RNPC_SetUpdateRate(80);
MapAndreas_Init(MAP_ANDREAS_MODE_NOBUFFER);
new name[24];
format(name, sizeof(name), "zname_%i", zombie_count + 1);
ConnectRNPC(name);
zombie_count++;
if(zombie_count == MAX_ZOMBIES)
{
KillTimer(ZombieTimer);//Kill LoadZombies under OnGameModeInit
}
return 1;
}
1. RNPC(0.4.1): http://www.forum.sa-mp.com/showthread.php?t=355849 (Credits: Mauzen) 2. MapAndreas(v1.0 beta): http://www.forum.sa-mp.com/showthread.php?t=120013 (Credits: Kalcor) 3. ZNPC(v1.0): http://www.pastebin.com/W0Laphjx (Credits: Weponz) |
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
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", 5000, false, "i", playerid);
}
}
else if(newkeys & KEY_SPRINT && GetVictimTimerStatus[playerid] == 0)
{
GetVictimDetectRange[playerid] = (ZOMBIE_DETECT * 2);
GetVictimTimerStatus[playerid] = 1;
GetVictimResetTimer[playerid] = SetTimerEx("ResetDetectRange", 5000, false, "i", playerid);
}
}
return 1;
}
C:\Users\faiz\Desktop\NEW3\pawno\include\rnpc.inc(539) : error 025: function heading differs from prototype C:\Users\faiz\Desktop\Zom.pwn(41) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(59) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(62) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(111) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(133) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(147) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(163) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(164) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(180) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(181) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(184) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(204) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(237) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
Код:
C:\Users\faiz\Desktop\NEW3\pawno\include\rnpc.inc(539) : error 025: function heading differs from prototype C:\Users\faiz\Desktop\Zom.pwn(41) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(59) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(62) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(111) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(133) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(147) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(163) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(164) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(180) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(181) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(184) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(204) : warning 217: loose indentation C:\Users\faiz\Desktop\Zom.pwn(237) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |
Sorry for double posting,here's some screenshoots
http://postimg.org/image/iagyxkl0j/ http://postimg.org/image/5lbk5kcql/ http://postimg.org/image/5u49kl2e1/ http://postimg.org/image/c7hyij27z/ Its fun,but some zombies are stuck inside of building lol |
When you kill the zombies you get money or something? What other bugs you faced?
|
I've changed the spawn coordinates for the zombies but they just TP underground and roam from there. Any reason why?
EDIT: I see them spawn where I set them then after a few seconds it TPs underground. |
When you kill the zombies you get money or something? What other bugs you faced?
|