SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 01/06/2020, 11:43 PM   #1
JoaoGhost
Big Clucker
 
JoaoGhost's Avatar
 
Join Date: Sep 2018
Location: Brazil
Posts: 107
Reputation: 3
Default servidor caindo

Meu servidor fica caindo quando entra uns 8, e simplesmente a conta de alguns reseta e dá senha errada, refiz o sistema de registro 2 vezes de formas diferentes e da a mesma coisa.
JoaoGhost is offline   Reply With Quote
Old 01/06/2020, 11:49 PM   #2
PaulinSAMP
Big Clucker
 
PaulinSAMP's Avatar
 
Join Date: Apr 2020
Location: San Andreas
Posts: 85
Reputation: 0
Default Re: servidor caindo

Não pdc problema com o sistema de registro, as vezes o servidor está pouco otimizada, está com mtt timer e entre outras coisas.
PaulinSAMP is offline   Reply With Quote
Old 01/06/2020, 11:53 PM   #3
JoaoGhost
Big Clucker
 
JoaoGhost's Avatar
 
Join Date: Sep 2018
Location: Brazil
Posts: 107
Reputation: 3
Default Re: servidor caindo

Mas acontece q as contas estão resetando, o problema é no salvamento
JoaoGhost is offline   Reply With Quote
Old 02/06/2020, 12:03 AM   #4
k2bi
Big Clucker
 
k2bi's Avatar
 
Join Date: Sep 2017
Location: Novo Horizonte - SP
Posts: 129
Reputation: 1
Default Re: servidor caindo

Código?
k2bi is offline   Reply With Quote
Old 02/06/2020, 12:06 AM   #5
JoaoGhost
Big Clucker
 
JoaoGhost's Avatar
 
Join Date: Sep 2018
Location: Brazil
Posts: 107
Reputation: 3
Default Re: servidor caindo

Peguei no console isso:

PHP Code:
warningStrings without a length are deprecatedplease add a destination size.
warningString buffer overflow.

e dps 
--- Server Shutting Down
JoaoGhost is offline   Reply With Quote
Old 02/06/2020, 12:22 AM   #6
k2bi
Big Clucker
 
k2bi's Avatar
 
Join Date: Sep 2017
Location: Novo Horizonte - SP
Posts: 129
Reputation: 1
Default Re: servidor caindo

