05.07.2018, 00:57
(
Последний раз редактировалось BrGabrielBr; 05.07.2018 в 03:52.
)
@@CLOSED.
SavePlayer(playerid)
{
if( DOF2_FileExists(PegarConta(playerid)))
{
DOF2_CreateFile(PegarConta(playerid));
DOF2_SetInt(PegarConta(playerid), "Skin", Player[playerid][Skin]);
DOF2_SetInt(PegarConta(playerid), "Score", Player[playerid][Score]);
DOF2_SetInt(PegarConta(playerid), "Matou", Player[playerid][Matou]);
DOF2_SetInt(PegarConta(playerid), "Morreu", Player[playerid][Morreu]);
DOF2_SetInt(PegarConta(playerid), "Faccoes", Player[playerid][Faccoes]);
DOF2_SetInt(PegarConta(playerid), "Morro", Player[playerid][Morro]);
DOF2_SetInt(PegarConta(playerid), "Cargo", Player[playerid][Cargo]);
DOF2_SetInt(PegarConta(playerid), "Dinheiro", GetPlayerMoney(playerid));
DOF2_SetInt(PegarConta(playerid), "Admin", Player[playerid][Admin]);
DOF2_SaveFile();
}
return 1;
}
Й porque estб a usar a funзгo SavePlayer em algum lugar antes da conta ser carregada.
|
public OnPlayerDisconnect(playerid, reason)
{
TextDrawHideForPlayer(playerid, DataC), TextDrawHideForPlayer(playerid, HoraC);
//
SavePlayer(playerid);
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
SalvarPlayer(i);
}
SavePlayer(playerid)
{
if( DOF2_FileExists(PegarConta(playerid)))
{
DOF2_SetInt(PegarConta(playerid), "Skin", Player[playerid][Skin]);
DOF2_SetInt(PegarConta(playerid), "Score", Player[playerid][Score]);
DOF2_SetInt(PegarConta(playerid), "Matou", Player[playerid][Matou]);
DOF2_SetInt(PegarConta(playerid), "Morreu", Player[playerid][Morreu]);
DOF2_SetInt(PegarConta(playerid), "Faccoes", Player[playerid][Faccoes]);
DOF2_SetInt(PegarConta(playerid), "Morro", Player[playerid][Morro]);
DOF2_SetInt(PegarConta(playerid), "Cargo", Player[playerid][Cargo]);
DOF2_SetInt(PegarConta(playerid), "Dinheiro", GetPlayerMoney(playerid));
DOF2_SetInt(PegarConta(playerid), "Admin", Player[playerid][Admin]);
DOF2_SaveFile();
}
return 1;
}
n sei se vai da certo mais coloca na OnGameModeExit:
PHP код:
PHP код:
|
Player[playerid][Admin] = DOF2::GetInt(PegarContas(playerid), "Admin");
if(dialogid == DIALOG_REGISTER)
{
if(response)
{
if(strlen(inputtext) < 5 || strlen(inputtext) > 20 || !strlen(inputtext))
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COLORT_WHITE"• "#COLORT_SERVER"REGISTRO"COLORT_WHITE":", ""#COLORT_WHITE"Sua senha deve ter no minimo 5 digitos ou nъmeros!\n"#COLORT_WHITE"Й no Mбximo 20 digitos ou nъmero!\n"#COLORT_WHITE"Tente novamente.", "Registrar", "Sair");
}
else
{
//---------- [ Criar Arquivos й colocar valores ] --------------
DOF2_CreateFile(PegarConta(playerid));
DOF2_SetString(PegarConta(playerid),"Senha", inputtext);
DOF2_SetInt(PegarConta(playerid),"Score", 0);
DOF2_SetInt(PegarConta(playerid),"Matou", 0);
DOF2_SetInt(PegarConta(playerid),"Morreu", 0);
DOF2_SetInt(PegarConta(playerid),"Skin", 1);
DOF2_SetInt(PegarConta(playerid),"Dinheiro", 0);
DOF2_SetInt(PegarConta(playerid), "Admin", 0);
DOF2_SaveFile();
//
GivePlayerMoney(playerid,30000);
SCM(playerid, COLOR_PRINCIPAL, ""TAG_SERVER" Registrado Com sucesso.");
ShowPlayerDialog(playerid, DIALOG_MORROS, DIALOG_STYLE_LIST, ""COLORT_WHITE"» "COLORT_SERVER"Escolha sua comunidade para poder continuar:", ""#COLORT_RED"CMD\n"#COLORT_BLUE"LLL\n"#COLORT_YELLOW"TD3\n"#COLORT_ORANGE"MLC\n"#COLORT_WHITE"Organizaзхes", "Selecionar", "");
}
}
if(!response)
{
SCM(playerid, COLOR_HELPER, ""TAG_LOG" Vocк foi kickado, volte sempre!");
Kick(playerid);
}
}
Vк se o seu:
LoadPlayer(playerid); se ta +/- assim: PHP код:
PHP код:
|
LoadPlayer(playerid)
{
if( DOF2_FileExists(PegarConta(playerid)))
{
DOF2_SetInt(PegarConta(playerid), "Senha", Player[playerid][Senha]);
DOF2_SetInt(PegarConta(playerid), "Skin", Player[playerid][Skin]);
DOF2_SetInt(PegarConta(playerid), "Score", Player[playerid][Score]);
DOF2_SetInt(PegarConta(playerid), "Dinheiro", Player[playerid][Dinheiro]);
DOF2_SetInt(PegarConta(playerid), "Admin", Player[playerid][Admin]);
DOF2_SetInt(PegarConta(playerid), "Faccoes", Player[playerid][Faccoes]);
DOF2_SetInt(PegarConta(playerid), "Morro", Player[playerid][Morro]);
DOF2_SetInt(PegarConta(playerid), "Cargo", Player[playerid][Cargo]);
DOF2_SetInt(PegarConta(playerid), "Morreu", Player[playerid][Matou]);
DOF2_SetInt(PegarConta(playerid), "Morreu", Player[playerid][Morreu]);
//
SetPlayerScore(playerid, Player[playerid][Score]);
GivePlayerMoney(playerid, Player[playerid] [Dinheiro]);
SetPlayerSkin(playerid, Player[playerid][Skin]);
}
return 1;
}
Player[playerid][Faccoes] = DOF2::GetInt(PegarConta(playerid), "Faccoes");
Player[playerid][Score] = DOF2::GetInt(PegarConta(playerid), "Score");