SA-MP Forums Archive
RNPC Problem - Crash - 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: RNPC Problem - Crash (/showthread.php?tid=415919)



RNPC Problem - Crash - Infinity90 - 15.02.2013

I'am quite new to the RNPC include & plugin. I made a /attack command:
pawn Код:
CMD:attack(playerid,params[]) {
    RNPC_CreateBuild(npc[0], 0);
    RNPC_CreateBuild(npc[1], 0);
    RNPC_CreateBuild(npc[2], 0);
    RNPC_CreateBuild(npc[3], 0);
    RNPC_CreateBuild(npc[4], 0);
    FollowPlayer(npc[0],playerid);
    FollowPlayer(npc[1],playerid);
    FollowPlayer(npc[2],playerid);
    FollowPlayer(npc[3],playerid);
    FollowPlayer(npc[4],playerid);
    SetPlayerPos(npc[0], 0,0,1);
    SetPlayerPos(npc[1], 0,0,1);
    SetPlayerPos(npc[2], 0,0,1);
    SetPlayerPos(npc[3], 0,0,1);
    SetPlayerPos(npc[4], 0,0,1);
    RNPC_SetWeaponID(23);
    RNPC_AddPause(500);
    RNPC_AddMovement(0,0,1, 20.0, 20.0, 0.0);
    RNPC_ConcatMovement(0, 20.0, 0);
    RNPC_AddPause(200);
    RNPC_SetKeys(128);
    RNPC_AddPause(500);
    RNPC_SetKeys(128 + 4);
    RNPC_AddPause(500);
    for (new i = 0; i < 360; i+=20) {
        RNPC_SetAngleQuats(0.0, i, 0.0);
        RNPC_AddPause(150);
    }
    RNPC_SetKeys(128);
    RNPC_AddPause(500);
    RNPC_SetKeys(0);
    RNPC_FinishBuild();
    SendClientMessage(playerid, RED, "NPC is on it's way!");
    RNPC_StartBuildPlayback(npc[0]);
    RNPC_StartBuildPlayback(npc[1]);
    RNPC_StartBuildPlayback(npc[2]);
    RNPC_StartBuildPlayback(npc[3]);
    RNPC_StartBuildPlayback(npc[4]);
    return 1;
}
BUT, when I type this command the console crashes and closes and I get this error:

Any suggestions on how to fix?


Re: RNPC Problem - Crash - Babul - 15.02.2013

does it crash when creating 1 npc only? i suspect it crashing due to multiple recordings opened, but the plugin keeps only 1 ID. hence the missing ID in later functions. maybe iam wrong...


Re: RNPC Problem - Crash - Infinity90 - 15.02.2013

It happens even when I use the filterscript that comes with it (RNPCTest.amx). I can use /rnpchelp but when I use like /createbuild....It crashes, the only difference on the error is that the line changes (Line: 77 ) is the new one...


Re: RNPC Problem - Crash - Infinity90 - 15.02.2013

Bump - This is urgent.


Re: RNPC Problem - Crash - Mauzen - 15.02.2013

pawn Код:
RNPC_CreateBuild(npc[0], 0);
    RNPC_CreateBuild(npc[1], 0);
    RNPC_CreateBuild(npc[2], 0);
    RNPC_CreateBuild(npc[3], 0);
    RNPC_CreateBuild(npc[4], 0);
Create builds one by one, not all at once. Build mode opens a file that is closed on FinishBuild. Doing it like this it will open several files with the same scope and that causes the crash.
So it should be
pawn Код:
CreateBuild(npc[0], 0);
code for npc[0];
FinishBuild();
CreateBuild(npc[1], 0);
...



Re: RNPC Problem - Crash - Infinity90 - 15.02.2013

Still crashes. Anyone got a example script?