[Ajuda] servidor caindo
#9

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;

Reply


Messages In This Thread
servidor caindo - by JoaoGhost - 01.06.2020, 23:43
Re: servidor caindo - by PaulinSAMP - 01.06.2020, 23:49
Re: servidor caindo - by JoaoGhost - 01.06.2020, 23:53
Re: servidor caindo - by k2bi - 02.06.2020, 00:03
Re: servidor caindo - by JoaoGhost - 02.06.2020, 00:06
Re: servidor caindo - by k2bi - 02.06.2020, 00:22
Re: servidor caindo - by JoaoGhost - 02.06.2020, 00:30
Re: servidor caindo - by k2bi - 02.06.2020, 00:34
Re: servidor caindo - by JoaoGhost - 02.06.2020, 00:40
Re: servidor caindo - by ipsLuan - 02.06.2020, 00:44

Forum Jump:


Users browsing this thread: 1 Guest(s)