[Ajuda] Como salvar essas tabelas no MySQL?
#4

PHP код:
forward OnPlayerLogin(playeridSenha);
public 
OnPlayerLogin(playeridSenha)
{
    new 
rowfield;
    
cache_get_data(rowfieldConnect);
    if(
rowShowPlayerDialog(playerid0DIALOG_STYLE_INPUT"Login""Digite sua senha""Logar""Sair");
    
ShowPlayerDialog(playerid1DIALOG_STYLE_INPUT"Registro""Digite sua senha""Registrar""Sair");
    return 
1;
}

public 
OnPlayerSpawn(playerid)
{
    new 
Str[58];
    new 
nomeplayer[21];
    
GetPlayerName(playeridnomeplayer20);
    
format(Str58"SELECT * FROM `Contas` WHERE `Nome`='%s'"nomeplayer);
    
mysql_query(ConnectStrtrue"OnPlayerLogin""i"playerid);
    return 
1;

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid)   {
    new 
Str[300], nomeplayer[21];
    
GetPlayerName(playeridnomeplayer20);
    
format(Str300"SELECT *FROM `Contas` WHERE `Nome`='%s' AND `Senha`='%i')"nomeplayerHash(inputtext));
    
mysql_query(ConnectStr);
    
SendClientMessage(playerid, -1"Registrado com sucesso.");
    }
    else{
    new 
Str[300], nomeplayer[21], FloatXFloatYFloatZ;
    
GetPlayerName(playeridnomeplayer20);
    
GetPlayerPos(playeridXYZ);
    
format(Str300"INSERT INTO `Contas`(`Nome`, `Senha`, `Level`, `Admin`, `Respeito`, `Org`, `Membro`, `X`, `Y`, `Z`) VALUES ('%s', '%i', '10', '%i', '%i', '%i', '%i', '%f', '%f', '%f')"nomeplayerHash(inputtext), 10815021XYZ);
    
mysql_query(ConnectStrtrue"AposVerificarLogin""i"playerid);
    return 
1;
}

forward AposVerificarLogin(playerid);
public 
AposVerificarLogin(playerid)
{
    new 
rowfield;
    
cache_get_data(rowfieldConnect);
    if(
rowSendClientMessage(playerid, -1"Logado com Sucesso!");
    } else { 
ShowPlayerDialog(playerid0DIALOG_STYLE_INPUT"Login""Senha Incorreta, tente novamente""Logar""Sair");
    return 
1;
}

Hash(Dados[])   {
    new 
Hash;
    for(new 
= (strlen(Dados) -1); > -1; --iHash += (Dados[i]*Dados[(1)]);
    return 
Hash;
    } 
Tem como alguйm atualizar isso pra mim, ou me dizer como atualizar?
Reply


Messages In This Thread
Como salvar essas tabelas no MySQL? - by Misael - 07.11.2017, 18:43
Re: Como salvar essas tabelas no MySQL? - by Naine - 07.11.2017, 19:08
Re: Como salvar essas tabelas no MySQL? - by Misael - 07.11.2017, 19:15
Re: Como salvar essas tabelas no MySQL? - by Misael - 08.11.2017, 11:14
Re: Como salvar essas tabelas no MySQL? - by F1N4L - 08.11.2017, 11:16
Re: Como salvar essas tabelas no MySQL? - by Misael - 08.11.2017, 18:30
Re: Como salvar essas tabelas no MySQL? - by F1N4L - 09.11.2017, 00:36

Forum Jump:


Users browsing this thread: 1 Guest(s)