PDA

View Full Version : [FCNPC] NPC move randomly


Eibison
13/02/2018, 06:00 PM
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

public MoverBandido(npcid)
{
new Float:xb, 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?

Mugala
13/02/2018, 06:26 PM
they'll stay if u dont loop or do something.

Eibison
13/02/2018, 06:29 PM
they'll stay if u dont loop or do something.

Excuse my noobness, but isn't using switch enough?