PlayerInfo[playerid][pSenha] = DOF2_GetInt(arquivo, "Senha");
if(strval(inputtext) == PlayerInfo[playerid][pSenha])
{
SetarPlayer(playerid);
PlayerInfo[playerid][pLogou]++;
SpawnPlayer(playerid);
}
SetarPlayer(playerid)
{
new String[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, 32);
format(String, 40, "Contas/%s.ini", name);
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
GivePlayerMoney(playerid, PlayerInfo[playerid][pDinheiro]);
PlayerInfo[playerid][pScore] = DOF2_GetInt(String,"Level");
PlayerInfo[playerid][pDinheiro] = DOF2_GetInt(String,"Dinheiro");
PlayerInfo[playerid][pLogou] = DOF2_GetInt(String, "Logou");
PlayerInfo[playerid][pMatou] = DOF2_GetInt(String, "Matou");
PlayerInfo[playerid][pMorreu] = DOF2_GetInt(String, "Morreu");
DOF2_SaveFile();
return 1;
}
|
public OnPlayerDisconnect(playerid, reason) |
|
Sim, salva tudo certinho: Level, Dinheiro, Matou, Morreu e Logou.
Quando volta ao servidor sу seta in-game as seguintes info: matou, morreu e logou; Ja Level e Dinheiro zeram e comeзam do 0 novamente. |
SetarPlayer(playerid)
{
new String[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, 32);
format(String, 40, "Contas/%s.ini", name);
GetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
GetPlayerMoney(playerid, PlayerInfo[playerid][pDinheiro]);
PlayerInfo[playerid][pScore] = DOF2_GetInt(String,"Level");
PlayerInfo[playerid][pDinheiro] = DOF2_GetInt(String,"Dinheiro");
PlayerInfo[playerid][pLogou] = DOF2_GetInt(String, "Logou");
PlayerInfo[playerid][pMatou] = DOF2_GetInt(String, "Matou");
PlayerInfo[playerid][pMorreu] = DOF2_GetInt(String, "Morreu");
DOF2_SaveFile();
return 1;
}
|
muda esse stock para essa
Код:
SetarPlayer(playerid)
{
new String[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, 32);
format(String, 40, "Contas/%s.ini", name);
GetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
GetPlayerMoney(playerid, PlayerInfo[playerid][pDinheiro]);
PlayerInfo[playerid][pScore] = DOF2_GetInt(String,"Level");
PlayerInfo[playerid][pDinheiro] = DOF2_GetInt(String,"Dinheiro");
PlayerInfo[playerid][pLogou] = DOF2_GetInt(String, "Logou");
PlayerInfo[playerid][pMatou] = DOF2_GetInt(String, "Matou");
PlayerInfo[playerid][pMorreu] = DOF2_GetInt(String, "Morreu");
DOF2_SaveFile();
return 1;
}
|
|
Porque vc cria uma string com 256 cйlulas e depois formata ela com sу 40 ? O.o
|
GetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
GetPlayerMoney(playerid, PlayerInfo[playerid][pDinheiro]);
SetarPlayer(playerid)
{
new String[70], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, 32);
format(String, 70, "Contas/%s.ini", name);
PlayerInfo[playerid][pScore] = DOF2_GetInt(String,"Level");
PlayerInfo[playerid][pDinheiro] = DOF2_GetInt(String,"Dinheiro");
PlayerInfo[playerid][pLogou] = DOF2_GetInt(String, "Logou");
PlayerInfo[playerid][pMatou] = DOF2_GetInt(String, "Matou");
PlayerInfo[playerid][pMorreu] = DOF2_GetInt(String, "Morreu");
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
GivePlayerMoney(playerid, PlayerInfo[playerid][pDinheiro]);
return 1;
}