[Ajuda] Score nao salva
#1

Entгo, meu Score nгo ta salvando

pawn Code:
stock Carregando(playerid)
{
    GivePlayerMoney(playerid, DOF2_GetInt(PlayerArchive(playerid), "Money"));
    PlayerInfo[playerid][pScore] = DOF2_GetInt(PlayerArchive(playerid), "Score");
    PlayerInfo[playerid][pKills] = DOF2_GetInt(PlayerArchive(playerid), "Kills");
    PlayerInfo[playerid][pDeath] = DOF2_GetInt(PlayerArchive(playerid), "Morreu");
}

stock Salvando(playerid)
{
    DOF2_SetInt(PlayerArchive(playerid), "Money", GetPlayerMoney(playerid));
    DOF2_SetInt(PlayerArchive(playerid), "Score", GetpScore(playerid));
    DOF2_SetInt(PlayerArchive(playerid), "Kills", PlayerInfo[playerid][pKills]);
    DOF2_SetInt(PlayerArchive(playerid), "Morreu", PlayerInfo[playerid][pDeath]);
    DOF2_SaveFile();
    return 1;
}

pawn Code:
//OnPlayerConnect
    PlayerInfo[playerid][pScore] = 0;
    PlayerInfo[playerid][pDeaths] = 0;
    PlayerInfo[playerid][pKills] = 0;
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    PlayerInfo[playerid][pDeaths]++;
    PlayerInfo[killerid][pKills]++;
    SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
    SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
    PlayerInfo[killerid][pScore]++;
    return 1;
}
й isso, espero que me ajudem
Reply
#2

//ERRADO

DOF2_SetInt(PlayerArchive(playerid), "Score", GetpScore(playerid));


CERTO
DOF2_SetInt(PlayerArchive(playerid), "Score", GetPlayerScore(playerid));
Reply
#3

Isso foi erro meu, Sorry :\
Na Hora de copiar.
Entгo nгo й esse o erro.
Reply
#4

kk, copiou do FS de Administraзгo do Funeral. '-'
Reply
#5

Tenta assim
pawn Code:
stock Carregando(playerid)
{
    GivePlayerMoney(playerid, DOF2_GetInt(PlayerArchive(playerid), "Money"));
    PlayerInfo[playerid][pScore] = DOF2_GetInt(PlayerArchive(playerid), "Score");
    PlayerInfo[playerid][pKills] = DOF2_GetInt(PlayerArchive(playerid), "Kills");
    PlayerInfo[playerid][pDeath] = DOF2_GetInt(PlayerArchive(playerid), "Morreu");
    PlayerInfo[playerid][pScore] = GetPlayerScore(playerid);
    return true;
}
stock Salvando(playerid)
{
    DOF2_SetInt(PlayerArchive(playerid), "Money", GetPlayerMoney(playerid));
    DOF2_SetInt(PlayerArchive(playerid), "Score", PlayerInfo[playerid][pScore]);
    DOF2_SetInt(PlayerArchive(playerid), "Kills", PlayerInfo[playerid][pKills]);
    DOF2_SetInt(PlayerArchive(playerid), "Morreu", PlayerInfo[playerid][pDeath]);
    DOF2_SaveFile();
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)