SA-MP Forums Archive
[FCNPC] NPC move randomly - 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: [FCNPC] NPC move randomly (/showthread.php?tid=649703)



[FCNPC] NPC move randomly - Eibison - 13.02.2018

Hello!

I'm trying to make my NPC made with FCNPC move randomly, but it seems my knowledge doesn't allow me to do so, lol.

Here's my ''Move NPC'' function

Quote:

public MoverBandido(npcid)
{
new Floatb, Float:yb, Float:zb;
GetPlayerPos(npcid, xb, yb, zb);
new m = 0;
if(m == 0)
{
m++;
switch (m)
{
case 10:
{
FCNPC_GoTo(npcid, xb+10, yb, zb, FCNPC_MOVE_TYPE_WALK);
}
case 20:
{
FCNPC_GoTo(npcid, xb+20, yb, zb, FCNPC_MOVE_TYPE_WALK);
}
case 50:
{
FCNPC_GoTo(npcid, xb+20, yb, zb, FCNPC_MOVE_TYPE_WALK);
}
case 70:
{
FCNPC_GoTo(npcid, xb+5, yb, zb, FCNPC_MOVE_TYPE_WALK);
m = 0;
}
}
}
}

I know it will not make them move ''randomly'', but they're not moving at all, they just spawn and stand still. What can I do?


Re: [FCNPC] NPC move randomly - Mugala - 13.02.2018

they'll stay if u dont loop or do something.


Re: [FCNPC] NPC move randomly - Eibison - 13.02.2018

Quote:
Originally Posted by Mugala
Посмотреть сообщение
they'll stay if u dont loop or do something.
Excuse my noobness, but isn't using switch enough?