Server Closed Connection -
Sna1L - 16.07.2016
hi ,
I once entered the game , but again I can not, Unless the server to close and re- open.
Connect code:
PHP код:
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME], path[200],str[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "/Users/%s.ini", pname);
FilesCount();
if(strfind(pname, "kir", true) != -1 || strfind(pname, "kun", true) != -1 || strfind(pname, "kos", true) != -1 || strfind(pname, "hack", true) != -1 || strfind(pname, "kick", true) != -1 || strfind(pname, "kick", true) != -1)
{
SendClientMessage(playerid,0x88AA62FF,""RED"UserName daraye * kalamate * zesht mibashad.");
SetTimerEx("KickTimer",3000,false,"i",playerid);
}
PlayAudioStreamForPlayer(playerid, "http://rozup.ir/download/1681919/6055103291.mp3");
for(new i = 0; i < 50; i++) SendClientMessage(playerid,0xFFFFFFF,""SEFID" ");
SendClientMessage(playerid,0x88AA62FF,"Play LIG_Welcome.mp3");
if(!dini_Exists(path))
{
ShowPlayerDialog(playerid, DIALOG_REGINFO, DIALOG_STYLE_MSGBOX, ""SEFID"Register", ""SEFID"Shoma Bayad Gavanin va Raveshe Bazi dar Server ra Ebteda Khunda\nva dar Surati ke Ghabul darid Gozine Ghabul ra Entekhab Karde!\n\nWeb Address:http://www.ciwenar.xzn\n\nva Be Ozviyate Khod Edame Dahid!\nDeghat Konid: Mitavanid Nakhande ham Edame Dahid zira Helperhaye Server \ndar Surate Dashtane Soal dar Khedmate Shoma Hastand!", ""SEFID"Ghabul", ""RED"Cancel");
TextDrawShowForPlayer(playerid, Welcome[0]);
TextDrawShowForPlayer(playerid, Welcome[1]);
TextDrawShowForPlayer(playerid, Welcome[5]);
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(str,sizeof(str),"~y~~h~Akharin User: ~w~%s",name);
TextDrawSetString(Welcome[4],str);
TextDrawShowForPlayer(playerid, Welcome[4]);
GivePlayerMoney(playerid,25);
}
else
{
SendClientMessage(playerid,0xA9C4E4FF,"Gablan sabtenam kardid! login konid.");
ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_INPUT, ""SEFID"Login", ""RED"Ramze "SEFID"Accounte Khod ra Vared Konid:", ""SEFID"OK", ""RED"Cancel");
TextDrawShowForPlayer(playerid, Welcome[0]);
TextDrawShowForPlayer(playerid, Welcome[1]);
TextDrawShowForPlayer(playerid, Welcome[5]);
TextDrawShowForPlayer(playerid, Welcome[4]);
}
RemoveBuildingForPlayer(playerid, 1226, 623.9531, -1288.8125, 18.8125, 0.25);
RemoveBuildingForPlayer(playerid, 1285, 622.8594, -1281.2344, 16.0391, 0.25);
RemoveBuildingForPlayer(playerid, 1286, 622.7813, -1280.2109, 16.0938, 0.25);
RemoveBuildingForPlayer(playerid, 1287, 622.6953, -1279.2578, 16.1563, 0.25);
SetTimerEx("setscorexp",4000,true,"i",playerid);
return 1;
}
__________________________________________________ _____________
Disconnect code:
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "/Users/%s.ini", pname);
TextDrawHideForPlayer(playerid, Count[playerid][5]), TextDrawHideForPlayer(playerid, Count[playerid][4]);
if(pInfo[playerid][logged] == 1)
{
dini_IntSet(path, "skin", pInfo[playerid][skin]);
dini_IntSet(path, "govahi", pInfo[playerid][govahi]);
dini_IntSet(path, "XP", pInfo[playerid][XP]);
dini_IntSet(path, "cash", GetPlayerMoney(playerid));
dini_IntSet(path, "score", GetPlayerScore(playerid));
}
pInfo[playerid][logged] = 0;
RaceCheckpoint[playerid] = 0;
bar[playerid] = 0;
InJob[playerid] = 0;
cpin[playerid] = 0;
KillTimer(timer[1]);
KillTimer(timer[3]);
return 1;
}
__________________________________________________ _____________________
Login Dialog:
PHP код:
case DIALOG_LOGIN1:
{
if(!response)
{
Kick(playerid);
}
else
{
new pwlength = strlen(inputtext);
if(pwlength > 3)
{
new pw[200];
format(pw,sizeof(pw),"%s",dini_Get(path,"password"));
if(strcmp(inputtext, pw) == 0)
{
pInfo[playerid][skin] = dini_Int(path, "skin");
pInfo[playerid][govahi] = dini_Int(path, "govahi");
pInfo[playerid][XP] = dini_Int(path, "XP");
pInfo[playerid][cash] = dini_Int(path, "cash");
pInfo[playerid][score] = dini_Int(path, "score");
pInfo[playerid][email] = dini_Int(path, "email");
pInfo[playerid][moaref] = dini_Int(path, "moaref");
pInfo[playerid][logged] = 1;
SetTimerEx("loginspawn",100,false,"i",playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_WRONGPW, DIALOG_STYLE_MSGBOX, ""SEFID"Login", ""RED"Ramz Eshtebah Ast!", ""SEFID"OK", ""RED"Cancel");
}
}
else
{
ShowPlayerDialog(playerid, DIALOG_NOPW2, DIALOG_STYLE_MSGBOX, ""SEFID"Login", ""RED"Ramz Bishtar az 4 Ragam Mibashad!", ""SEFID"OK", ""RED"Cancel");
}
}
}
__________________________________________________ ________________________
PHP код:
Game Log:
[23:38:29] [connection] 127.0.0.1:54588 requests connection cookie.
[23:38:30] [connection] incoming connection: 127.0.0.1:54588 id: 0
[23:38:30] [join] Player has joined the server (0:127.0.0.1)
[23:38:42] [part] Player has left the server (0:1)
[23:39:13] [connection] 127.0.0.1:54589 requests connection cookie.
[23:39:14] [connection] incoming connection: 127.0.0.1:54589 id: 0
[23:40:05] [connection] 127.0.0.1:64326 requests connection cookie.
[23:40:06] [connection] incoming connection: 127.0.0.1:64326 id: 0
----------------------------------------------------------------------------------------------------
PLZ Help ME
Re: Server Closed Connection -
ColdGamePlay - 17.07.2016
The problem is either here
FilesCount();
or in that part, I'm not so sure
Код:
if(strfind(pname, "kir", true) != -1 || strfind(pname, "kun", true) != -1 || strfind(pname, "kos", true) != -1 || strfind(pname, "hack", true) != -1 || strfind(pname, "kick", true) != -1 || strfind(pname, "kick", true) != -1)
{
SendClientMessage(playerid,0x88AA62FF,""RED"UserName daraye * kalamate * zesht mibashad.");
SetTimerEx("KickTimer",3000,false,"i",playerid);
}
Re: Server Closed Connection -
Sna1L - 17.07.2016
tnQ sir , Problem Fixed