SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/05/2012, 10:17 PM   #1
Richie©
Banned
 
Join Date: Feb 2012
Location: Norway
Posts: 368
Reputation: 53
Default NPC Leaves my server

My NPC leaves my server and i dont know why

This is after about 3 hours of uptime.
pawn Code:
[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.
Richie© is offline   Reply With Quote
Old 15/05/2012, 10:19 PM   #2
kaisersouse
High-roller
 
kaisersouse's Avatar
 
Join Date: Jun 2006
Location: Subaru Forester
Posts: 2,799
Reputation: 1024
Default Re: NPC Leaves my server

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.
__________________
Life is like a box of cheap-ass no cocoa garbage dollar-store chocolate.

Ban UIF
kaisersouse is offline   Reply With Quote
Old 16/05/2012, 07:02 AM   #3
Richie©
Banned
 
Join Date: Feb 2012
Location: Norway
Posts: 368
Reputation: 53
Default Re: NPC Leaves my server

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?
Richie© is offline   Reply With Quote
Old 16/05/2012, 07:16 AM   #4
TzAkS.
Gangsta
 
TzAkS.'s Avatar
 
Join Date: Mar 2012
Location: Greece
Posts: 559
Reputation: 66
Default Re: NPC Leaves my server

Not sure if is working,not tested but try it.
pawn Code:
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.
TzAkS. is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
4th NPC Leaves. Lynn Scripting Help 19 07/11/2011 07:12 PM
Server goes offline when player leaves Psychic Server Support 2 02/09/2011 09:09 PM
[HELP!] Server closes when someone leaves! Ouch_Charlie General 9 17/05/2011 09:12 AM
NPC Leaves InDeX Server Support 7 16/03/2011 06:51 AM
NPC leaves server after joining Ma Help Archive 57 24/02/2010 02:56 PM


All times are GMT. The time now is 07:09 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.