SA-MP Forums Archive
Bots zombies inteligentes - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Bots zombies inteligentes (/showthread.php?tid=627688)



Bots zombies inteligentes - Corin - 31.01.2017

Hola queridos amigos, tengo un proyecto de supervivencia, pero consigo una parte estoy teniendo problemas son el zombi.
He creado un solo zombi para tratar, sin embargo pasar el zombi dentro de las paredes y volar, me gustarнa un poco de ayuda de usted, he estado investigando y descubrir que hay que fijarla con ColAndreas, pero no puedo hacer esto me volverнa a alojar el mismo este vнdeo (Haga clic aquн para ver el video) Si alguien tiene pornto y le gustarнa compartir serнa agradecido y dar rap ++


Esto y el cуdigo que crea y el zombi estб volando y va dentro de las paredes.

Код:
#define MAX_ZOMBIES 1

new Float:ZombieSpawns[1][4] =
{
     {1211.4139,208.9426,19.5547}
};

stock CriarZumbis()
{
    new str[30];
    for(new i = 0; i < MAX_ZOMBIES; i++)
    {
        format(str, sizeof(str), "Zombie_%i", i);
        FCNPC_Create(str);
    }
    return 1;
}

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

public FCNPC_OnDeath(npcid, killerid, weaponid)
{
    if(killerid != INVALID_PLAYER_ID && IsPlayerConnected(killerid))
    {
        GameTextForPlayer(killerid, "~w~(Zombie Kill)~n~+5 EXP", 2500, 3);
    }
    return 1;
}

public FCNPC_OnCreate(npcid)
{
    new rand = random(sizeof(ZombieSpawns));
    FCNPC_Spawn(npcid, 162, ZombieSpawns[rand][0],ZombieSpawns[rand][1], ZombieSpawns[rand][2]);
    FCNPC_SetInvulnerable(npcid, false);
    return 1;
}

public FCNPC_OnSpawn(npcid)
{
    SetPlayerAttachedObject(npcid, 0, 2908, 2, 0.0800, 0.0690, 0.0000, 180.0000, 0.0999, 88.9000, 1.2860, 1.1280, 1.1540, 0xFFFFFFFF, 0xFFFFFFFF);
    SetPlayerAttachedObject(npcid, 1, 2907, 1, 0.1060, 0.0359, 0.0259, -88.9999, 0.9000, 88.6999, 1.0000, 0.6489, 1.1440, 0xFFFFFFFF, 0xFFFFFFFF);
    return 1;
}


public FCNPC_OnUpdate(npcid)
{
    foreach(new i : Player)
    {
        if(!IsPlayerNPC(i) && IsPlayerConnected(i))
        {
            new Float:zP[3], Float:pP[3];
            GetPlayerPos(npcid, zP[0], zP[1], zP[2]); 
            GetPlayerPos(i, pP[0], pP[1], pP[2]); 
            if(IsPlayerInRangeOfPoint(i, 15.0, zP[0], zP[1], zP[2])) FCNPC_GoTo(npcid, pP[0], pP[1], pP[2], MOVE_TYPE_RUN, 0.5, false, 0.0, true); 
            if(IsPlayerInRangeOfPoint(i, 1.0, zP[0], zP[1], zP[2])) 
            {
                FCNPC_Stop(npcid); 
                FCNPC_MeleeAttack(npcid, -1, true); 
            }
            else FCNPC_StopAttack(npcid); 

        }
    }
    return 1;
}



Re: Respuesta: Bots zombies inteligentes - tostad0r - 31.01.2017

Quote:
Originally Posted by SkyT
Посмотреть сообщение
Ya encontraste tu hotel ideal al mejor precio?
No seas uno mбs del montуn, dejen de quemar memes un toque, el caretaje les pega a todos re fuerte loco.


Respuesta: Bots zombies inteligentes - Zume - 31.01.2017

Luce bien, quй sucede cuando hay mбs de un jugador cerca del radio del zombie?


Respuesta: Bots zombies inteligentes - Whillyrez - 31.01.2017

Y si usas un path finder?


Respuesta: Bots zombies inteligentes - Eloy - 31.01.2017

Quote:
Originally Posted by Zume
Посмотреть сообщение
Luce bien, quй sucede cuando hay mбs de un jugador cerca del radio del zombie?
El zombie se vuelve loco hahahaha

nah mentira elije un jugador aleatorio y comienza a realizar las funciones que le asignaron (seguirlo, disparar, atacar, etc)


Re: Respuesta: Bots zombies inteligentes - Corin - 31.01.2017

Quote:
Originally Posted by Eloy
Посмотреть сообщение
El zombie se vuelve loco hahahaha

nah mentira elije un jugador aleatorio y comienza a realizar las funciones que le asignaron (seguirlo, disparar, atacar, etc)
ataca el jugador sн