SA-MP Forums Archive
[Ajuda] Score nao salva - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Score nao salva (/showthread.php?tid=361711)



Score nao salva - IgorMendes - 21.07.2012

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


Re: Score nao salva - _.MeT4L._ - 21.07.2012

//ERRADO

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


CERTO
DOF2_SetInt(PlayerArchive(playerid), "Score", GetPlayerScore(playerid));


Re: Score nao salva - IgorMendes - 22.07.2012

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


Re: Score nao salva - F_Cinco - 22.07.2012

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


Re: Score nao salva - Don_Speed - 22.07.2012

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;
}