NPCs kicking players
#1

Hi, I am a newbie when it comes to Pawn Scripting, nice to meet you all.

I am developing, from scratch, a gamemode that will mimic the Assassins Creed Brotherhood Multiplayer "Wanted" mode. I already got to somehow create a map similar to that of Limassol in Assassins Creed Bloodlines for PSP and it works perfectly.

After that I started coding the NPCs. So I recorded their walking path and saved it in the corresponding folder. I made the npcmode and all that. Everything works like a charm.

The problem is that, while there are NPCs logged in the server (I have a total of 6), no matter if they do nothing apart from walking, I can connect perfectly but once a third player logs in the server both of my friends get automatically kicked from the server with no further information given by the server. (I can play with just 1 friend though).

To make it short and understandable:
-NPCs works perfectly, I even coded them so they are killable, and no problems were found.
-If there is any NPC logged to the server, my friends will get kicked shortly after a second one joins (won't happen to me).

More data:
-maxplayers 50
-maxnpc 14 (the actual goal is to add 14)
-filterscripts: the ones by default in a vanilla samp server plus "register" and "fly" (I tried disabling them both and it wont fix a thing).
-Tested it with a total of 4 friends (2 of them live in Canary Islands as I do, one of them somewhere else in Spain and the other one in Argentina). They are not related at all and they don't have the same game client or mods.
-They can play normally on other servers with no problem.

Some code, I don't think its actually needed but there you go:


NPC Modes:

npc001.pwn (the other 5 are exactly the same and only their corresponding rec file and pos changes.)
Code:
#include <a_npc>
#define rec "npc001"
#define onfoot 2 //1 for vehicle

main(){}

public OnRecordingPlaybackEnd()
{
 StartRecordingPlayback(onfoot,rec);
}

public OnNPCSpawn()
{
 SetMyPos(626.4643,1950.7151,405.3034);
 StartRecordingPlayback(onfoot,rec);
}
Related code OnGameModeInit():
Code:
//NPCs 6Dragon6
	ConnectNPC("Civilian1","npc001");
	ConnectNPC("Civilian2","npc002");
	ConnectNPC("Civilian3","npc003");
	ConnectNPC("Civilian4","npc004");
	ConnectNPC("Civilian5","npc005");
	ConnectNPC("Civilian6","npc006");
//End NPCs 6Dragon6
Not much more to show really... once I removed the code above (ConnectNPCs) the problem stopped and we could play normally on the server but, of couse, I need the NPCs to work properly.

Server Log: No information given at all, doesn't even look like a "kick", it just logs the connection and disconnection as if they did it on purpose.

Pics: (Not needed but... wont hurt neither)

(Working NPCs)

My guess? Its a samp-npc.exe problem. But I am the newbie to I will wait for a proper answer, thanks so much to whoever even tries to read it all hehe.

Greetings from Canary Islands.
Reply
#2

In your server.cfg line, how many NPCs have you set?
Reply
#3

All the details including maxnpcs are already in the post, 14, thanks for the try though =)
Reply
#4

Excuse for the necropost plus the double post but I found out what the problem was and I just wanted to leave the answer here in case somebody runs into this post with the same problem.

It seems to be a problem with the router. I found out this while trying to play Gunz Online, this game uses a server to host the lobby, updates and rooms, but the players are actually connected to each other and not through the server. I was unable to play because for some reason players were not receiving my data, so I was a standing still model in the rooms without even knowing it.

Not only you have to port forward the game in order to be able to send and receive data from players but there are some routers (like mine) that also have some kind of security check that is blocking the data. I don't really know how but by trying out everything I could on the router's admin panel I finally got to unblock that thing.

My suggestion: keep touching and tweaking the router's admin panel options until it magically solves the problem.

Greetings.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)