21.07.2012, 23:57
Entгo, meu Score nгo ta salvando
й isso, espero que me ajudem
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;
}