[Ajuda] carregamento
#1

Ola galera seguinte quando o player se registra ele salva todas as info.
ai eu pego e desligo o servidor . e ligo denovo , o player vai logar e perde tudo
dinheiro score tem que fazer o tutorial tudo denovo, e fica setado tudo zerado ¬¬.

code de carregamento do player.

pawn Код:
stock SalvarConta(playerid)
{
    new String[99];
    GetPlayerName(playerid, Nome,sizeof(Nome));
    format(String, sizeof(String), "Contas/%s.ini", Nome);

    DOF2_SetInt(String,  "Dinheiro", Dinheiro);
    DOF2_SetInt(String,  "Banco", TitoInfo[playerid][pBank]);
    DOF2_SetInt(String,  "Score", GetPlayerScore(playerid));
    DOF2_SetInt(String,  "AdiminLevel", TitoInfo[playerid][pAdmin]);
    DOF2_SetInt(String,  "Emprego", TitoInfo[playerid][pJob]);
    DOF2_SetBool(String,  "Tutorial", TitoInfo[playerid][pTut]);
    DOF2_SetInt(String,  "Cash", TitoInfo[playerid][pCash]);
    DOF2_SetInt(String,  "Respeito", TitoInfo[playerid][pRespeito]);
    DOF2_SetBool(String,  "Empresa", TitoInfo[playerid][Empresa]);
    DOF2_SetInt(String,  "Aviso", TitoInfo[playerid][pAviso]);
    DOF2_SetInt(String,  "Skin", GetPlayerSkin(playerid));
    DOF2_SetBool(String,  "Indentidade", TitoInfo[playerid][Indentidade]);
    DOF2_SetInt(String,  "Drogas", TitoInfo[playerid][pDrogas]);
    DOF2_SetInt(String,  "Dinamite", TitoInfo[playerid][pDinamite]);
    DOF2_SaveFile();
    return 1;
}
stock CarregarConta(playerid)
{
    new String[99];
    GetPlayerName(playerid, Nome,sizeof(Nome));
    format(String, sizeof(String), "Contas/%s.ini", Nome);
    if(!DOF2_FileExists(String))
    {
        TitoInfo[playerid][pDinheiro]  = DOF2_GetInt(String,   "Dinheiro");
        TitoInfo[playerid][pBank] = DOF2_GetInt(String,           "Banco");
        TitoInfo[playerid][pScore] = DOF2_GetInt(String,          "Score");
        TitoInfo[playerid][pAdmin] = DOF2_GetInt(String,    "AdiminLevel");
        TitoInfo[playerid][pJob] = DOF2_GetInt(String,          "Emprego");
        TitoInfo[playerid][pTut] = DOF2_GetBool(String,         "Tutorial");
        TitoInfo[playerid][pCash] = DOF2_GetInt(String,            "Cash");
        TitoInfo[playerid][pRespeito] = DOF2_GetInt(String,    "Respeito");
        TitoInfo[playerid][pAviso] = DOF2_GetInt(String,          "Aviso");
        TitoInfo[playerid][pSkin] =  DOF2_GetInt(String,  "Skin");
        TitoInfo[playerid][Empresa] = DOF2_GetBool(String,  "Empresa");
        TitoInfo[playerid][Indentidade] = DOF2_GetBool(String,  "Indentidade");
        TitoInfo[playerid][pDrogas] = DOF2_GetBool(String,  "Drogas");
        TitoInfo[playerid][pDinamite] = DOF2_GetInt(String,  "Dinamite");
    }
    return 1;
}
Reply
#2

