SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 07/01/2019, 04:14 PM   #1
KayJ
Gangsta
 
KayJ's Avatar
 
Join Date: Apr 2014
Posts: 674
Reputation: 64
Flowers Zombie [FCNPC][A.I]

Zombie [FCNPC][A.I]

About:
Zombie Bot script inspired from ZNPC & iZombies and some more scripts.

Features:
  • Custom damage to zombies from players (configurable).
  • Custom damage from zombies to players (configurable).
  • Zombies have melee weapons (shovel/knife/katana - custom damage).
  • Zombies will roam around the map.
  • Zombies will more attracted to players who shoot nearby them (except silencer & melee weapons)
  • Zombies will less attracted to players who crouch/duck near them.
  • Zombies will more attracted to players who sprint.
  • Zombies have custom damage bar on their head (https://imgur.com/egi6RrL).
  • Latest FCNPC and ColAndreas/MapAndreas(1.0) is used.
  • Zombies get headshot from all weapons(only zombies).

Note:
The script might have some bugs, I'll fix them as I find them.. Including zombies flying..

Media:
Custom zombie damage - https://imgur.com/egi6RrL
Zombie kill human (death window) - https://imgur.com/a/HtuyjVH
Video - Probably.

Download:
zombie.pwn: Pastebin | RAW | Github
FCNPC: Github
ColAndreas: Github
MapAndreas: Forum Topic
YSI Timers: Github

Last edited by KayJ; 07/01/2019 at 05:07 PM.
KayJ is offline   Reply With Quote
Old 07/01/2019, 04:18 PM   #2
Hazon
Big Clucker
 
Hazon's Avatar
 
Join Date: May 2018
Location: Who cares ?
Posts: 139
Reputation: 18
Default Re: Zombie [FCNPC][A.I]

I've never seen in the any community zombie actually 'run' just walk and they can't even reach the players who run. What about this (ez) ?
Hazon is offline   Reply With Quote
Old 07/01/2019, 04:34 PM   #3
KayJ
Gangsta
 
KayJ's Avatar
 
Join Date: Apr 2014
Posts: 674
Reputation: 64
Question Re: Zombie [FCNPC][A.I]

Quote:
Originally Posted by Hazon View Post
I've never seen in the any community zombie actually 'run' just walk and they can't even reach the players who run. What about this (ez) ?
I don't fully understand what you're trying to point out here... But here's my assumption and answer:
1. You can make them run by changing styles of MOVE_TYPE
2. State of Decay: SAMP Source have zombies which sprint, they also featured that in ZNPC topic.
3. You can set their speed of running..
__________________
SA:MP Wikipedia Profile

SA:MP Github Profile

Quote:
Originally Posted by ****** View Post
This is an extremely complex operation, revealed only to the best mathematicians in the world. It is called "multiplication"....
Quote:
Originally Posted by KayJ View Post
Go mobile or this will die. Many developers see and many don't but there will be heavy drop of playerbase in samp in next 5 years as people are going mobile and use pc mostly for next gen games not this decade old game.
KayJ is offline   Reply With Quote
Old 07/01/2019, 04:40 PM   #4
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,833
Reputation: 1292
Default Re: Zombie [FCNPC][A.I]

This script it not even close to being ready for release!

Just for starters.

Use a switch!
Code:
    if(weaponid == 24) FCNPC_SetHealth(npcid, FCNPC_GetHealth(npcid)-50);//DesertEagle
    if(weaponid == 22) FCNPC_SetHealth(npcid, FCNPC_GetHealth(npcid)-50);//Colt45
    if(weaponid == 32) FCNPC_SetHealth(npcid, FCNPC_GetHealth(npcid)-10);//Tec9
    if(weaponid == 28) FCNPC_SetHealth(npcid, FCNPC_GetHealth(npcid)-10);//Uzi
    if(weaponid == 23) FCNPC_SetHealth(npcid, FCNPC_GetHealth(npcid)-50);//SilencedColt
    if(weaponid == 31) FCNPC_SetHealth(npcid, FCNPC_GetHealth(npcid)-35);//M4
    if(weaponid == 30) FCNPC_SetHealth(npcid, FCNPC_GetHealth(npcid)-40);//AK
    if(weaponid == 29) FCNPC_SetHealth(npcid, FCNPC_GetHealth(npcid)-18);//MP5
    if(weaponid == 34) FCNPC_SetHealth(npcid, FCNPC_GetHealth(npcid)-300);//SniperRifle
    if(weaponid == 33) FCNPC_SetHealth(npcid, FCNPC_GetHealth(npcid)-35);//CuntGun
    if(weaponid == 25) FCNPC_SetHealth(npcid, FCNPC_GetHealth(npcid)-100);//PumpShotgun
    if(weaponid == 27) FCNPC_SetHealth(npcid, FCNPC_GetHealth(npcid)-70);//Spaz12

You shouldn't need to check if players/npcs are connected (unless there is some issue where a sanity check is required) if it is for whatever reason then issuerid != INVALID_PLAYER_ID is a useless check. There is a lot of this in your script.
Code:
    if(!IsPlayerConnected(npcid)) return 0;
    if(!IsPlayerConnected(issuerid)) return 0;
    if(issuerid != INVALID_PLAYER_ID && weaponid >= 22 && weaponid <= 38 && bodypart == 9)
Next example instead of having extra code which does nothing you are lacking code here. Why would you start doing checks without even making sure the zombie is actually streamed in for the player?
Code:
foreach(new i : Player)
    {
        GetPlayerPos(i, xa, ya, za);
        if(IsPlayerInRangeOfPoint(zombieid, 1, xa, ya, za))
Now here is where things get retarded and highlights failure to polish your work.
Code:
SetTimer("ResetDetectRange", 5000, false);
Yet again lacking code....
Code:
public ResetDetectRange(playerid)
{
    HumanFound[playerid] = 0;
    return 1;
}
Pottus is offline   Reply With Quote
Old 07/01/2019, 04:56 PM   #5
KayJ
Gangsta
 
KayJ's Avatar
 
Join Date: Apr 2014
Posts: 674
Reputation: 64
Default Re: Zombie [FCNPC][A.I]

I'm new in npc working and stuff... I do note all your observations and improve it.
__________________
SA:MP Wikipedia Profile

SA:MP Github Profile

Quote:
Originally Posted by ****** View Post
This is an extremely complex operation, revealed only to the best mathematicians in the world. It is called "multiplication"....
Quote:
Originally Posted by KayJ View Post
Go mobile or this will die. Many developers see and many don't but there will be heavy drop of playerbase in samp in next 5 years as people are going mobile and use pc mostly for next gen games not this decade old game.
KayJ is offline   Reply With Quote
Old 28/01/2019, 07:52 AM   #6
Matyaas
Huge Clucker
 
Matyaas's Avatar
 
Join Date: Mar 2012
Posts: 383
Reputation: 9
Default Re: Zombie [FCNPC][A.I]

Pottus you recomended me this filterscript?
__________________
Matyaas is offline   Reply With Quote
Old 28/01/2019, 08:08 AM   #7
iLearner
Gangsta
 
iLearner's Avatar
 
Join Date: Apr 2017
Posts: 579
Reputation: 134
Default Re: Zombie [FCNPC][A.I]

Quote:
Originally Posted by KayJ View Post
I'm new in npc working and stuff... I do note all your observations and improve it.
things he pointed out are not related to npcs specifically though, for instance the timer, it's completely off the road.
iLearner is offline   Reply With Quote
Old 28/01/2019, 01:58 PM   #8
Lokii
Huge Clucker
 
Join Date: Sep 2017
Posts: 375
Reputation: 87
Default Re: Zombie [FCNPC][A.I]

You also should return 0 OnPlayerTakeDamage
__________________
Lokii is offline   Reply With Quote
Old 28/01/2019, 03:57 PM   #9
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,833
Reputation: 1292
Default Re: Zombie [FCNPC][A.I]

Quote:
Originally Posted by iLearner View Post
things he pointed out are not related to npcs specifically though, for instance the timer, it's completely off the road.
Still no improvements for almost a month.
1-star from me.
Pottus is offline   Reply With Quote
Old 13/08/2019, 10:39 PM   #10
Goku
Little Clucker
 
Goku's Avatar
 
Join Date: Aug 2019
Location: X, Y, Z
Posts: 16
Reputation: 0
Default Re: Zombie [FCNPC][A.I]

there is a problem in the script they stop there heads when the player stop on near to them or something like that

here is the fix for it :

Code:
	new Float:xa,Float:ya,Float:za;
	if(FCNPC_IsDead(zombieid)) return 1;
    foreach(new playerid : Player)
	{
		GetPlayerPos(playerid,xa,ya,za);
        if(IsPlayerInRangeOfPoint(zombieid,1.0,xa,ya,za))
		{
			HumanFound[zombieid] = 2;
			FCNPC_MeleeAttack(zombieid,100);
			break;
		}
		else if(IsPlayerInRangeOfPoint(zombieid,25.0,xa,ya,za))
		{
			if(HumanFound[zombieid] == 2)
			{
				FCNPC_Stop(zombieid);
				FCNPC_StopAttack(zombieid);
			}
			HumanFound[zombieid] = 1;
			FCNPC_GoTo(zombieid,xa,ya,za,FCNPC_MOVE_TYPE_RUN,0.5, false);
			break;
		}
		else if(IsPlayerInRangeOfPoint(zombieid,25.0,xa,ya,za)) //your defined zombie range or use directly
		{
			if(HumanFound[zombieid] == 2)
			{
				FCNPC_Stop(zombieid);
				FCNPC_StopAttack(zombieid);
			}
			HumanFound[zombieid] = 1;
			FCNPC_GoToPlayerEx(zombieid, playerid,5,5,FCNPC_MOVE_TYPE_RUN);
			break;
		}
		else
		{
  			HumanFound[zombieid] = 0;
			new Float:x, Float:y, Float:z;
			GetPlayerPos(zombieid, x, y, z);
			FCNPC_StopAttack(zombieid);
			if(HumanFound[zombieid] == 0)
			{
				new pos = random(6);
				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; }
    		 	        else if(pos == 4) { z = z + 100.0; }
				else if(pos == 5) { z = z - 100.0; }

				FCNPC_SetKeys(zombieid, 0, 0, 0);
				FCNPC_GoTo(zombieid, x, y, z, FCNPC_MOVE_TYPE_WALK);
            }
		}
	}
__________________
Code:
public OnPlayerConnect(playerid)
{
     SendClientMessage(playerid,-1,Welcome to my server and now good bye :p);
     Kick(playerid);
     return 1;
}
Goku is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Zombie FCNPC Include. MarkNelson Scripting Help 6 20/07/2017 06:41 PM
[FilterScript] FCNPC ZOMBIE VinPure Filterscripts 25 12/07/2017 10:40 PM
Why i don't see my NPC Zombie Bots after compile and use FCNPC?(+REP) MarkNelson Scripting Help 4 12/07/2016 12:24 AM
Zombie FCNPC KeNTos Scripting Help 0 20/10/2013 08:50 AM


All times are GMT. The time now is 11:15 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.