[Ajuda] Nгo estб salvando 2 coisas quando dб gmx
#1

Por que depois que o servidor da gmx reseta tudo?

pawn Код:
stock salvardados(playerid)
{
    GetPlayerName(playerid,nick,24);
    format(pfile,sizeof pfile,contas,nick);
    DOF2_SetInt(pfile,"dinheiro",GetPVarInt(playerid,"dinheiro"));
    DOF2_SetInt(pfile,"level",GetPVarInt(playerid,"level"));
    DOF2_SetInt(pfile,"matou",GetPVarInt(playerid,"matou"));
    DOF2_SetInt(pfile,"morreu",GetPVarInt(playerid,"morreu"));
    DOF2_SetInt(pfile,"bombas",GetPVarInt(playerid,"bombas"));
    DOF2_SetInt(pfile,"adminlevel",GetPVarInt(playerid,"adminlevel"));
    DOF2_SaveFile();
    return 1;
}

stock carregardados(playerid)
{
    GetPlayerName(playerid,nick,24);
    format(pfile,sizeof pfile,contas,nick);
    SetPVarInt(playerid,"dinheiro",DOF2_GetInt(pfile,"dinheiro"));
    SetPVarInt(playerid,"level",DOF2_GetInt(pfile,"level"));
    SetPVarInt(playerid,"matou",DOF2_GetInt(pfile,"matou"));
    SetPVarInt(playerid,"morreu",DOF2_GetInt(pfile,"morreu"));
    SetPVarInt(playerid,"bombas",DOF2_GetInt(pfile,"bombas"));
    SetPVarInt(playerid,"adminlevel",DOF2_GetInt(pfile,"adminlevel"));
    return 1;
}
Reply
#2

Na public OnPlayerDisconnect vocк estб colocando a stock de salvar dados?

Ex:
pawn Код:
public OnPlayerDisconnect(...)
{
   salvardados(playerid);
   return 1;
}
Reply
#3

estб tudo lб!
Reply
#4

Procure um fs de registro em dof2 e sabera o motivo... й sу olhar em algum fs de registro com dof2 e faser em seu gamemode o mesmo sistema flw's
Reply
#5

Poxa vida, pq reseta a conta quando da gmx? estб tudo ok no salvardados...... mas que coisa estranha, ninguem pode me ajudar?

pawn Код:
stock salvardados(playerid)
{
    GetPlayerName(playerid,nick,24);
    format(pfile,sizeof pfile,contas,nick);
    DOF2_SetInt(pfile,"dinheiro",GetPlayerMoney(playerid));
    DOF2_SetInt(pfile,"level",GetPVarInt(playerid,"level"));
    DOF2_SetInt(pfile,"matou",GetPVarInt(playerid,"matou"));
    DOF2_SetInt(pfile,"morreu",GetPVarInt(playerid,"morreu"));
    DOF2_SetInt(pfile,"bombas",GetPVarInt(playerid,"bombas"));
    DOF2_SetInt(pfile,"adminlevel",info[playerid][pAdmin]);
    DOF2_SaveFile();
    return 1;
}

stock carregardados(playerid)
{
    GetPlayerName(playerid,nick,24);
    format(pfile,sizeof pfile,contas,nick);
    SetPVarInt(playerid,"dinheiro",DOF2_GetInt(pfile,"dinheiro"));
    SetPVarInt(playerid,"level",DOF2_GetInt(pfile,"level"));
    SetPVarInt(playerid,"matou",DOF2_GetInt(pfile,"matou"));
    SetPVarInt(playerid,"morreu",DOF2_GetInt(pfile,"morreu"));
    SetPVarInt(playerid,"bombas",DOF2_GetInt(pfile,"bombas"));
    SetPVarInt(playerid,"adminlevel",DOF2_GetInt(pfile,"adminlevel"));
    SetPlayerScore(playerid,GetPVarInt(playerid,"level"));
    GivePlayerMoney(playerid,GetPVarInt(playerid,"dinheiro"));
    info[playerid][pAdmin] = DOF2_GetInt(pfile,"adminlevel");
    return 1;
}

public OnGameModeExit()
{
    for(new i = 0; i < MAX_PLAYERS; ++i) { salvardados(i); }
    DOF2_Exit();
    return 1;
}

CMD:gmx(playerid,params[])
{
    if(info[playerid][pAdmin] >= 1)
    {
        format(string_,51,"O administrador %s deu GMX",nome(playerid));
        SendClientMessageToAll(-1,string_);
        SendRconCommand("gmx");
    }
    else SendClientMessage(playerid,-1,NAOADM);
    return 1;
}
Reply
#6

Teste aqui
pawn Код:
CMD:gmx(playerid,params[])
{
    if(info[playerid][pAdmin] >= 1)
    {
        format(string_,51,"O administrador %s deu GMX",nome(playerid));
        SendClientMessageToAll(-1,string_);
        SendRconCommand("gmx");
        salvardados(playerid);//aquiiiiiiiiiiiiiiiiiiii pra garantir
    }
    else SendClientMessage(playerid,-1,NAOADM);
    return 1;
}

Outra coisa coloque na Callback
OnPlayerDisconnect(playerid)....
{
salvardados(playerid);/aquiiiiiiiiiiiiii nгo em OnGameModeExit
return 1;
}

E testa vlw
Reply
#7

So uma observaзгo quando da gmx o Servidor volta a primeira configuraзгo feita manualmente.
por isso volta tudo como estava!
Reply
#8

Quote:
Originally Posted by Schocc
Посмотреть сообщение
Teste aqui
pawn Код:
CMD:gmx(playerid,params[])
{
    if(info[playerid][pAdmin] >= 1)
    {
        format(string_,51,"O administrador %s deu GMX",nome(playerid));
        SendClientMessageToAll(-1,string_);
        SendRconCommand("gmx");
        salvardados(playerid);//aquiiiiiiiiiiiiiiiiiiii pra garantir
    }
    else SendClientMessage(playerid,-1,NAOADM);
    return 1;
}

Outra coisa coloque na Callback
OnPlayerDisconnect(playerid)....
{
salvardados(playerid);/aquiiiiiiiiiiiiii nгo em OnGameModeExit
return 1;
}

E testa vlw
ja tentei e nao foi

Quote:
Originally Posted by Dracocard
Посмотреть сообщение
So uma observaзгo quando da gmx o Servidor volta a primeira configuraзгo feita manualmente.
por isso volta tudo como estava!
Entгo o meu erro foi colocar salvardados(i); na public OnGameMode exit, pq eu dei gmx e foi. Obrigado! (:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)