View Full Version : NPC Leaves my server

15/05/2012, 10:17 PM
My NPC leaves my server and i dont know why :(

This is after about 3 hours of uptime.

[15/05 - 20:16:46] [part] mara98 has left the server (6:1)
[15/05 - 20:47:24] [npc:part] Peter_Sausage has left the server (0:0)
[15/05 - 20:47:24] [npc:part] Hotdog_Guy has left the server (1:0)
[15/05 - 20:47:24] [npc:part] Travel_Guy has left the server (2:0)
[15/05 - 20:47:24] [npc:part] Train_Guy has left the server (3:0)
[15/05 - 20:47:24] [npc:part] Drug_Guy has left the server (4:0)
[15/05 - 20:47:24] [npc:part] Homer_Hotdog has left the server (5:0)
[15/05 - 21:38:47] Incoming connection: xxx.xxx.xxx:4246

They stayed connected fine in 0.3d and 0.3e RC5, but on final release they leave.

15/05/2012, 10:19 PM
Maybe they're like 90% of the samp playerbase and only play on servers w/ people already on them.

Sorry I know thats no help. We'd probably have to see some of your bot code to help more.

16/05/2012, 07:02 AM
Nobody else had problems with NPCs since 0.3e?
I dont belive anything is wrong with code, they worked fine in 3e RC5 like i wrote. Only thing i did was update sa-mp on vps and recompile with new includes.

Btw, can i reconnect my NPC if i let my script recognize npc andname on disconnect?

16/05/2012, 07:16 AM
Not sure if is working,not tested but try it.

if (IsPlayerNPC(playerid))
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Name", true))// Your npc name here
ConnectNPC("NPC","NPC");//conect the npc founded with "Name"
if(!strcmp(npcname, "Name2", true))// Your second npc here
// codes

Put it to OnPlayerDisconect so will be called just if the npc leaves the game.