pawn Код:
stock CarregarConta(playerid)
{
    new String[99];
    GetPlayerName(playerid, Nome,sizeof(Nome));
    format(String, sizeof(String), "Contas/%s.ini", Nome);
    TitoInfo[playerid][pDinheiro]  = DOF2_GetInt(String,   "Dinheiro");
    TitoInfo[playerid][pBank] = DOF2_GetInt(String,           "Banco");
    TitoInfo[playerid][pScore] = DOF2_GetInt(String,          "Score")
    TitoInfo[playerid][pAdmin] = DOF2_GetInt(String,    "AdiminLevel");
    TitoInfo[playerid][pJob] = DOF2_GetInt(String,          "Emprego");
    TitoInfo[playerid][pTut] = DOF2_GetBool(String,         "Tutorial");
    TitoInfo[playerid][pCash] = DOF2_GetInt(String,            "Cash");
    TitoInfo[playerid][pRespeito] = DOF2_GetInt(String,    "Respeito");
    TitoInfo[playerid][pAviso] = DOF2_GetInt(String,          "Aviso");
    TitoInfo[playerid][pSkin] =  DOF2_GetInt(String,  "Skin");
    TitoInfo[playerid][Empresa] = DOF2_GetBool(String,  "Empresa");
    TitoInfo[playerid][Indentidade] = DOF2_GetBool(String,  "Indentidade");
    TitoInfo[playerid][pDrogas] = DOF2_GetBool(String,  "Drogas");
    TitoInfo[playerid][pDinamite] = DOF2_GetInt(String,  "Dinamite");
    return 1;
}
Tenta aн
Reply
#3

Quote:
Originally Posted by .FuneraL.
Посмотреть сообщение
Tenta aн
deu nгo. me registrei desliguei e liguei de novo e deu a mesma coisa.
Reply
#4

Quote:
Originally Posted by mau.tito
Посмотреть сообщение
deu nгo. me registrei desliguei e liguei de novo e deu a mesma coisa.
Vocк saiu antes de desligar?
Se o servidor for desligado com vocк ainda online, as informaзхes nгo sгo salvas...
Reply
#5

