[FilterScript] Zombie [FCNPC][A.I]
#4

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;
}
Reply


Messages In This Thread
Zombie [FCNPC][A.I] - by KayJ - 07.01.2019, 15:14
Re: Zombie [FCNPC][A.I] - by Hazon - 07.01.2019, 15:18
Re: Zombie [FCNPC][A.I] - by KayJ - 07.01.2019, 15:34
Re: Zombie [FCNPC][A.I] - by Pottus - 07.01.2019, 15:40
Re: Zombie [FCNPC][A.I] - by KayJ - 07.01.2019, 15:56
Re: Zombie [FCNPC][A.I] - by Matyaas - 28.01.2019, 06:52
Re: Zombie [FCNPC][A.I] - by iLearner - 28.01.2019, 07:08
Re: Zombie [FCNPC][A.I] - by Lokii - 28.01.2019, 12:58
Re: Zombie [FCNPC][A.I] - by Pottus - 28.01.2019, 14:57

Forum Jump:


Users browsing this thread: 1 Guest(s)