Closed iMarllun closed 3 years ago
Can you provide a minimal Pawn script to reproduce the issue?
Sure, more informations.
SAMP Server 0.3.7-R2. Windows 10 Pro 19042.450 In the profession can only these vehicles listed.
new FazendoMissao3[MAX_PLAYERS] = INVALID_PLAYER_ID;
new totalnpcs3;
new TimerFixAssent2[MAX_PLAYERS];
CMD:test2(playerid) {
//DeletePreciseTimer2(TimerPolice[playerid]);
FazendoMissao3[playerid] = INVALID_PLAYER_ID;
new String[24];
totalnpcs3++;
format(String,sizeof(String),"NPC_%d",totalnpcs3);
FazendoMissao3[playerid] = FCNPC_Create(String);
totalnpcs3++;
FCNPC_SetInvulnerable(FazendoMissao3[playerid], true);
FCNPC_Spawn(FazendoMissao3[playerid], 1, 1593.1672,1830.6145,10.8203);//stay close to this position for the NPC to enter the vehicle
FCNPC_SetAngle(FazendoMissao3[playerid], 0.0);
FCNPC_SetAnimationByName(FazendoMissao3[playerid], "CRACK:Bbalbat_Idle_01", 4.1, 1, 0, 0, 0, 1);
FCNPC_ClearAnimations(FazendoMissao3[playerid]);
FCNPC_SetSpecialAction(FazendoMissao3[playerid], 0);
switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
{
case VehiclePoliceLVPD : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 3, FCNPC_MOVE_TYPE_WALK);
case ExercitoEnforcer : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 3, FCNPC_MOVE_TYPE_WALK);
case VehiclePoliceLSPD : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 3, FCNPC_MOVE_TYPE_WALK);
case VehiclePoliceSFPD : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 3, FCNPC_MOVE_TYPE_WALK);
case 522 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 1, FCNPC_MOVE_TYPE_WALK);
case 497 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 3, FCNPC_MOVE_TYPE_WALK);
case 599 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 1, FCNPC_MOVE_TYPE_WALK);
case 428 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 3, FCNPC_MOVE_TYPE_WALK);
case 430 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 1, FCNPC_MOVE_TYPE_WALK);
case 523 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 1, FCNPC_MOVE_TYPE_WALK);
case 490 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 1, FCNPC_MOVE_TYPE_WALK);
case 411 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 1, FCNPC_MOVE_TYPE_WALK);
}
TimerFixAssent2[playerid] = SetTimerEx("FixAssent", 3000, true, "d", playerid);
return 1;
}
forward FixAssent(playerid);
public FixAssent(playerid) {
if(FCNPC_GetVehicleID(FazendoMissao3[playerid]) == INVALID_VEHICLE_ID) {
switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
{
case VehiclePoliceLVPD : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 3, FCNPC_MOVE_TYPE_WALK);
case ExercitoEnforcer : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 3, FCNPC_MOVE_TYPE_WALK);
case VehiclePoliceLSPD : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 3, FCNPC_MOVE_TYPE_WALK);
case VehiclePoliceSFPD : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 3, FCNPC_MOVE_TYPE_WALK);
case 522 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 1, FCNPC_MOVE_TYPE_WALK);
case 497 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 3, FCNPC_MOVE_TYPE_WALK);
case 599 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 1, FCNPC_MOVE_TYPE_WALK);
case 428 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 3, FCNPC_MOVE_TYPE_WALK);
case 430 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 1, FCNPC_MOVE_TYPE_WALK);
case 523 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 1, FCNPC_MOVE_TYPE_WALK);
case 490 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 3, FCNPC_MOVE_TYPE_WALK);
case 411 : FCNPC_EnterVehicle(FazendoMissao3[playerid], GetPlayerVehicleID(playerid), 1, FCNPC_MOVE_TYPE_WALK);
}
}
return 1;
}
FCNPC_EnterVehicle is extremely buggy, the NPC does not enter the vehicle.
switch(GetVehicleModel(GetPlayerVehicleID(playerid))) { case 416 : FCNPC_EnterVehicle(FazendoMissao[playerid], GetPlayerVehicleID(playerid), 3, FCNPC_MOVE_TYPE_WALK); }
@ziggi I'm having problems with this too since updating. It's completely stopping me from using the plugin which is very frustrating.
Here is the most basic script to reproduce this issue, the NPC walks up to the door and as soon as they get to the door the server just crashes..
new npcid = FCNPC_Create("[NPC]Test");
FCNPC_Spawn(npcid, 125, -1306.0396,2523.0637,87.4162);
new vehicleid = CreateVehicle(517, -1312.1849, 2517.5012, 87.0529, 270.0, -1, -1, -1);
FCNPC_EnterVehicle(npcid, vehicleid, 0);
Here's a blank gamemode:
#include <a_samp>
#include <FCNPC>
main() {}
public OnGameModeInit()
{
AddPlayerClass(0, -1306.0396,2520.0637,87.4162, 0, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/go", true))
{
new npcid = FCNPC_Create("[NPC]Test");
FCNPC_Spawn(npcid, 125, -1306.0396,2523.0637,87.4162);
new vehicleid = CreateVehicle(517, -1312.1849, 2517.5012, 87.0529, 270.0, -1, -1, -1);
FCNPC_EnterVehicle(npcid, vehicleid, 0);
return 1;
}
return 0;
}
Simply spawn and type /go.
Crash logs from FCNPC/crashdetect: https://pastebin.com/g2gwHBmQ https://pastebin.com/iCcx1VMB
Plugins loaded: FCNPC, no others. SAMP Server version 0.3.7 R2. FCNPC version 2.0.2 (latest)
I think the version I had previously was before 2.0.0, but not sure. Please let me know if you need any more information or need anything testing, happy to help.
@mikescnr try this build: FCNPC-2.0.2.zip If everything is ok I will make a release
Seems to work, nice one! Thanks a lot for the quick fix.
But the NPC simply warps into the vehicle when it gets to the door. If memory serves me right, they used to actually open the door and perform an animation of entering the vehicle?
Yes, it's an old bug on plugin for Windows, on Linux everything works fine. I have no idea how to fix this
Just tried it on Linux and it's the same issue, the NPC just warps into the vehicle after running on the spot for a couple of seconds after reaching the door :(
Plugins: crashdetect- last version FCNPC - last version streamer- last version sscanf - last version pawncmd - last version mysql - last version
pawncc version 3.10.10
when i use this function the server shuts down. in FCNPC 1.8.2 this crash doesn't happen
also, with the latest version of the plugin is returning this warning
[FCNPC] Info: A newer version (v2.0.1) is available at https://github.com/ziggi/FCNPC/releases