PHP код:
//------------------------------------------------------------------------------//
stock CriarConta(playerid)
{
new arq [36];
format(arq,36,"/acc/%s.ini",GetName(playerid));
DOF2_CreateFile(arq);
DOF2_SetString(arq,"Senha", inputtext);
DOF2_SetInt(arq,"Admin",0);
DOF2_SetInt(arq,"Skin",0);
DOF2_SetInt(arq,"Matou",0);
DOF2_SetInt(arq,"Morreu",0);
DOF2_SetInt(arq,"Clan",0);
DOF2_SetInt(arq,"Recorde",0);
DOF2_SetInt(arq,"RecordeSpree",0);
DOF2_SetInt(arq,"Losses",0);
DOF2_SetInt(arq, "Ano", 0);
DOF2_SetInt(arq, "Mкs", 0);
DOF2_SetInt(arq, "Dia", 0);
DOF2_SetInt(arq, "Hora", 0);
DOF2_SetInt(arq, "Minuto", 0);
new year,day,month;
getdate(year, month, day);
new str[32];
format(str, 32,"%02d/%02d/%d",day,month,year);
DOF2_SetString(arq,"RegisterDate",str);
DOF2_SaveFile();
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Seja bem vindo","{22FF22}Sua conta foi criada!\nDigite sua senha para continuar!","Login","Sair");
}
stock CarregarConta(playerid)
{
new arq [36];
format(arq,36,"/acc/%s.ini",GetName(playerid));
Player[playerid][matou] = 0;
Player[playerid][morreu] = 0;
Player[playerid][admin] = 0;
Recorde[playerid] = 0;
Player[playerid][wins] = 0;
Player[playerid][losses] = 0;
RecordeSpree[playerid] = 0;
SetPlayerScore(playerid,0);
Player[playerid][wins] = DOF2_GetInt(arq,"Wins");
Player[playerid][losses] = DOF2_GetInt(arq,"Losses");
Recorde[playerid] = DOF2_GetInt(arq,"Recorde");
RecordeSpree[playerid] = DOF2_GetInt(arq,"RecordeSpree");
Player[playerid][matou] = DOF2_GetInt(arq,"Matou");
Player[playerid][morreu] = DOF2_GetInt(arq,"Morreu");
Player[playerid][admin] = DOF2_GetInt(arq,"Admin");
HudColor[playerid] = DOF2_GetInt(arq,"HUD");
SetPlayerScore(playerid,DOF2_GetInt(arq,"Score"));
DOF2_SetInt(arq,"Logins",DOF2_GetInt(arq,"Logins") + 1);
new ip[16];
GetPlayerIp(playerid,ip,16);
DOF2_SetString(arq,"IP",ip);
DOF2_SaveFile();
skine[playerid] = DOF2_GetInt(arq,"Skin");
Logado[playerid] = true;
format(welcome, sizeof(welcome), "{FFFFFF}(ONLINE):{B22222}%s{FFFFFF}ID:[%s]entrou no servidor Para mata uns noobґs.",GetName(playerid),playerid,DOF2_GetInt(arq,"Logins"));
SendClientMessageToAll(verde, welcome);
format(welcome, sizeof(welcome), "{962020}(INFO) {FFFFFF}Vocк logou pela ъltima vez em {962020} %02d/%02d/%04d %02d:%02d", DOF2_GetInt(arq, "Dia"),DOF2_GetInt(arq, "Mes"),DOF2_GetInt(arq, "Ano"),DOF2_GetInt(arq, "Hora"),DOF2_GetInt(arq, "Minuto"));
SendClientMessageToAll(verde, welcome);
Atualizar(playerid,HudColor[playerid]);
SpawnPlayer(playerid);
}
else ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Seja bem vindo!","{FF2222}Senha incorreta! For favor tente novamente...","Login","Sair");
}
//------------------------------------------------------------------------------//
stock SalvarConta(playerid)
{
new arq [36];
format(arq,sizeof arq,"/acc/%s.ini",GetName(playerid));
DOF2_SetInt(arq,"Senha",Player[playerid][senha]);
DOF2_SetInt(arq,"Matou",Player[playerid][matou]);
DOF2_SetInt(arq,"Morreu",Player[playerid][morreu]);
DOF2_SetInt(arq,"Admin",Player[playerid][admin]);
DOF2_SetInt(arq,"Skin",skine[playerid]);
DOF2_SetInt(arq,"Wins",Player[playerid][wins]);
DOF2_SetInt(arq,"Losses",Player[playerid][losses]);
DOF2_SetInt(arq,"RecordeSpree",RecordeSpree[playerid]);
DOF2_SetInt(arq,"Recorde",Recorde[playerid]);
DOF2_SetInt(arq,"Score",GetPlayerScore(playerid));
DOF2_SetInt(arq,"HUD",HudColor[playerid]);
new ip[16];
GetPlayerIp(playerid,ip,sizeof ip);
DOF2_SetString(arq,"IP",ip);
DOF2_SaveFile();
}
//------------------------------------------------------------------------------//