[Ajuda] Salva Dados do player
#1

Bom galera estou editando uma gm e estou tentando por para Cada conta salva o uiltimo login efeituado e nгo estou conseguindo alguйm pode me ajuda-lo pfv

PHP код:
new    Hora[MAX_PLAYERS];
new 
Minuto[MAX_PLAYERS];
new 
Ano[MAX_PLAYERS];
new 
Mes[MAX_PLAYERS];
new 
Dia[MAX_PLAYERS]; 
PHP код:
stock CriarConta(playerid,password[])
{
    new 
arq[36];
    
format(arq,36,"/acc/%s.ini",GetName(playerid));
    
DOF2_CreateFile(arq,password);
    
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,"Wins",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);
    
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,password[])
{
    new 
arq[36];
    
format(arq,36,"/acc/%s.ini",GetName(playerid));
    if(
DOF2_CheckLogin(arq,password))
    {
        
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);
        
DOF2_SetInt(arq"Minuto",  Minuto[playerid]);
        
DOF2_SetInt(arq"Hora"Hora[playerid]);
        
DOF2_SetInt(arq"Dia"Dia[playerid]);
        
DOF2_SetInt(arq"Mкs"Mes[playerid]);
        
DOF2_SetInt(arq"Ano"Ano[playerid]);
        new 
ip[16];
        
GetPlayerIp(playerid,ip,16);
        
DOF2_SetString(arq,"IP",ip);
        
DOF2_SaveFile();
        
skine[playerid] = DOF2_GetInt(arq,"Skin");
        
Logado[playerid] = true;
        new 
welcome[150];
        
format(welcome,150,"{962020}(INFO) Novo Player: {FFFFFF}%s {FFFF00}ID:{FFFFFF} %d {FFFF00}Logins: {FFFFFF}%d $d/%d/%d $d",GetName(playerid),playerid,DOF2_GetInt(arq,"Dia"), playerid,DOF2_GetInt(arq,"Mкs"), playerid,DOF2_GetInt(arq,"Ano"), playerid,DOF2_GetInt(arq,"Logins"));
        
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,"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]);
    
DOF2_SetInt(arq"Minuto",  Minuto[playerid]);
    
DOF2_SetInt(arq"Hora"Hora[playerid]);
    
DOF2_SetInt(arq"Dia"Dia[playerid]);
    
DOF2_SetInt(arq"Mкs"Mes[playerid]);
    
DOF2_SetInt(arq"Ano"Ano[playerid]);
    new 
ip[16];
    
GetPlayerIp(playerid,ip,sizeof ip);
    
DOF2_SetString(arq,"IP",ip);
    
DOF2_SaveFile();

Reply
#2

Bom nгo tem segredo:


PHP код:
new dia[MAX_PLAYERS];
new 
mes[MAX_PLAYERS];
new 
ano[MAX_PLAYERS];
new 
hora[MAX_PLAYERS];
new 
minuto[MAX_PLAYERS];
new 
segundo[MAX_PLAYERS];
// em onplayerconnect, vamos salvar nas variaveis quando ele logou a ultima vez.
getdate(ano[playerid],mes[playerid],dia[playerid]);
gettime(hora[playerid], minuto[playerid], segundo[playerid]);
// agora vamos falar ao player quando ele logou da ultima vez
new string[128];
format(string128"Ultimo login: %02d/%02d/%04d  as %02d:%02d"DOF2_GetInt(arq"dia"),DOF2_GetInt(arq"mes"),DOF2_GetInt(arq"ano"),DOF2_GetInt(arq"hora"),DOF2_GetInt(arq"minuto") );
SendClientMessage(playerid, -1string);
// pronto, depois que vc ja falou a ultima vez que ele logou, vai salvar esse ultimo login dele.
DOF2_SetInt(arq,"dia",dia[playerid]);
DOF2_SetInt(arq,"mes",mes[playerid]);
DOF2_SetInt(arq,"ano",ano[playerid]);
DOF2_SetInt(arq,"hora",hora[playerid]);
DOF2_SetInt(arq,"minuto",minuto[playerid]);
DOF2_SetInt(arq,"segundo",segundo[playerid]);
DOF2_SaveFile(); 
Reply
#3

Quote:
Originally Posted by Andinho
Посмотреть сообщение
Bom nгo tem segredo:


PHP код:
new dia[MAX_PLAYERS];
new 
mes[MAX_PLAYERS];
new 
ano[MAX_PLAYERS];
new 
hora[MAX_PLAYERS];
new 
minuto[MAX_PLAYERS];
new 
segundo[MAX_PLAYERS];
// em onplayerconnect, vamos salvar nas variaveis quando ele logou a ultima vez.
getdate(ano[playerid],mes[playerid],dia[playerid]);
gettime(hora[playerid], minuto[playerid], segundo[playerid]);
// agora vamos falar ao player quando ele logou da ultima vez
new string[128];
format(string128"Ultimo login: %02d/%02d/%04d  as %02d:%02d"DOF2_GetInt(arq"dia"),DOF2_GetInt(arq"mes"),DOF2_GetInt(arq"ano"),DOF2_GetInt(arq"hora"),DOF2_GetInt(arq"minuto") );
SendClientMessage(playerid, -1string);
// pronto, depois que vc ja falou a ultima vez que ele logou, vai salvar esse ultimo login dele.
DOF2_SetInt(arq,"dia",dia[playerid]);
DOF2_SetInt(arq,"mes",mes[playerid]);
DOF2_SetInt(arq,"ano",ano[playerid]);
DOF2_SetInt(arq,"hora",hora[playerid]);
DOF2_SetInt(arq,"minuto",minuto[playerid]);
DOF2_SetInt(arq,"segundo",segundo[playerid]);
DOF2_SaveFile(); 
se eu por asim sera que vai da erro ou tenho q usa uma else
PHP код:
new welcome[150];
format(string128"{962020}(INFO) Vocк logou pela ъltima vez em {962020} %02d/%02d/%04d %02d:%02d");
format(string128"Seja bem vindo ou servidor "); 
Reply
#4

Bom, й sу fazer o teste nй rsrs ..
Reply
#5

DEU esse erro
Reply
#6

essas variaveis que eu criei, nгo sгo iguais as suas, use suas variaveis, e quando for salvar em dof2, sempre coloque o mesmo, eu observei que la em cima esta "minuto" la em baixo "Minuto".
Reply
#7

Quote:
Originally Posted by Andinho
Посмотреть сообщение
essas variaveis que eu criei, nгo sгo iguais as suas, use suas variaveis, e quando for salvar em dof2, sempre coloque o mesmo, eu observei que la em cima esta "minuto" la em baixo "Minuto".
Continua dando o msm erro
Reply
#8

Bom o comando Funcionou mas nгo esta salvando o DIA/MЙS/ANO HORA:MINUTOS:Segundos
Reply
#9

Quote:
Originally Posted by henriqueTL
Посмотреть сообщение
Bom o comando Funcionou mas nгo esta salvando o DIA/MЙS/ANO HORA:MINUTOS:Segundos


ALGUЙM PRA ME AJUDA-LO ??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)