Server closed the connection
#1

Alright well my problem is whenever I log into my server it say "server closed the connection" here is my server log and the coding for when players connect. If you guys need anything from the script or logs and such just let me know.

Edit: Also im using Volt Host as hoster if that helps any.

Heres server log
Код:
SA-MP Dedicated Server
----------------------
v0.3e-R2, ©2005-2012 SA-MP Team

[19:51:54] 
[19:51:54] Server Plugins
[19:51:54] --------------
[19:51:54]  Loading plugin: streamer.so
[19:51:54] 

*** Streamer Plugin v2.6.1 by Incognito loaded ***

[19:51:54]   Loaded.
[19:51:54]  Loading plugin: sscanf.so
[19:51:54] 

[19:51:54]  ===============================

[19:51:54]       sscanf plugin loaded.     

[19:51:54]    © 2009 Alex "******" Cole

[19:51:54]    0.3d-R2 500 Players "dnee"

[19:51:54]  ===============================

[19:51:54]   Loaded.
[19:51:54]  Loaded 2 plugins.

[19:51:54] 
[19:51:54] Filterscripts
[19:51:54] ---------------
[19:51:54]   Loading filterscript 'actions.amx'...
[19:51:54]   Unable to load filterscript 'actions.amx'.
[19:51:54]   Loaded 0 filterscripts.

[19:51:54] Incoming connection: 66.85.148.158:56247
[19:51:54] 			VO:RP loaded 		
[19:51:54] Number of vehicle models: 48
[19:51:54] Incoming connection: 66.85.148.158:56959
[19:51:54] Incoming connection: 66.85.148.158:47545
[19:51:54] Incoming connection: 66.85.148.158:39459
[19:51:54] [npc:join] Zombie_3 has joined the server (0:66.85.148.158)
[19:51:54] [npc:join] Zombie_1 has joined the server (1:66.85.148.158)
[19:51:54] [npc:join] Zombie_2 has joined the server (2:66.85.148.158)
[19:51:54] [npc:join] Bot_intro has joined the server (3:66.85.148.158)
[19:52:05] Incoming connection: 
[19:52:05] [join] John_Hudson has joined the server (*******)
[19:52:06] [npc:part] Bot_intro has left the server (3:0)
[19:52:11] John_Hudson quitted the game.
[19:52:11] [part] John_Hudson has left the server (4:2)
[19:52:22] Incoming connection: 
[19:52:23] [join] Adam_Peglau has joined the server (*********)
[19:52:27] Adam_Peglau quitted the game.
[19:52:27] [part] Adam_Peglau has left the server (3:2)
Here is the code under OnPlayerConnect
Код:
public OnPlayerConnect(playerid)
{
	//Hungry[playerid] = 0;
	new plname[MAX_PLAYER_NAME];
	new sstring[128], pName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
	if(strfind(pName, "_", true) == -1)
	{
		format(sstring, 128, "You do not have an proper roleplay name! Example: John_Smith.");
		SendClientMessage(playerid,ROJO, sstring);
		Kick(playerid);
		return 1;
	}
Reply
#2

You could have an Irregular name or word in your name and the server was only scripted to prevent people from entering the server with that name and not really showing you why you were kicked. Or it could be your firewall blocking access to the server. Did you accidently ban yourself?
Reply
#3

Your doing it reversed.

Correct way:

pawn Код:
if(strfind(pName, "_", true) != -1)
{
format(sstring, 128, "You do not have an proper roleplay name! Example: John_Smith.");
SendClientMessage(playerid,ROJO, sstring);
Kick(playerid);
return 1;
}
if(strfind(pName, "_", true) == -1) will return 1 if it DID find a "_" in the username.
Reply
#4

Quote:
Originally Posted by DeathTone
Посмотреть сообщение
Your doing it reversed.

Correct way:

pawn Код:
if(strfind(pName, "_", true) != -1)
{
format(sstring, 128, "You do not have an proper roleplay name! Example: John_Smith.");
SendClientMessage(playerid,ROJO, sstring);
Kick(playerid);
return 1;
}
if(strfind(pName, "_", true) == -1) will return 1 if it DID find a "_" in the username.
Ya I replaced the code but I still got the error thanks though for helping. Anyone else got any suggestions ro would like me to further on post any code?
Reply
#5

Quote:
Originally Posted by DeathTone
Посмотреть сообщение
Your doing it reversed.

Correct way:

pawn Код:
if(strfind(pName, "_", true) != -1)
{
format(sstring, 128, "You do not have an proper roleplay name! Example: John_Smith.");
SendClientMessage(playerid,ROJO, sstring);
Kick(playerid);
return 1;
}
if(strfind(pName, "_", true) == -1) will return 1 if it DID find a "_" in the username.
strfind returns the position in the string where the desired character was found

example
pawn Код:
new string[] = "F@#%";

printf("%d", strfind(string, '#', true));
will print out 2.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)