pawn Код:
public OnGameModeExit()
{
    for(new r; r<MAX_PLAYERS; ri++)
    {
        if(IsPlayerConnected(r))
        {
            SalvarConta(r);
            DOF2_Exit();
        }
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by CaioMiglioli
Посмотреть сообщение
Vocк saiu antes de desligar?
Se o servidor for desligado com vocк ainda online, as informaзхes nгo sгo salvas...
Acha que nгo sei ¬¬


Eu me registro ganho level dinheiro e talz , ai eu saiu e desligo o servidor ai ligo quando entro reseta a conta ¬¬
Reply
#7

Quote:
Originally Posted by mau.tito
Посмотреть сообщение
Acha que nгo sei ¬¬


Eu me registro ganho level dinheiro e talz , ai eu saiu e desligo o servidor ai ligo quando entro reseta a conta ¬¬
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
      SalvarConta(playerid);
      return 1;
}
Reply
#8

Errado:

pawn Код:
stock CarregarConta(playerid)
{
    new String[99];
    GetPlayerName(playerid, Nome,sizeof(Nome));
    format(String, sizeof(String), "Contas/%s.ini", Nome);
    if(!DOF2_FileExists(String))
    {
        TitoInfo[playerid][pDinheiro]  = DOF2_GetInt(String,   "Dinheiro");
        TitoInfo[playerid][pBank] = DOF2_GetInt(String,           "Banco");
        TitoInfo[playerid][pScore] = DOF2_GetInt(String,          "Score");
        TitoInfo[playerid][pAdmin] = DOF2_GetInt(String,    "AdiminLevel");
        TitoInfo[playerid][pJob] = DOF2_GetInt(String,          "Emprego");
        TitoInfo[playerid][pTut] = DOF2_GetBool(String,         "Tutorial");
        TitoInfo[playerid][pCash] = DOF2_GetInt(String,            "Cash");
        TitoInfo[playerid][pRespeito] = DOF2_GetInt(String,    "Respeito");
        TitoInfo[playerid][pAviso] = DOF2_GetInt(String,          "Aviso");
        TitoInfo[playerid][pSkin] =  DOF2_GetInt(String,  "Skin");
        TitoInfo[playerid][Empresa] = DOF2_GetBool(String,  "Empresa");
        TitoInfo[playerid][Indentidade] = DOF2_GetBool(String,  "Indentidade");
        TitoInfo[playerid][pDrogas] = DOF2_GetBool(String,  "Drogas");
        TitoInfo[playerid][pDinamite] = DOF2_GetInt(String,  "Dinamite");
    }
    return 1;
}
Vocк pфs pra carregar somente caso o arquivo nгo exista.


Correto:

pawn Код:
stock CarregarConta(playerid)
{
    new String[99];
    GetPlayerName(playerid, Nome,sizeof(Nome));
    format(String, sizeof(String), "Contas/%s.ini", Nome);
    if(DOF2_FileExists(String))
    {
        TitoInfo[playerid][pDinheiro]  = DOF2_GetInt(String,   "Dinheiro");
        TitoInfo[playerid][pBank] = DOF2_GetInt(String,           "Banco");
        TitoInfo[playerid][pScore] = DOF2_GetInt(String,          "Score");
        TitoInfo[playerid][pAdmin] = DOF2_GetInt(String,    "AdiminLevel");
        TitoInfo[playerid][pJob] = DOF2_GetInt(String,          "Emprego");
        TitoInfo[playerid][pTut] = DOF2_GetBool(String,         "Tutorial");
        TitoInfo[playerid][pCash] = DOF2_GetInt(String,            "Cash");
        TitoInfo[playerid][pRespeito] = DOF2_GetInt(String,    "Respeito");
        TitoInfo[playerid][pAviso] = DOF2_GetInt(String,          "Aviso");
        TitoInfo[playerid][pSkin] =  DOF2_GetInt(String,  "Skin");
        TitoInfo[playerid][Empresa] = DOF2_GetBool(String,  "Empresa");
        TitoInfo[playerid][Indentidade] = DOF2_GetBool(String,  "Indentidade");
        TitoInfo[playerid][pDrogas] = DOF2_GetBool(String,  "Drogas");
        TitoInfo[playerid][pDinamite] = DOF2_GetInt(String,  "Dinamite");
    }
    return 1;
}
Reply
#9

ae Galera o sistema de registro ve se tem algo de errado.

pawn Код:
#include <a_samp>
#include <DOF2>

#define DIALOG_REGISTRO  1
#define DIALOG_LOGIN     2

enum pInfo
{
     pScore,
     pDinheiro,
     pBank,
     pAdmin,
     pJob,
     bool:pTut,
     pCash,
     pRespeito,
     bool:Empresa,
     bool:Indentidade,
     pAviso,
     pSkin,
     pDrogas,
     pDinamite,
     pVida,
     pColete
}
new TitoInfo[MAX_PLAYERS][pInfo];
public OnPlayerConnect(playerid)
{
    new String[500];
    GetPlayerName(playerid, Nome,sizeof(Nome));
    format(String, sizeof(String), "Contas/%s.ini", Nome);
    if(!DOF2_FileExists(String))
    {
        format(String, sizeof(String), "{FFFFFF}Seja Bem Vindo ao Servidor, Sr.{01FCFF}%s{FFFFFF} vocк nгo esta Registrado \npois й sua primeira vez, digite uma senha para efutar o registro(utilize senhas confiveis):", Nome);
        ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "Servidor", String, "Registrar", "Cancelar"),OnPlayerDisconnect(playerid,reason);
    }
    else
    {
        format(String, sizeof(String),"{FFFFFF}Seja Bem Vindo ao Servidor, sua Conta e Registrada\nConta {01FCFF}%s{FFFFFF}, Digite sua senha para efutar o login:", Nome);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Servidor", String, "Logar", "Cancelar"),OnPlayerDisconnect(playerid,reason);
    }
    return true;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(dialogid == DIALOG_REGISTRO)
   {
     if(response)
     {
        if(!strlen(inputtext))
        {
            new String[1000];
            GetPlayerName(playerid, Nome,sizeof(Nome));
            format(String, sizeof(String), "{FFFFFF}Seja Bem Vindo ao Servidor, Sr.{01FCFF}%s{FFFFFF} vocк nгo esta Registrado \npois й sua primeira vez, digite uma senha para efutar o registro(utilize senhas confiveis):", Nome);
            ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "Servidor", String, "Registrar", "Cancelar");
            SendClientMessage(playerid,0x1E90FFAA,"Senha incorreta !!");
            return 1;
        }
        new String[700];
        GetPlayerName(playerid, Nome,sizeof(Nome));
        format(String, sizeof(String), "Contas/%s.ini", Nome);
        DOF2_CreateFile(String);
        DOF2_SetString(String, "Senha", inputtext);
        GivePlayerMoney(playerid, 1000);
        TitoInfo[playerid][pDinheiro] = 1000;
        TitoInfo[playerid][pAdmin] = 0;
        TitoInfo[playerid][pScore] = 1;
        SetPlayerScore(playerid, 1);
        TitoInfo[playerid][pAviso] = 0;
        TitoInfo[playerid][pTut] = false;
        TitoInfo[playerid][Empresa] = false;
        SalvarConta(playerid);
        SpawnPlayer(playerid);
        format(String,sizeof(String),"Hello %s, you just desired record is level 1 & won $1000 in cash.",Nome);
        SendClientMessage(playerid, -1, String);
        GetPlayerName(playerid, Nome,sizeof(Nome));
        format(String, sizeof(String),"{FFFFFF}Seja Bem Vindo ao Servidor, sua Conta e Registrada\nConta {01FCFF}%s{FFFFFF}, Digite sua senha para efutar o login:", Nome);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Servidor", String, "Logar", "Cancelar");
        return 1;
     }
     else
     {
        SendClientMessage(playerid, 0xFF0000AA, "Voce Foi Kickado!");
        Kick(playerid);
        return 1;
     }
   }
   if(dialogid == DIALOG_LOGIN)
   {
     if(response)
     {
        if(!strlen(inputtext))
        {
            new String[1000];
            GetPlayerName(playerid, Nome,sizeof(Nome));
            format(String, sizeof(String),"{FFFFFF}Seja Bem Vindo ao Servidor, sua Conta e Registrada\nConta {01FCFF}%s{FFFFFF}, Digite sua senha para efutar o login:", Nome);
            ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Servidor", String, "Logar", "Cancelar");
            SendClientMessage(playerid,0x1E90FFAA,"Senha Incorreta !");
            return 1;
        }
        new String[1000], str[200];
        GetPlayerName(playerid, Nome,sizeof(Nome));
        format(String, sizeof(String), "Contas/%s.ini", Nome);
        if(DOF2_FileExists(String))
        {
           if(strcmp((inputtext), DOF2_GetString(String,"Senha"), true) == 0)
           {
              CarregarConta(playerid);
              SpawnPlayer(playerid);
              SendClientMessage(playerid, -1,"|---------------------------------------------------|");
              format(str,sizeof(str),"Seja Bem Vindo , %s .", Nome);
              SendClientMessage(playerid, -1, str);
              SendClientMessage(playerid, -1,"Servidor");
              SendClientMessage(playerid, -1,"|----------------------------------------------------|");
              format(str,sizeof(str),"~g~Seja Bem Vindo~n~ ~y~ %s", Nome);
              GameTextForPlayer(playerid, str, 2000, 1);
           }
        }
        else
        {
           SendClientMessage(playerid,0x00FF00AA,"Senha incorreta digite-a novamente");
           format(String, sizeof(String), "{FFFFFF}Seja Bem Vindo ao Servidor, sua Conta e Registrada\nConta {01FCFF}%s{FFFFFF}, Digite sua senha para efutar o login:", Nome);
           ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Servidor", String, "Logar", "Cancelar");
        }
        return 1;
     }
     else
     {
        SendClientMessage(playerid, 0xFF0000AA, "Voce Foi Kickado!");
        Kick(playerid);
        return 1;
     }
   }
   return true;
}
stock SalvarConta(playerid)
{
    new String[99];
    GetPlayerName(playerid, Nome,sizeof(Nome));
    format(String, sizeof(String), "Contas/%s.ini", Nome);

    DOF2_SetInt(String,  "Dinheiro", GetPlayerMoney(playerid));
    DOF2_SetInt(String,  "Banco", TitoInfo[playerid][pBank]);
    DOF2_SetInt(String,  "Score", GetPlayerScore(playerid));
    DOF2_SetInt(String,  "AdiminLevel", TitoInfo[playerid][pAdmin]);
    DOF2_SetInt(String,  "Emprego", TitoInfo[playerid][pJob]);
    DOF2_SetBool(String,  "Tutorial", TitoInfo[playerid][pTut]);
    DOF2_SetInt(String,  "Cash", TitoInfo[playerid][pCash]);
    DOF2_SetInt(String,  "Respeito", TitoInfo[playerid][pRespeito]);
    DOF2_SetBool(String,  "Empresa", TitoInfo[playerid][Empresa]);
    DOF2_SetInt(String,  "Aviso", TitoInfo[playerid][pAviso]);
    DOF2_SetInt(String,  "Skin", GetPlayerSkin(playerid));
    DOF2_SetBool(String,  "Indentidade", TitoInfo[playerid][Indentidade]);
    DOF2_SetInt(String,  "Drogas", TitoInfo[playerid][pDrogas]);
    DOF2_SetInt(String,  "Dinamite", TitoInfo[playerid][pDinamite]);
    DOF2_SaveFile();
    return 1;
}
stock CarregarConta(playerid)
{
    new String[99];
    GetPlayerName(playerid, Nome,sizeof(Nome));
    format(String, sizeof(String), "Contas/%s.ini", Nome);
    if(DOF2_FileExists(String))
    {
        TitoInfo[playerid][pDinheiro]  = DOF2_GetInt(String,   "Dinheiro");
        TitoInfo[playerid][pBank] = DOF2_GetInt(String,           "Banco");
        TitoInfo[playerid][pScore] = DOF2_GetInt(String,          "Score");
        TitoInfo[playerid][pAdmin] = DOF2_GetInt(String,    "AdiminLevel");
        TitoInfo[playerid][pJob] = DOF2_GetInt(String,          "Emprego");
        TitoInfo[playerid][pTut] = DOF2_GetBool(String,         "Tutorial");
        TitoInfo[playerid][pCash] = DOF2_GetInt(String,            "Cash");
        TitoInfo[playerid][pRespeito] = DOF2_GetInt(String,    "Respeito");
        TitoInfo[playerid][pAviso] = DOF2_GetInt(String,          "Aviso");
        TitoInfo[playerid][pSkin] =  DOF2_GetInt(String,  "Skin");
        TitoInfo[playerid][Empresa] = DOF2_GetBool(String,  "Empresa");
        TitoInfo[playerid][Indentidade] = DOF2_GetBool(String,  "Indentidade");
        TitoInfo[playerid][pDrogas] = DOF2_GetBool(String,  "Drogas");
        TitoInfo[playerid][pDinamite] = DOF2_GetInt(String,  "Dinamite");
    }
    return 1;
}
Reply
#10

