NPC Connects then Disconnects after 3 minutes. -
NiGHTM4RE714 - 29.06.2015
Hello, I have an issue regarding my NPC.
The NPC would work fine before but a few days ago, it started disconnecting.
The server is being hosted by Evolution Host. The weird thing is that when I host the server and load the exact scripts from my laptop, the NPC works fine. However, with the server at Evolution Host the NPC crashes within 3 minutes from connecting. I've tried reloading the script to make it reconnect again and it reconnects, but it disconnects within 3 minutes again.
I was under the impression that the Evolution Host server was the problem. Consequently, I contacted them and they confirmed that their hosting service is not the issue.
So, now I am very confused as to what's the issue.
AutoDealer.rec is within npcmodes>recordings
Here is my code:
Shops.pwn:
PHP код:
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
CreateObject(9953, 2197.20581, 1407.76135, 22.80700, 360.00000, -360.00000, 188.90230);
CreateObject(3857, 2173.48389, 1409.70398, 26.58510, 360.00000, 0.00000, 8.69330);
CreateObject(3859, 2169.56104, 1415.26013, 26.62590, 360.00000, 0.00000, 8.88840);
CreateObject(3858, 2183.55811, 1401.73889, 26.65700, 360.00000, 0.00000, 8.89140);
CreateObject(9907, 2216.49170, 1408.55408, 98.89040, 0.00000, 0.00000, 180.00000);
CreateObject(7891, 2198.15137, 1408.56409, 12.09790, 360.00000, 0.00000, -0.02420);
CreateObject(3859, 2169.56104, 1415.26013, 19.18100, 360.00000, 0.00000, 8.88840);
CreateObject(3858, 2183.55811, 1401.73889, 19.17450, 360.00000, 0.00000, 8.89140);
CreateObject(3857, 2173.23511, 1409.39648, 19.15680, 360.00000, 0.00000, 8.69330);
ConnectNPC("AutoDealer","AutoDealer");
return 1;
}
public OnPlayerConnect(playerid)
{
RemoveBuildingForPlayer(playerid, 8931, 2162.4766, 1403.4375, 14.6563, 0.25);
RemoveBuildingForPlayer(playerid, 8839, 2162.4766, 1403.4375, 14.6563, 0.25);
if( IsPlayerNPC(playerid) )
{
return 1;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "AutoDealer", true))
{
SetPlayerSkin(playerid, 147);
}
return 1;
}
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
if( IsPlayerNPC(playerid) )
{
return 1;
}
return 1;
}
public OnPlayerRequestClass(playerid)
{
if( IsPlayerNPC(playerid) )
{
return 1;
}
return 1;
}
AutoDealer.pwn:
PHP код:
#define RECORDING "AutoDealer" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 2 //1 for in vehicle and 2 for on foot.
#include <a_npc>
main()
{
}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#if RECORDING_TYPE == 1
public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
public OnNPCExitVehicle() StopRecordingPlayback();
#else
public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif
Server.cfg:
Код:
echo Executing Server Config.
lanmode 0
rcon_password
maxplayers 22
port 7786
hostname NEW IP:94.23.7.125:7855 [Nx] Server
gamemode0 lva 1
filterscripts Shops
announce 1
query 1
chatlogging 1
weburl noxioushaze.foromx.net/forum
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 10
logtimeformat [%H:%M:%S]
language English
bind 104.194.26.138
Re: NPC Connects then Disconnects after 3 minutes. -
NiGHTM4RE714 - 29.06.2015
Oh man, this hasn't happened to anyone?
Re: NPC Connects then Disconnects after 3 minutes. -
baba1234 - 30.06.2015
If u have login register system that can be a problem. Bcus u need to define that the npc dont need to login or register.
Re: NPC Connects then Disconnects after 3 minutes. -
NiGHTM4RE714 - 03.07.2015
I've removed the login system and the problem still persists. The NPC disconnects after around 3 minutes. It runs fine and does everything it needs to do but it crashes.
Код:
[npc:part] AutoDealer has left the server (0:0)
On my laptop server it does not crash at all and its the exact same code, exact filterscripts, exact gamemode.
But when I transfer all the filterscripts, gamemodes and npcs to the other server via FileZilla, they crash after 3 minutes.