SA-MP Forums Archive
npc log - 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: npc log (/showthread.php?tid=416231)



npc log - ajwar - 16.02.2013

Any suggestions how to log npc bot? It disconnects after ~4-10hours after server start. It doesn't disconnect if there's no players in server.. Can't find solution for years...


Re: npc log - Mean - 16.02.2013

You can use IsPlayerNPC.

Put some debug for NPCs in callbacks.

Here's a piece of code that will tell you the reason of the NPC disconnect:
pawn Код:
public OnPlayerDisconnect(playerid, reason) {
    if(IsPlayerNPC(playerid)) printf("NPC %i disconnected (reason: %i).", playerid, reason);
    // proceed with normal code
    return 1;
}
If the reason is kick/ban, check your "Kick" and "Ban(Ex)" codes.