28.07.2015, 04:03
PHP код:
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;
}