#1

I've recently made a NPC and got it working perfectly. Except the part where it stops. After a few testing I've found that the problem occurs when the StopRecordingPlayback() is called. When that happens the server closes itself without leaving any error messages on the server log. Anyone know a solution for this?

P.S The NPC receives commands to stop or start the playback

Here's the NPC's file

pawn Код:
public OnClientMessage(color, text[]) {
    if(text[0] != '/' || color != 123456) return;

    if(strcmp(text, "/startdriving", true) == 0) {
        StartRecordingPlayback(PLAYER_RECORDING_TYPE_DRIVER, "Car");
        return;
    }
   
    if(strcmp(text, "/stopdriving", true) == 0) {
        StopRecordingPlayback();
        return;
    }
}
And here's the stock method I use in my gamemode to stop the recording

pawn Код:
stock ResetTaxiDriver() {
    NPCDriving = false;
    SendClientMessage(Cardriver, 123456, "/stopdriving");
    DestroyVehicle(Car);
    Kick(Cardriver);
}
Reply
#2

Nevermind Solved the problem.

For future reference if anyone else has the same problem here's the solution

Add this to OnPlayerDisconnect
pawn Код:
if(IsPlayerNPC(playerid)) return ConnectNPC("YOURNPCNAME", "CARNAME");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)