SA-MP Forums Archive
NPC problem. (Will +Rep) - 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: NPC problem. (Will +Rep) (/showthread.php?tid=335136)



NPC problem. (Will +Rep) - Marco_Valentine - 17.04.2012

I have a zombie event within my server. This is the only thing adding NPC's into my server.

I have zombies continuously being connected to my server. The first 5-8 NPC's connect and work properly. But after that whenever a NPC trys to connect it just leaves almost instantly after it connects. I don't see them connecting ingame but it shows up in the console.

I have a function to avoid them having to log in.

Код:
OnPlayerConnect(playerid);
{
if(IsPlayerNPC(playerid)){ SpawnPlayer(playerid); }
}

&&

public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(playerid)){ SpawnPlayer(playerid); }
}
I don't know what could be causing it! D:


Re: NPC problem. (Will +Rep) - Marco_Valentine - 17.04.2012

UPDATE:
I tried reconnecting to it once i noticed it wasn't allowing NPC's to join and i noticed that i kept 'loosing connection' to the server then connected again. This kept repeating itself


Re: NPC problem. (Will +Rep) - Marco_Valentine - 17.04.2012

bump?


Re: NPC problem. (Will +Rep) - SpiritEvil - 17.04.2012

Tried checking 'maxnpcs' in your server.cfg file?


Re: NPC problem. (Will +Rep) - MP2 - 17.04.2012

Don't use SpawnPlayer, they spawn automatically. Just return 1 if they are an NPC.


Re: NPC problem. (Will +Rep) - Marco_Valentine - 18.04.2012

Thank you Mp2! . Rep'd