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(bot5, 546, 0, -1);
FCNPC_GoTo(bot5,-2420.2437,-65.4272,35.1462, 0, FCNPC_MOVE_TYPE_AUTO, true, 0.0, true, 0.0, 250);
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, -1, true, 0.0, true, 0.0, 250);
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, -1, true, 0.0, true, 0.0, 250);
|
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