Não testei manim. Vê ae se funciona
PHP Code:
stock SaveInventory(playerid)
{
    new 
gItemList[200];
    new 
filename[48], str[64];
    
GetPlayerName(playerid,filename25);
    
format(str64,"Inventory/%s.inv",filename);
    new 
File:file=fopen(strio_append);
    for(new 
item;item<MAX_INV_ITEMS;item++)
    {
        if(!
strlen(_GetItemNamePVar(playerid,item))||!_GetItemAmountPVar(playerid,item))continue;
        
format(gItemList,sizeof(gItemList),"%s%s\n%d\n",gItemList,_GetItemNamePVar(playerid,item),_GetItemAmountPVar(playerid,item));
    }
    
fwrite(filegItemList);
    
fclose(file);

k2bi is offline   Reply With Quote
Old 02/06/2020, 12:30 AM   #7
JoaoGhost
Big Clucker
 
JoaoGhost's Avatar
 
Join Date: Sep 2018
Location: Brazil
Posts: 107
Reputation: 3
Default Re: servidor caindo

Quote:
Originally Posted by JoaoGhost View Post
Peguei no console isso:

PHP Code:
warningStrings without a length are deprecatedplease add a destination size.
warningString buffer overflow.

e dps 
--- Server Shutting Down
Quote:
Originally Posted by k2bi View Post
Não testei manim. Vê ae se funciona
PHP Code:
stock SaveInventory(playerid)
{
    new 
gItemList[200];
    new 
filename[48], str[64];
    
GetPlayerName(playerid,filename25);
    
format(str64,"Inventory/%s.inv",filename);
    new 
File:file=fopen(strio_append);
    for(new 
item;item<MAX_INV_ITEMS;item++)
    {
        if(!
strlen(_GetItemNamePVar(playerid,item))||!_GetItemAmountPVar(playerid,item))continue;
        
format(gItemList,sizeof(gItemList),"%s%s\n%d\n",gItemList,_GetItemNamePVar(playerid,item),_GetItemAmountPVar(playerid,item));
    }
    
fwrite(filegItemList);
    
fclose(file);

opa então, testei sem usar o salvamento do inventário mas caiu do mesmo jeito. não faço ideia do que pode ser
JoaoGhost is offline   Reply With Quote
Old 02/06/2020, 12:34 AM   #8
k2bi
Big Clucker
 
k2bi's Avatar
 
Join Date: Sep 2017
Location: Novo Horizonte - SP
Posts: 129
Reputation: 1
Default Re: servidor caindo

Mostre seu OnPlayerDisconnect e OnPlayerConnect
k2bi is offline   Reply With Quote
Old 02/06/2020, 12:40 AM   #9
JoaoGhost
Big Clucker
 
JoaoGhost's Avatar
 
Join Date: Sep 2018
Location: Brazil
Posts: 107
Reputation: 3
Default Re: servidor caindo

Quote:
Originally Posted by k2bi View Post
Mostre seu OnPlayerDisconnect e OnPlayerConnect
PHP Code:
public OnPlayerConnect(playerid)
{
    
format(arquivosizeof(arquivo), "Contas/%s.ini"pName2(playerid));
    if(
DOF2_FileExists(arquivo))
    {
        
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Logar""Você é Registrado, digite sua senha para logar!\nSe errar 5 vezes sua conta será banida!""Confirma""Cancelar");
    }
    else
    {
        
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT"Registro""Você ainda não é Registrado, digite uma senha para se registrar!""Confirma""Cancelar");
    }
    
AlreadyGiveWeapons[playerid] = false;
    
SetPlayerCameraPos(playerid, -2494.6897,1508.4241,242.3019);
    
SetPlayerCameraLookAt(playerid, -2571.0085,1640.4097,202.2260);
    
CarregarPlayerText(playerid);

    for(new 
iMAX_PLAYER_ATTACHED_OBJECTSi++) RemovePlayerAttachedObject(playeridi); // Remove os objetos
     
for(new iMAX_PLAYERS++)
      {
          if(
IsPlayerConnected(i))
        {
            
ShowProgressBarForPlayer(ibarsede);
            
ShowProgressBarForPlayer(ibarfome);
         }
     }
    new 
string[50];
    
format(string,sizeof(string), "{FFFF00}%s {C0C0C0}Entrou no servidor."pName2(playerid));
    
SendClientMessageToAll(-1,string);
    
SendDC(CHANNEL_ID"```%s Entrou no servidor.```"pName2(playerid));
    
SetTimerEx"Payday"1800000true"i"playerid);
    return 
1;

PHP Code:
public OnPlayerDisconnect(playeridreason)
{
    
pInfo[playerid][pLevel] = GetPlayerScore(playerid);
    
vida32[playerid] = GetPlayerHealth(playerid);
    
colete32[playerid] = GetPlayerArmour(playerid);
    
GetPlayerPos(playeridpInfo[playerid][pPosX], pInfo[playerid][pPosY], pInfo[playerid][pPosZ]);
    
format(arquivosizeof(arquivo), "Contas/%s.ini"pName2(playerid)); //Formata o arquivo com o nome do playerid
    
if(DOF2_FileExists(arquivo))
    {
        
DOF2_SetInt(arquivo"Senha"pInfo[playerid][pSenha]);
         
DOF2_SetInt(arquivo"Coin"pInfo[playerid][pCoin]);
         
DOF2_SetInt(arquivo"Score"pInfo[playerid][pLevel]);
         
DOF2_SetInt(arquivo"Mochila"pInfo[playerid][pBackpack]);
            
DOF2_SetInt(arquivo"OColete"pInfo[playerid][pTemColete]);
            
DOF2_SetInt(arquivo"Capacete"pInfo[playerid][pTemCapacete]);
         
DOF2_SetInt(arquivo"Kills"pkill[playerid]);
         
DOF2_SetInt(arquivo"Death"pdeath[playerid]);
         
DOF2_SetInt(arquivo"Fome"pInfo[playerid][pFome]);
         
DOF2_SetInt(arquivo"Sede"pInfo[playerid][pSede]);
         
DOF2_SetInt(arquivo"Admin"pInfo[playerid][pAdmin]);
         
DOF2_SetInt(arquivo"Skin"pInfo[playerid][pSkin]);
         
DOF2_SetInt(arquivo"GPS"pInfo[playerid][pTemGPS]);
         
DOF2_SetInt(arquivo"Banido"pInfo[playerid][pBanido]);
         
DOF2_SetFloat(arquivo"vida"vida32[playerid]);
         
DOF2_SetFloat(arquivo"colete"colete32[playerid]);
         
DOF2_SetFloat(arquivo"SpawnX"pInfo[playerid][pPosX]);
         
DOF2_SetFloat(arquivo"SpawnY"pInfo[playerid][pPosY]);
         
DOF2_SetFloat(arquivo"SpawnZ"pInfo[playerid][pPosZ]);
         
DOF2_SaveFile();
    }
    
pInfo[playerid][pSenha] = 0;
    
    
KillTimer(SangueTimer[playerid]);
    for(new 
Player_Data:iPlayer_Datai++) pInfo[playerid][i] = 0;  // Resta os Dados
    
pInfo[playerid][pConectado] = false;
    return 
1;

JoaoGhost is offline   Reply With Quote
Old 02/06/2020, 12:44 AM   #10
ipsLuan
High-roller
 
ipsLuan's Avatar
 
Join Date: Feb 2013
Location: Ilhéus, BA
Posts: 4,547
Reputation: 332
Default Re: servidor caindo

Esse erro é padrão do sscanf.
Coloque um debug pra chamar quando executar algum comando pra saber aonde está o erro.

Você provavelmente adicionou algum comando com sscanf recentemente. Lembra de algum?
__________________
Precisando de algum sistema? Me contate.
ipsLuan 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
[Ajuda] caindo do servidor... Pequeno Português/Portuguese 4 18/01/2017 02:52 PM
[Ajuda] Servidor caindo? zGuigui2068 Português/Portuguese 2 19/03/2016 06:58 PM
[Ajuda] Servidor Caindo ModaLOKO Português/Portuguese 23 22/07/2015 05:26 PM
[Ajuda] Servidor caindo neymar1477 Português/Portuguese 7 15/05/2014 11:35 PM
[Ajuda] Servidor caindo neymar1477 Português/Portuguese 2 29/04/2014 05:55 AM


All times are GMT. The time now is 02:52 AM.


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