NPC Connects then Disconnects after 3 minutes.
#1

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(99532197.205811407.7613522.80700,   360.00000, -360.00000188.90230);
    
CreateObject(38572173.483891409.7039826.58510,   360.000000.000008.69330);
    
CreateObject(38592169.561041415.2601326.62590,   360.000000.000008.88840);
    
CreateObject(38582183.558111401.7388926.65700,   360.000000.000008.89140);
    
CreateObject(99072216.491701408.5540898.89040,   0.000000.00000180.00000);
    
CreateObject(78912198.151371408.5640912.09790,   360.000000.00000, -0.02420);
    
CreateObject(38592169.561041415.2601319.18100,   360.000000.000008.88840);
    
CreateObject(38582183.558111401.7388919.17450,   360.000000.000008.89140);
    
CreateObject(38572173.235111409.3964819.15680,   360.000000.000008.69330);
        
    
ConnectNPC("AutoDealer","AutoDealer");
    
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
RemoveBuildingForPlayer(playerid89312162.47661403.437514.65630.25);
    
RemoveBuildingForPlayer(playerid88392162.47661403.437514.65630.25);
    if( 
IsPlayerNPC(playerid) )
    {
        return 
1;
    }
    
    
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
    if(
IsPlayerNPC(playerid))
     {
        new 
npcname[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnpcnamesizeof(npcname));
        
        if(!
strcmp(npcname"AutoDealer"true))
        {
            
SetPlayerSkin(playerid147);              
        }
        
    
        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_TYPERECORDING);
#if RECORDING_TYPE == 1
  
public OnNPCEnterVehicle(vehicleidseatidStartRecordingPlayback(RECORDING_TYPERECORDING);
  public 
OnNPCExitVehicle() StopRecordingPlayback();
#else
  
public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPERECORDING);
#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
Reply
#2

Oh man, this hasn't happened to anyone?
Reply
#3

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.
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)