GM "Server closed the connection" -
MorreJaa - 14.12.2014
Boas,
Й o seguinte, o meu gamemode funciona bem tudo 100%, mas se eu saiu do servidor nunca mais consigo entrar nele, porque da-me "Server closed the connection" sу se desligar o servidor e voltar a ligar й que consigo voltar a entrar.
Aqui deixo o print:
http://i.imgur.com/3XOzwFZ.jpg?1
Disseram que pode ser na public onplayerdisconnect jб tive a ver e nгo vejo nada, deixo aqui pra vocкs verem:
Код:
public OnPlayerDisconnect(playerid, reason)
{
for(new i; i<MAX_VEHICLES; i++)
{
DestroyObject(gIndicator1[playerid][i]);
DestroyObject(gIndicator2[playerid][i]);
DestroyObject(gIndicator3[playerid][i]);
DestroyObject(gIndicator4[playerid][i]);
}
if(IsPlayerNPC(playerid))
{
Delete3DTextLabel(label[playerid]);
return 1;
}
new unique=PlayerInfo[playerid][UniqueID];
KillTimer(Timer2);
KillTimer(Timer3);
KillTimer(Timer4[playerid]);
KillTimer(Timer5);
KillTimer(Curar1[playerid]);
KillTimer(Curar2[playerid]);
KillTimer(Curar3[playerid]);
TextDrawHideForPlayer(playerid,Textdraw1);
TextDrawHideForPlayer(playerid,Textdraw0);
new string[128];
OnPlayerDataSave(playerid);
if(reason == 0)
{
if(gPlayerLogged[playerid])
{
KillTimer(TimerLolada);
PlayerLocalMessage(playerid,15.0,"acabou de crashar/cair do servidor.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
TextDrawHideForPlayer(i, TextdrawInfo[i]); //Wait
format(string, sizeof(string), "O Jogador %s (ID:%d) crashou do servidor.", GetPlayerNameEx(playerid),playerid);
TextDrawSetString(TextdrawInfo[i],string);
TextDrawColor(TextdrawInfo[i], 0xFFC66361);
TextDrawShowForPlayer(i, TextdrawInfo[i]);
}
TimerLolada = SetTimer("EntrouSai", 8000, 0);
SalvarPlayerStatus(unique, 0);
}
}
else if(reason == 1)
{
KillTimer(TimerLolada);
for(new i = 0; i < MAX_PLAYERS; i++)
{
TextDrawHideForPlayer(i, TextdrawInfo[i]);
format(string, sizeof(string), "O Jogador %s (ID:%d) abandonou o servidor.", GetPlayerNameEx(playerid),playerid);
TextDrawSetString(TextdrawInfo[i],string);
TextDrawColor(TextdrawInfo[i], 0xFF000061);
TextDrawShowForPlayer(i, TextdrawInfo[i]);
}
TimerLolada = SetTimer("EntrouSai", 8000, 0);
SalvarPlayerStatus(unique, 0);
return 1;
}
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
PlayerInfo[playerid][CrashX] = x;
PlayerInfo[playerid][CrashY] = y;
PlayerInfo[playerid][CrashZ] = z;
PlayerInfo[playerid][CrashInt] = GetPlayerInterior(playerid);
PlayerInfo[playerid][CrashW] = GetPlayerVirtualWorld(playerid);
PlayerInfo[playerid][Crashed] = 1;
OnPlayerDataSave(playerid);
SairDeDuty(playerid);
SalvarPlayerStatus(unique, 0);
UniquePlayerLogged[unique]=0;
LoggedID[unique]=-1;
KillTimer(verificartimer[playerid]);
return 1;
}
Tambem dizem que pode ser por falta de pastas/arquivos de salvamento na scriptfiles, se for este o caso como descubro qual ficheiro falta?
+1 coisa, eu sempre que entro no servidor tenho que fazer /resetallcars para os carros entrarem no mapa, dai tenho que voltar a setar os carros para os faction/jobs etc... se sair do servidor os carros desaparecem e fico "Server closed the connection".
Pessoal eu preciso de um scripter profissional, o servidor funciona por mysql, o servidor й 100% RP, um dos melhores portuguкses apenas tб a dar este erro chato que nгo sei resolver.
Agradeзo desde jб.
+Rep a quem ajudar (:
Re: GM "Server closed the connection" -
Jimmmy - 14.12.2014
Nгo cria 2 topico so vocк editar o que vocк crio .
me mande sua OnPlayerConnect
Re: GM "Server closed the connection" -
PawnOX - 14.12.2014
What
english plz
Re: GM "Server closed the connection" -
MorreJaa - 14.12.2014
Tб ai mano, desculpa dubble topic
Код:
public OnPlayerConnect(playerid)
{
gPlayerLogged[playerid] = 0;
//TextDrawShowForPlayer(playerid, Sprite2);
ResetStats(playerid);//Setting variables to 0.
new querypay[128],Valor[256];
format(querypay, sizeof(querypay), "SELECT * FROM `JogadorInfo` WHERE `Nome`='%s'", PlayerName(playerid));
mysql_query(querypay);
mysql_store_result();
if (mysql_num_rows() > 0)
{
while(mysql_retrieve_row())
{
mysql_fetch_field_row(Valor, "Email"); strmid(JogadorInfo[playerid][Email], Valor, 0, strlen(Valor), 255);
}
mysql_free_result();
}
ContaKM[playerid] = CreatePlayerTextDraw(playerid,474.000000, 327.000000, "Motor:~n~Luzes:~n~Velocidade:~n~Combustivel:~n~Kilometros:~n~Consumo:");
PlayerTextDrawBackgroundColor(playerid,ContaKM[playerid], 0x000000FF);
PlayerTextDrawFont(playerid,ContaKM[playerid], 2);
PlayerTextDrawLetterSize(playerid,ContaKM[playerid], 0.339999, 1.299999);
PlayerTextDrawColor(playerid,ContaKM[playerid], 0x0F90FFFF);
PlayerTextDrawSetOutline(playerid,ContaKM[playerid], 1);
PlayerTextDrawSetProportional(playerid,ContaKM[playerid], 1);
ContaKM2[playerid] = CreatePlayerTextDraw(playerid,529.000000, 327.000000, "__Ligado~n~Desligados~n~__________130 KM/h~n~__________10000");
PlayerTextDrawFont(playerid,ContaKM2[playerid], 2);
PlayerTextDrawLetterSize(playerid,ContaKM2[playerid], 0.339999, 1.299999);
PlayerTextDrawColor(playerid,ContaKM2[playerid], 0xFFFFFFFF);
PlayerTextDrawBackgroundColor(playerid,ContaKM2[playerid], 0x000000FF);
PlayerTextDrawSetOutline(playerid,ContaKM2[playerid], 1);
PlayerTextDrawSetProportional(playerid,ContaKM2[playerid], 1);
SetPlayerHealth(playerid, 100);
if(TimerSinceLastConnection!=-1)
{
KillTimer(TimerSinceLastConnection);
}
TimerSinceLastConnection=SetTimer("TimeSinceLastConnectionInc", 1000, true);
format(PlayerIP1, sizeof(PlayerIP1), "%s", PlayerIP2);
format(PlayerIP2, sizeof(PlayerIP1), "%s", PlayerIP3);
GetPlayerIp(playerid, PlayerIP3, sizeof(PlayerIP3));
if(strcmp(PlayerIP1,PlayerIP2, true ) == 0 && strcmp(PlayerIP3,PlayerIP2, true ) == 0 && TimeSinceLastConnection < 2 && TimeSinceLastConnection != -1)
{
new comandorcon[100];
format(comandorcon, sizeof(comandorcon), "banip %s", PlayerIP2);
SendRconCommand(comandorcon);
format(comandorcon, sizeof(comandorcon), "unbanip %s", PlayerIP2);
SetTimerEx("SendarRconCommand", 900000, false, "s", comandorcon);
}
TimeSinceLastConnection=0;
if(IsPlayerNPC(playerid))
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(strcmp("Roberto_Leal",sendername, true ) == 0 )
{
PlayerInfo[playerid][HAdmin]=3;
return 1;
}
}
SetPlayerHealth(playerid,45.0);
PlayerBanido[playerid]=0;
PlayAudioStreamForPlayer(playerid,"http://multygroup.org/music/Resistente%20-%20Let%20Your%20Mind%20Play.mp3");
TogglePlayerSpectating(playerid, 0);
if(IsPlayerNPC(playerid)) return 1;
HaveTaser[playerid] = 0;
RemovePlayerAttachedObject(playerid, 6);
RemovePlayerAttachedObject(playerid, 0);
RemovePlayerAttachedObject(playerid, 1);
RemovePlayerAttachedObject(playerid, 2);
RemovePlayerAttachedObject(playerid, 3);
RemovePlayerAttachedObject(playerid, 4);
RemovePlayerAttachedObject(playerid, 5);
RemoverObjectos(playerid);
new string[63];
//==================[Join Counter]=========================
JoinCounter = JoinCounter + 1;
dini_IntSet("CRP_Scriptfiles/Other/JoinCounter.cfg", "Connections", JoinCounter);
TextDrawShowForPlayer(playerid, welcome);
TextDrawShowForPlayer(playerid, topblack);
TextDrawShowForPlayer(playerid, bottomblack);
SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,0);
SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL_SILENCED,0);
SetPlayerSkillLevel(playerid,WEAPONSKILL_DESERT_EAGLE,0);
SetPlayerSkillLevel(playerid,WEAPONSKILL_SHOTGUN,0);
SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,0);
SetPlayerSkillLevel(playerid,WEAPONSKILL_SPAS12_SHOTGUN,0);
SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,0);
SetPlayerSkillLevel(playerid,WEAPONSKILL_MP5,0);
SetPlayerSkillLevel(playerid,WEAPONSKILL_AK47,0);
SetPlayerSkillLevel(playerid,WEAPONSKILL_M4,0);
SetPlayerSkillLevel(playerid,WEAPONSKILL_SNIPERRIFLE,0);
//=========================================================xx
gPlayerLogged[playerid] = 0;
Seatbelt[playerid] = 0;
radiocarstatus[playerid] = 0;
entrar[playerid] = 0;
//=========================================================x
ClearScreen(playerid);//Clearing the users screen from SA-MP messages.
KillTimer(TimerLolada);
for(new i = 0; i < MAX_PLAYERS; i++)
{
TextDrawHideForPlayer(i, TextdrawInfo[i]);
format(string, sizeof(string), "O Jogador %s (ID:%d) entrou no servidor.", GetPlayerNameEx(playerid),playerid);
TextDrawSetString(TextdrawInfo[i],string);
TextDrawColor(TextdrawInfo[i], 0x00FF0061);
TextDrawShowForPlayer(i, TextdrawInfo[i]);
}
TimerLolada = SetTimer("EntrouSai", 8000, 0);
ShowScriptStats(playerid);//Showing the script information.
SendClientMessage(playerid, COLOR_AZULBEBE,"A connectar...");
return 1;
}
Re: GM "Server closed the connection" -
PT - 14.12.2014
Editar a xG v.7.5 sem saberes SQL ou o minimo de pawn esta completamente errado, irao te surgir mais problemas e nao saberas resolver-los
Re: GM "Server closed the connection" -
MorreJaa - 14.12.2014
Venderem-me o gamemode com erros isso foi roubo
por isso vim aqui pedir ajuda....
Re: GM "Server closed the connection" -
Jimmmy - 14.12.2014
A culpa e sua de ter comprado ' k
cara pega uma base sem bugs , e faзa seu GameMode proprio .
Melhor coisa que tem na vida . so assim vocк fazer um codigo ja vai sabe aonde esta errado .
Re: GM "Server closed the connection" -
MorreJaa - 14.12.2014
Vim aqui pedir ajuda, quem nгo quer ajudar nгo respoda.
Re: GM "Server closed the connection" -
Jimmmy - 14.12.2014
Nгo tou falando que niguem vai te ajudar , estou te dando dica ..
o que vai adiantar conserta isso e ter mais erros depois ? Eu so falei o que e melhor mais ja que vocк quer continuar com esse gm poblema й seu .
so achei errado essa mensagem
" por isso vim aqui pedir ajuda... "
se vocк compro , niguem aki do forum tem aver .
Re: GM "Server closed the connection" -
MorreJaa - 14.12.2014
Ao dar gmx apareзe isto:
Acho que o problema vem dai:
http://i.imgur.com/PrtkgNN.jpg?1
Dб para resolver isto vendo no proprio gamemode?