Zombie nгo conecta
#1

eu queria saber pq esse FS nгo quer carregar mais que 4 Zombie no meu servidor


#include <a_samp>
#include <FCNPC>


#define CONNECT_ZUMBIS

#define MAX_ZUMBIS 6
new Float:ZPos[MAX_ZUMBIS][4] = {
{,1400.9850,255.5069,19.4063,164.8415}, // 0
{1326.5189,234.9511,19.4063,138.8346}, // 1
{1272.4264,170.6183,19.8664,236.9089}, // 2
{1219.0247,232.1208,19.5469,329.9698}, // 3
{1146.8674,-1770.4843,16.5992,183.5936}, //4
{1326.5189,234.9511,19.4063,138.8346}//5
};

new Attack[MAX_PLAYERS];
new ZombieEnd;
new ZombieFirst;

public OnFilterScriptInit()
{
CriarZumbis();
SetTimer("Timer", 400, true);
return 1;
}

forward Timer();
public Timer()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
new Float:zP[20], Float:dist;
for(new npcid = ZombieFirst; npcid > ZombieEnd-1; npcid--)
{
FCNPC_GetPosition(npcid, zP[0], zP[1], zP[2]);
dist = GetPlayerDistanceFromPoint(i, zP[0], zP[1], zP[2]);
if(dist <= 0.5)
{
if(Attack[npcid] == 0)
{
FCNPC_MeleeAttack(npcid, -1);
if(dist >= 0.1) FCNPC_SetAngleToPlayer(npcid, i);
Attack[npcid] = 1;
}
}
else if(dist <= 35.0)
{
new FloatP[3];
if(Attack[npcid] == 1)
{
Attack[npcid] = 0;
FCNPC_StopAttack(npcid);
}
GetPlayerPos(i, pP[0], pP[1], pP[2]);
FCNPC_GoTo(npcid, pP[0], pP[1], pP[2], MOVE_TYPE_RUN, 0.5, true, 0.0, true);
}
else FCNPC_Stop(npcid);
}
}
}
return 1;
}

stock CriarZumbis()
{
new str[30];
for(new i = 0; i < MAX_ZUMBIS; i++)
{
format(str, sizeof(str), "Zombie_%i", i);
new npcid = FCNPC_Create(str);
if(ZombieFirst == 0) ZombieFirst = npcid;
ZombieEnd = npcid;
FCNPC_Spawn(npcid, 162, ZPos[i][0], ZPos[i][1], ZPos[i][2]);

FCNPC_SetAngle(npcid, ZPos[i][3]);
FCNPC_SetInterior(npcid, 0);
FCNPC_SetArmour(npcid, 80);
FCNPC_SetWeapon(npcid, 4);
FCNPC_SetAmmo(npcid, 1);

printf("Zombie %d created", i);
}
return 1;
}

forward RespawnZumbis();
public RespawnZumbis()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerNPC(i))
{
if(FCNPC_IsDead(i))
{
FCNPC_Respawn(i);
}
}
}
return 1;
}

public FCNPC_OnDeath(npcid, killerid, weaponid)
{
if(killerid != INVALID_PLAYER_ID)
{
}
//FCNPC_Respawn(npcid);
return 1;
}

public FCNPC_OnTakeDamage(npcid, damagerid, weaponid, bodypart, Float:health_loss)
{
if(bodypart == 100)
{
FCNPC_SetHealth(npcid, 0);
}
return 1;
}
Reply
#2

Veja no server.cfg se maxnpc estб com limite maior ou igual o de zumbis (no caso, 6).
Reply
#3

Quote:
Originally Posted by RodrigoMSR
Посмотреть сообщение
Veja no server.cfg se maxnpc estб com limite maior ou igual o de zumbis (no caso, 6).
Caramba Man ce me ajudou muito passei 1 dia pra tentar soucionar esse caso, e nгo percebi que era sу mudar o valor no server.cfg, uma pequena coisa bem simples de se fazer mudou tudo u.u primeira vez que postei nesse forъm e jб gostei SZ
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)