Server crashes - 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: Server crashes (
/showthread.php?tid=642740)
Server crashes -
StrikerZ - 06.10.2017
Server crashes while building the path using PathFinder.
PHP код:
public OnPathCalculated(routeid, success, Float:nodesX[], Float:nodesY[], Float:nodesZ[], nodesSize)
{
new text[128];
format(text, sizeof(text), "PATH: route: %d success: %d nodesSize: %d", routeid, success, nodesSize);
printf(text);
if(success)
{
printf("1");
RNPC_CreateBuild(routeid,PLAYER_RECORDING_TYPE_ONFOOT);
printf("2");
for(new i; i < nodesSize-1; i++)
{
RNPC_AddMovement(nodesX[i],nodesY[i],nodesZ[i]+1,nodesX[i+1],nodesY[i+1],nodesZ[i+1]+1,RNPC_SPEED_WALK);
printf("%f | %f | %f |||| %f | %f | %f",nodesX[i],nodesY[i],nodesZ[i]+1,nodesX[i+1],nodesY[i+1],nodesZ[i+1]+1);
}
printf("3");
RNPC_FinishBuild();
printf("4");
RNPC_StartBuildPlayback(routeid);
printf("5");
}
return 1;
}
It crashes after the RNPC_FinishBuild, no logs with crashdetect, nothing.
The debug goes till 3, after that it crashes, that means the FinishBuild crashes it. Any solution?
EDIT: Problem fixed, was missing recordings folder.