SA-MP Forums Archive
NPCs join and leave - 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: NPCs join and leave (/showthread.php?tid=302780)



NPCs join and leave - scottygraham1990 - 10.12.2011

hi all my NPCs are joining then leaveing how do i fix this


Re: NPCs join and leave - suhrab_mujeeb - 10.12.2011

pawn Код:
public OnPlayerConnect(playerid)
{
    if (IsPlayerNPC(playerid))
    {
    return 1;
    }
}



Re: NPCs join and leave - sabretur - 10.12.2011

Check why your bots are leaving (param reason):

https://sampwiki.blast.hk/wiki/OnPlayerDisconnect.

If reason is 0 check your script, and find a mistake.


Re: NPCs join and leave - Amit_B - 10.12.2011

Check the reason of leave (from server_log.txt), if it's 2 (kick) so the post above should fix the problem.
NPCs are almost exactly like regular players. OnPlayerConnect and the rest of the public functions affects them.


Re: NPCs join and leave - grand.Theft.Otto - 10.12.2011

Read the troubleshooting tips at the bottom of the tutorial:

https://sampforum.blast.hk/showthread.php?tid=95034


Re: NPCs join and leave - scottygraham1990 - 10.12.2011

Quote:
Originally Posted by Amit_B
Посмотреть сообщение
Check the reason of leave (from server_log.txt), if it's 2 (kick) so the post above should fix the problem.
NPCs are almost exactly like regular players. OnPlayerConnect and the rest of the public functions affects them.
[17:12:38] [npcart] Dancer5 has left the server (25:0)
[17:12:39] [npcart] FBI_7 has left the server (33:0)
[17:12:39] [npcart] FBI_3 has left the server (35:0)
[17:12:39] [npcart] DrinkServer has left the server (38:0)
[17:12:40] [npcart] Dancer14 has left the server (29:0)


Re: NPCs join and leave - suhrab_mujeeb - 10.12.2011

Does every NPC part or just some of them?


Re: NPCs join and leave - scottygraham1990 - 10.12.2011

Quote:
Originally Posted by suhrab_mujeeb
Посмотреть сообщение
Does every NPC part or just some of them?
well just sum of then the ones that walk about leave and the ones that are in cars dnt leave