SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 30/06/2013, 01:07 PM   #1
6Dragon6
Little Clucker
 
Join Date: Jun 2013
Posts: 5
Reputation: 0
Question NPCs kicking players from server

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.

Last edited by 6Dragon6; 30/06/2013 at 01:58 PM.
6Dragon6 is offline   Reply With Quote
Old 30/06/2013, 03:27 PM   #2
FShiwani
Big Clucker
 
Join Date: Jun 2013
Posts: 56
Reputation: 2
Default Re: NPCs kicking players

In your server.cfg line, how many NPCs have you set?
__________________
If I helped +rep
FShiwani is offline   Reply With Quote
Old 30/06/2013, 03:33 PM   #3
6Dragon6
Little Clucker
 
Join Date: Jun 2013
Posts: 5
Reputation: 0
Default Re: NPCs kicking players

All the details including maxnpcs are already in the post, 14, thanks for the try though =)
6Dragon6 is offline   Reply With Quote
Old 28/03/2014, 09:36 PM   #4
6Dragon6
Little Clucker
 
Join Date: Jun 2013
Posts: 5
Reputation: 0
Default Re: NPCs kicking players

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.
6Dragon6 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
[Plugin] RNPC - Recordfree NPCs | Control NPCs without recording | DEV Mauzen Plugin Development 972 02/12/2017 08:17 AM
NPCs ( Criminal NPCs ) leave as i join Adamb Scripting Help 8 18/03/2013 09:57 PM
Kicking Paused Players Michael[NBK] Scripting Help 3 11/11/2011 08:53 PM
AntiCheat Kicking Innocent Players [WF]Demon Help Archive 1 15/12/2010 04:12 AM
Pawno help: How do i get NPCs to chase players? Epic Shower Help Archive 5 28/02/2010 10:16 PM


All times are GMT. The time now is 06:12 AM.


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