27.11.2015, 17:31
When my fcnpc bot try to enter a vehicle he die, how to solve this problem?
new
FCNPC,
npckey,
fcnpcveh;
CMD:fcnpcstart(playerid,params[])
{
if(!GetPVarInt(playerid, "BOTGO"))
{
fcnpcveh = AddStaticVehicle(560, 1560.76, 1443.72, 10.54, 180.0, 1, 1);
FCNPC = FCNPC_Create("daddyfoot2");
FCNPC_SetSkin(FCNPC, 38);
FCNPC_StartPlayingPlayback(FCNPC, "daddyfoot2");
npckey = 1;
SetPVarInt(playerid, "BOTGO", 1);
}
else
{
FCNPC_StopPlayingPlayback(FCNPC);
FCNPC_Destroy(FCNPC);
SetPVarInt(playerid, "BOTGO", 0);
}
return 1;
}
public FCNPC_OnVehicleEntryComplete(npcid, vehicleid, seat)
{
FCNPC_StartPlayingPlayback(npcid, "daddycar3");
return 1;
}
public FCNPC_OnVehicleExitComplete(npcid)
{
FCNPC_StartPlayingPlayback(npcid, "daddyfoot4");
return 1;
}
public FCNPC_OnFinishPlayback(npcid)
{
new type;
switch(npckey)
{
case 0:
{
SetVehicleToRespawn(fcnpcveh);
FCNPC_StartPlayingPlayback(npcid, "daddyfoot2");
npckey++;
}
case 1:
{
type = FCNPC_EnterVehicle(FCNPC, fcnpcveh, 1, 0);
npckey++;
}
case 2:
{
type = FCNPC_ExitVehicle(FCNPC);
npckey = 0;
}
}
return 1;
}