pawn Код:
#include <a_samp>
#include <DOF2>

#define DIALOG_REGISTRO  1
#define DIALOG_LOGIN     2

enum pInfo
{
     pScore,
     pDinheiro,
     pBank,
     pAdmin,
     pJob,
     bool:pTut,
     pCash,
     pRespeito,
     bool:Empresa,
     bool:Indentidade,
     pAviso,
     pSkin,
     pDrogas,
     pDinamite,
     pVida,
     pColete
}
new TitoInfo[MAX_PLAYERS][pInfo];
public OnPlayerConnect(playerid)
{
    new String[500];
    GetPlayerName(playerid, Nome,sizeof(Nome));
    format(String, sizeof(String), "Contas/%s.ini", Nome);
    if(!DOF2_FileExists(String))
    {
        format(String, sizeof(String), "{FFFFFF}Seja Bem Vindo ao Servidor, Sr.{01FCFF}%s{FFFFFF} vocк nгo esta Registrado \npois й sua primeira vez, digite uma senha para efutar o registro(utilize senhas confiveis):", Nome);
        ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "Servidor", String, "Registrar", "Cancelar");
    }
    else
    {
        format(String, sizeof(String),"{FFFFFF}Seja Bem Vindo ao Servidor, sua Conta e Registrada\nConta {01FCFF}%s{FFFFFF}, Digite sua senha para efutar o login:", Nome);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Servidor", String, "Logar", "Cancelar");
    }
    return true;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(dialogid == DIALOG_REGISTRO)
   {
     if(response)
     {
        if(!strlen(inputtext))
        {
            new String[1000];
            GetPlayerName(playerid, Nome,sizeof(Nome));
            format(String, sizeof(String), "{FFFFFF}Seja Bem Vindo ao Servidor, Sr.{01FCFF}%s{FFFFFF} vocк nгo esta Registrado \npois й sua primeira vez, digite uma senha para efutar o registro(utilize senhas confiveis):", Nome);
            ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "Servidor", String, "Registrar", "Cancelar");
            SendClientMessage(playerid,0x1E90FFAA,"Senha incorreta !!");
            return 1;
        }
        new String[700];
        GetPlayerName(playerid, Nome,sizeof(Nome));
        format(String, sizeof(String), "Contas/%s.ini", Nome);
        DOF2_CreateFile(String);
        DOF2_SetString(String, "Senha", inputtext);
        GivePlayerMoney(playerid, 1000);
        TitoInfo[playerid][pDinheiro] = 1000;
        TitoInfo[playerid][pAdmin] = 0;
        TitoInfo[playerid][pScore] = 1;
        SetPlayerScore(playerid, 1);
        TitoInfo[playerid][pAviso] = 0;
        TitoInfo[playerid][pTut] = false;
        TitoInfo[playerid][Empresa] = false;
        SalvarConta(playerid);
        SpawnPlayer(playerid);
        format(String,sizeof(String),"Hello %s, you just desired record is level 1 & won $1000 in cash.",Nome);
        SendClientMessage(playerid, -1, String);
        format(String, sizeof(String),"{FFFFFF}Seja Bem Vindo ao Servidor, sua Conta e Registrada\nConta {01FCFF}%s{FFFFFF}, Digite sua senha para efutar o login:", Nome);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Servidor", String, "Logar", "Cancelar");
        return 1;
     }
     else
     {
        SendClientMessage(playerid, 0xFF0000AA, "Voce Foi Kickado!");
        Kick(playerid);
        return 1;
     }
   }
   if(dialogid == DIALOG_LOGIN)
   {
     if(response)
     {
        if(!strlen(inputtext))
        {
            new String[1000];
            GetPlayerName(playerid, Nome,sizeof(Nome));
            format(String, sizeof(String),"{FFFFFF}Seja Bem Vindo ao Servidor, sua Conta e Registrada\nConta {01FCFF}%s{FFFFFF}, Digite sua senha para efutar o login:", Nome);
            ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Servidor", String, "Logar", "Cancelar");
            SendClientMessage(playerid,0x1E90FFAA,"Senha Incorreta !");
            return 1;
        }
        new String[1000], str[200];
        GetPlayerName(playerid, Nome,sizeof(Nome));
        format(String, sizeof(String), "Contas/%s.ini", Nome);
        if(strcmp((inputtext), DOF2_GetString(String,"Senha"), true) == 0)
        {
            CarregarConta(playerid);
            SpawnPlayer(playerid);
            SendClientMessage(playerid, -1,"|---------------------------------------------------|");
            format(str,sizeof(str),"Seja Bem Vindo , %s .", Nome);
            SendClientMessage(playerid, -1, str);
            SendClientMessage(playerid, -1,"Servidor");
            SendClientMessage(playerid, -1,"|----------------------------------------------------|");
            format(str,sizeof(str),"~g~Seja Bem Vindo~n~ ~y~ %s", Nome);
            GameTextForPlayer(playerid, str, 2000, 1);
        }
        return 1;
     }
     else
     {
        SendClientMessage(playerid, 0xFF0000AA, "Voce Foi Kickado!");
        Kick(playerid);
        return 1;
     }
   }
   return true;
}
stock SalvarConta(playerid)
{
    new String[99];
    GetPlayerName(playerid, Nome,sizeof(Nome));
    format(String, sizeof(String), "Contas/%s.ini", Nome);

    DOF2_SetInt(String,  "Dinheiro", GetPlayerMoney(playerid));
    DOF2_SetInt(String,  "Banco", TitoInfo[playerid][pBank]);
    DOF2_SetInt(String,  "Score", GetPlayerScore(playerid));
    DOF2_SetInt(String,  "AdiminLevel", TitoInfo[playerid][pAdmin]);
    DOF2_SetInt(String,  "Emprego", TitoInfo[playerid][pJob]);
    DOF2_SetBool(String,  "Tutorial", TitoInfo[playerid][pTut]);
    DOF2_SetInt(String,  "Cash", TitoInfo[playerid][pCash]);
    DOF2_SetInt(String,  "Respeito", TitoInfo[playerid][pRespeito]);
    DOF2_SetBool(String,  "Empresa", TitoInfo[playerid][Empresa]);
    DOF2_SetInt(String,  "Aviso", TitoInfo[playerid][pAviso]);
    DOF2_SetInt(String,  "Skin", GetPlayerSkin(playerid));
    DOF2_SetBool(String,  "Indentidade", TitoInfo[playerid][Indentidade]);
    DOF2_SetInt(String,  "Drogas", TitoInfo[playerid][pDrogas]);
    DOF2_SetInt(String,  "Dinamite", TitoInfo[playerid][pDinamite]);
    DOF2_SaveFile();
    return 1;
}
stock CarregarConta(playerid)
{
    new String[99];
    GetPlayerName(playerid, Nome,sizeof(Nome));
    format(String, sizeof(String), "Contas/%s.ini", Nome);
    if(DOF2_FileExists(String))
    {
        TitoInfo[playerid][pDinheiro]  = DOF2_GetInt(String,   "Dinheiro");
        TitoInfo[playerid][pBank] = DOF2_GetInt(String,           "Banco");
        TitoInfo[playerid][pScore] = DOF2_GetInt(String,          "Score");
        TitoInfo[playerid][pAdmin] = DOF2_GetInt(String,    "AdiminLevel");
        TitoInfo[playerid][pJob] = DOF2_GetInt(String,          "Emprego");
        TitoInfo[playerid][pTut] = DOF2_GetBool(String,         "Tutorial");
        TitoInfo[playerid][pCash] = DOF2_GetInt(String,            "Cash");
        TitoInfo[playerid][pRespeito] = DOF2_GetInt(String,    "Respeito");
        TitoInfo[playerid][pAviso] = DOF2_GetInt(String,          "Aviso");
        TitoInfo[playerid][pSkin] =  DOF2_GetInt(String,  "Skin");
        TitoInfo[playerid][Empresa] = DOF2_GetBool(String,  "Empresa");
        TitoInfo[playerid][Indentidade] = DOF2_GetBool(String,  "Indentidade");
        TitoInfo[playerid][pDrogas] = DOF2_GetBool(String,  "Drogas");
        TitoInfo[playerid][pDinamite] = DOF2_GetInt(String,  "Dinamite");
    }
    return 1;
Ajeitei algumas coisa obvias e vou te deixar um alerta, tu ta usando muita cйlulas vei seu GM vai fica cagado, Olha vou dizendo nгo encontrei nenhum problema, o que eu ajeitei nгo resolverб seu problema foi somente um melhoramento, faзa um debug para descobrir o problema, pois ele nгo estб sendo encontrado visualmente...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)