[Ajuda] Skin nгo estб sendo salvo, por que?
#1

Olб.

De uma hora para outra o meu sistema parou de salvar o skin do jogador, e pelo que vejo no cуdigo, nгo б motivo.

pawn Код:
stock SavePlayerInfo(playerid)
{
    new s[36];
    format(s, sizeof(s), "Contas/%s.ini", pNick(playerid));

    dini_IntSet(s, "Dinheiro", GetPlayerMoney(playerid));
    dini_IntSet(s, "LeveldeProcurado", GetPlayerWantedLevel(playerid));
    dini_IntSet(s, "SkinAtual", GetPlayerSkin(playerid));
    dini_IntSet(s, "Profissao", Profissao[playerid]);
    dini_IntSet(s, "Level", GetPlayerScore(playerid));
    dini_IntSet(s, "ExpJogador", Experiencia[playerid]);
    dini_IntSet(s, "Gasolina", gss[playerid]);
    return 1;
}
pawn Код:
stock LoadPlayerInfo(playerid)
{
    new s[36];
    format(s, sizeof(s), "Contas/%s.ini", pNick(playerid));

    SetPlayerWantedLevel(playerid, dini_Int(s, "LeveldeProcurado"));
    GivePlayerMoney(playerid, dini_Int(s, "Dinheiro"));
    Profissao[playerid] = dini_Int(s, "Profissao");
    pLevel[playerid] = dini_Int(s, "Level");
    SetPlayerScore(playerid, dini_Int(s, "Level"));
    Experiencia[playerid] = dini_Int(s, "ExpJogador");
    gss[playerid] = dini_Int(s, "Gasolina");
   
    SetSpawnInfo(playerid, 0, -1, 1109.4899,-1786.4772,16.5938, 269.15, -1, -1, -1, -1, -1, -1);
    return 1;
}
Reply
#2

Nгo tem nada aн que carregue a skin ...
Reply
#3

Desculpe, esqueci dб callback

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SpawnPlayer(playerid);
   
    new s[36];
    format(s, sizeof(s), "Contas/%s.ini", pNick(playerid));
    SetPlayerSkin(playerid, dini_Int(s, "SkinAtual"));
    return 1;
}
Ele carrega normalmente, mas, na hora de salva seta o SkinAtual para 0.
Reply
#4

A Parte do carregamento vem depois do RequestClass?

Coloque:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    LoadPlayerInfo(playerid);
    SpawnPlayer(playerid);
    new s[36];
    format(s, sizeof(s), "Contas/%s.ini", pNick(playerid));
    SetPlayerSkin(playerid, dini_Int(s, "SkinAtual"));
    return 1;
}
Reply
#5

Richard, nгo deu certo.

Acredito que sejб algo na hora de salvar, pois ele carrega e seta o skin no jogador, mas quando й salvo os dados do jogador o SkinAtual й setado para 0, ao invйz do ID do skin do player.

pawn Код:
if(dialogid == D_Logar)
    {
        if(!response) return Kick(playerid);
        if(!strcmp(inputtext, dini_Get(arquivo, "Pwd")))
        {
            SpawnPlayer(playerid);
            LoadPlayerInfo(playerid);
            new String[128];
            format(String, sizeof(String), "| INFO | Olб %s, seus dados foram carregados com sucesso", pNick(playerid));
            SendClientMessage(playerid, CINFO, String);
        }
        else return Kick(playerid);
    }
    if(dialogid == D_Registro)
    {
        if(!response) return Kick(playerid);
        dini_Create(arquivo);
        dini_Set(arquivo, "Pwd", inputtext);
        SetPlayerSetup(playerid);
    }
Reply
#6

pawn Код:
stock LoadPlayerInfo(playerid)
{
    new s[36];
    format(s, sizeof(s), "Contas/%s.ini", pNick(playerid));

    SetPlayerWantedLevel(playerid, dini_Int(s, "LeveldeProcurado"));
    GivePlayerMoney(playerid, dini_Int(s, "Dinheiro"));
    Profissao[playerid] = dini_Int(s, "Profissao");
    pLevel[playerid] = dini_Int(s, "Level");
    SetPlayerScore(playerid, dini_Int(s, "Level"));
    Experiencia[playerid] = dini_Int(s, "ExpJogador");
    gss[playerid] = dini_Int(s, "Gasolina");

    SetSpawnInfo(playerid, 0, dini_Int(s, "SkinAtual"), 1109.4899,-1786.4772,16.5938, 269.15, -1, -1, -1, -1, -1, -1);

    return 1;
}
Reply
#7

Continua com o bug..
Reply
#8

pawn Код:
//OnPlayerSpawn
new s[36];
format(s, sizeof(s), "Contas/%s.ini", pNick(playerid));
SetPlayerSkin(playerid, dini_Int(s, "SkinAtual"));
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)