SA-MP Forums Archive
NPC problems - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: NPC problems (/showthread.php?tid=488844)



RNPC problems - Speedy552 - 19.01.2014

hi guys!

I tought creating Zombie NPC is easy but it isn't...

When player is at range of bot, the bot starts following him.
i'm using RNPC... http://forum.sa-mp.com/showthread.ph...highlight=rnpc

Код:
stock FollowPlayer(npcid, targetid)
{
    SetTimerEx("Follower", 500, 1, "ii", npcid, targetid);
}
forward Follower(npcid, targetid);
public Follower(npcid, targetid)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(targetid, x, y, z);
MoveRNPC(npcid, x, y, z, 0.006);
return 0;
}
COMMAND:zombie(playerid, params[])
{
Zombie = ConnectRNPC("Zombie1");
RNPC_CreateBuild(Zombie, PLAYER_RECORDING_TYPE_ONFOOT);
RNPC_SetAcceleration(0.003);
RNPC_AddMovementAlt(0.0, 0.0, 25.0, 0.0, 500.0, 25.0, 0.15, false);
RNPC_FinishBuild();
RNPC_StartBuildPlayback(Zombie);
FollowPlayer(Zombie,playerid);
return 1;
}
it is working but with command... i need an automatic stuff for this...


__________________________________________________ _______________

Another problem is the health.
if you shoot him, he doesn't die.
is it possible to kill him with weapons?


thanx for answers!