PDA

View Full Version : Server Closes connection on connect?


marshallbrown
06/02/2015, 03:30 PM
Help a brother out?

public OnPlayerConnect(playerid)
{
RemoveBuildingForPlayer(playerid, 773, -0.8672, -387.1875, 4.4297, 0.25);
RemoveBuildingForPlayer(playerid, 1408, -3.8906, -382.0938, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, -9.3906, -382.1016, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, -20.3984, -382.1172, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 4.5938, -377.2734, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 1.6094, -382.0859, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 4.5703, -360.6328, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 4.5781, -366.1797, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 4.5859, -371.7266, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1278, 5.7109, -371.5234, 18.9844, 0.25);
RemoveBuildingForPlayer(playerid, 780, 9.0625, -364.9453, 5.1016, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 4.5469, -343.9844, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 4.5547, -349.5391, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 4.5234, -332.8828, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 773, -0.8672, -387.1875, 4.4297, 0.25);
RemoveBuildingForPlayer(playerid, 1408, -3.8906, -382.0938, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, -9.3906, -382.1016, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, -20.3984, -382.1172, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 4.5938, -377.2734, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 1.6094, -382.0859, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 4.5703, -360.6328, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 4.5781, -366.1797, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 4.5859, -371.7266, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1278, 5.7109, -371.5234, 18.9844, 0.25);
RemoveBuildingForPlayer(playerid, 780, 9.0625, -364.9453, 5.1016, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 4.5469, -343.9844, 6.0000, 0.25);
RemoveBuildingForPlayer(playerid, 1408, 4.5547, -349.5391, 6.0000, 0.25);

if(!IsPlayerNPC(playerid))
{

ResetPlayer(playerid);

SetPlayerColor(playerid, GREY);

GetPlayerName(playerid, pName[playerid], MAX_PLAYER_NAME), GetPlayerIp(playerid, PlayerIP[playerid], 16);
IRC_GroupSayEx(gGroupID, IRC_ECHO_CHANNEL, "7[connect] 3%s (%d) has joined the server.", pName[playerid], playerid);
IRC_GroupSayEx(gGroupID, IRC_AECHO_CHANNEL, "7[connect] 3%s (%d) has joined the server (IP: %s).", pName[playerid], playerid, PlayerIP[playerid]);


if(!IsValidName(playerid))
{
SendClientMessage(playerid, GREY, "You have been kicked for having a Non-RP name.");
INI_Remove("Accounts/None.ini");
Kick(playerid);
}
else if(fexist(Accounts(playerid)))
{
GetPlayerIp(playerid, PlayerStat[playerid][LastIP], 21);

PlayAudioStreamForPlayer(playerid, "http://dl.dropbox.com/u/26474886/OnPlayerConnection.mp3");
SetTimerEx("DisableAudio", 5000, false, "is", 1337, "hello!");

ClearChatForPlayer(playerid);

SendClientMessage(playerid, GREEN, "--------------------------------------------------------------------------------");
SendClientMessage(playerid, WHITE, " Welcome back to Prison Life Roleplay ");
SendClientMessage(playerid, WHITE, " Type the account's password below to login. ");
SendClientMessage(playerid, WHITE, " Don't forget to visit our website test.com ");
SendClientMessage(playerid, WHITE, " Read /updates for the latest update/updates ");
SendClientMessage(playerid, GREEN, "--------------------------------------------------------------------------------");

ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","Welcome to Prison Life Roleplay.\nInput your password below to login.","Login","Quit");
}
else
{
GetPlayerIp(playerid, PlayerStat[playerid][LastIP], 21);

ClearChatForPlayer(playerid);

SendClientMessage(playerid, GREEN, "--------------------------------------------------------------------------------");
SendClientMessage(playerid, WHITE, " Welcome back to Prison Life Roleplay ");
SendClientMessage(playerid, WHITE, " Type a password below to register a new account. ");
SendClientMessage(playerid, WHITE, " Don't forget to visit our website test.com ");
SendClientMessage(playerid, WHITE, " Read /updates for the latest update/updates ");
SendClientMessage(playerid, GREEN, "--------------------------------------------------------------------------------");

ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Registering","Welcome to Prison Life Roleplay.\nInput your password below to register a new account.","Register","Quit");
}
SetPlayerColor(playerid, GREY);
}
return 1;
}

Tamy
06/02/2015, 03:36 PM
Try removing this from your code.

if(!IsValidName(playerid))
{
SendClientMessage(playerid, GREY, "You have been kicked for having a Non-RP name.");
INI_Remove("Accounts/None.ini");
Kick(playerid);
}

Check if it works without these lines.

Luis-
06/02/2015, 04:07 PM
Could you post the IsValidName function? And are you connecting with a valid name?