28.07.2015, 02:58
Qual Voceis Prefem Para Salvar
Dini Ou Dof2
Dini Ou Dof2
public OnGameModeExit()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SalvarPlayer(i);
}
}
DOF2_Exit();
return 1;
}
Mais o DOF2 Tem Varios BUG Tipo oq ta acontecendo CMG QUANDO EU FECHO Sv pelo Samp-Server ele reseta as contas ;/
|
PHP код:
|
public OnPlayerDisconnect(playerid, reason)
{
SalvarPlayer(playerid);
return 1;
}
public OnGameModeExit()
{
for(new i = 0; i < MAX_PLAYERS; i++) SalvarPlayer(i);
DOF2_Exit();
return 1;
}
SalvarPlayer(playerid)
{
DOF2_SaveFile(); //Coloque no Final
return 1;
}
public OnPlayerDisconnect(playerid)
{
if(msgconvi[playerid] == 1)
{
KillTimer(timercou[playerid]);
}
msgcount[playerid] = -1;
msgconvi[playerid] = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SalvarPlayer(i);
}
}
return 1;
}
public OnGameModeExit()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SalvarPlayer(i);
}
}
DOF2_Exit();
return 1;
}
stock SalvarPlayer(playerid)
{
GetPlayerName(playerid, Nome, sizeof(Nome));
format(String, sizeof(String), CONTAS, Nome);
DOF2::SetInt(String,"Dinheiro", GetPlayerMoney(playerid));
DOF2::SetInt(String, "Matou", pInfo[playerid][Matou]);
DOF2::SetInt(String, "Morreu", pInfo[playerid][Morreu]);
DOF2::SetInt(String, "Score", GetPlayerScore(playerid));
DOF2::SetInt(String, "Admin", pInfo[playerid][pAdmin]);
DOF2::SaveFile();
return true;
}