05.11.2017, 02:11
PHP код:
public OnGameModeExit()
{
for(new i = 0; i < MAX_PLAYERS; i++) SalvarPlayer(i);//Quando o server desligar ele ira salvar os dados dos playes
DOF2::Exit();
return 1;
}
PHP код:
stock SalvarPlayer(playerid)
{
GetPlayerName(playerid, Nome, sizeof(Nome));
format(String, sizeof(String), CONTAS, Nome);
GetPlayerHealth(playerid,Vida[playerid]);
GetPlayerArmour(playerid,Colete[playerid]);
getdate(Ano[playerid], Mes[playerid], Dia[playerid]), gettime(Hora[playerid], Minuto[playerid], Segundo[playerid]);
DOF2::SetInt(String,"Dinheiro", GetPlayerMoney(playerid));
Vida[playerid] = DOF2_SetFloat(String, "Vida",Vida[playerid]);
Colete[playerid] = DOF2_SetFloat(String, "Colete",Colete[playerid]);
DOF2::SetInt(String,"Level", GetPlayerScore(playerid));
winsr[playerid] = DOF2::SetInt(String,"Wins Race", winsr[playerid]);
Admin[playerid] = DOF2::SetInt(String,"Admin", Admin[playerid]);
DOF2::SetInt(String,"Skin", GetPlayerSkin(playerid));
DOF2::SetInt(String,"Matou", Matou[playerid]);
DOF2::SetInt(String,"Morreu", Morreu[playerid]);
DOF2::SetInt(String,"Logou", Logou[playerid]);
DOF2::SetInt(String, "Segundo", Segundo[playerid]);
DOF2::SetInt(String, "Minuto", Minuto[playerid]);
DOF2::SetInt(String, "Hora", Hora[playerid]);
DOF2::SetInt(String, "Dia", Dia[playerid]);
DOF2::SetInt(String, "Mкs", Mes[playerid]);
DOF2::SetInt(String, "Ano", Ano[playerid]);
DOF2::SaveFile();
return true;
}