SA-MP Forums Archive
Help: NPC Driver dont move. - 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: Help: NPC Driver dont move. (/showthread.php?tid=660819)



Help: NPC Driver dont move. - bookknp - 14.11.2018

hello friends, I have a problem when I try to move the Npc driver of a car does not move with FCNPC_GOTO, what is the function FCNPC to move the car?

PHP код:
FCNPC_EnterVehicle(bot55460, -1);
FCNPC_GoTo(bot5,-2420.2437,-65.4272,35.14620FCNPC_MOVE_TYPE_AUTOtrue0.0true0.0250); 



Re: Help: NPC Driver dont move. - NaS - 14.11.2018

FCNPC_GoTo works for drivers too.

Problem might be that you didn't set up MapAndreas correctly.

Download MapAndreas and install it.

Then put this into OnFilterScriptInit or OnGameModeInit:

Код:
MapAndreas_Init(MAP_ANDREAS_MODE_FULL);
FCNPC_InitMapAndreas(MapAndreas_GetAddress());
Otherwise FCNPC cannot get any map height data.


Re: Help: NPC Driver dont move. - bookknp - 14.11.2018

Quote:
Originally Posted by NaS
Посмотреть сообщение
FCNPC_GoTo works for drivers too.

Problem might be that you didn't set up MapAndreas correctly.

Download MapAndreas and install it.

Then put this into OnFilterScriptInit or OnGameModeInit:

Код:
MapAndreas_Init(MAP_ANDREAS_MODE_FULL);
FCNPC_InitMapAndreas(MapAndreas_GetAddress());
Otherwise FCNPC cannot get any map height data.
Thx very much NAS, but car still dont move. (i copy ur code in gamemode)

this is code right?

PHP код:
FCNPC_GoTo(bot5,-2420.2437,-65.4272,35.1462, -1, -1true0.0true0.0250); 



Re: Help: NPC Driver dont move. - NaS - 14.11.2018

Quote:
Originally Posted by bookknp
Посмотреть сообщение
Thx very much NAS, but car still dont move. (i copy ur code in gamemode)

this is code right?

PHP код:
FCNPC_GoTo(bot5,-2420.2437,-65.4272,35.1462, -1, -1true0.0true0.0250); 
Do you have SAfull.hmap in your scriptfiles folder? Also does it say something in the server log about MapAndreas?

One thing I just noticed is that you might have to wait a bit with FCNPC_GoTo after putting the NPC into a vehicle.

You can use this callback to know when the FCNPC finished entering. After FCNPC_EnterVehicle this will be called:

Код:
public FCNPC_OnVehicleEntryComplete(npcid, vehicleid, seat)
{
}
Check if npcid is bot5 in this callback and then use FCNPC_GoTo.

Your GoTo code seems correct, don't see anything wrong with it.


Re: Help: NPC Driver dont move. - bookknp - 14.11.2018

Quote:
Originally Posted by NaS
Посмотреть сообщение
Do you have SAfull.hmap in your scriptfiles folder? Also does it say something in the server log about MapAndreas?

One thing I just noticed is that you might have to wait a bit with FCNPC_GoTo after putting the NPC into a vehicle.

You can use this callback to know when the FCNPC finished entering. After FCNPC_EnterVehicle this will be called:

Код:
public FCNPC_OnVehicleEntryComplete(npcid, vehicleid, seat)
{
}
Check if npcid is bot5 in this callback and then use FCNPC_GoTo.

Your GoTo code seems correct, don't see anything wrong with it.
Thx very much NAS, solve it