[Ajuda] Varios tutoriais e nada ( Registro )
#1

Bom Galera eu estou desesperado.
Vi varios Tutoriais e nao consegui:
https://sampforum.blast.hk/showthread.php?tid=350855
http://forum.sa-mp.com/showthread.ph...a+REGISTRO+DOF
http://forum.sa-mp.com/showthread.ph...+registro+DOF2
http://forum.sa-mp.com/showthread.ph...+registro+DOF2

Os de recuperar a senha nao й bom pois tem muito processo, queria sу Dialog Logar e Registrar
salvar o nick dele Senha e o Dinhero
Obs: GM й do 0 qualquer code irб funcionar tenho a include DOF2

Nгo foi falta de pesquisa nao. joguei no ****** e saiu um monte bugadгo
Queria em Dialog como os outros acima sу que sу logar e registrar nada de recuperar a senha!
Quem puder ajudar grato!
Caso eu nao responder hoje eu respondo amanhг
Reply
#2

use esse * AQUI.
Reply
#3

Q.I estou testando em breve posto o resultado!

@Edit
Aonde coloco isso?
pawn Код:
enum pInfo
{
    pKills,
    pDeaths,
    pMoney,
    pAdmin
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Pois ta dando erro Nisso!
Erro: Nao esta Identificando o PlayerInfo as funзхes do Registro!
Obs: vou ficar um tempo AFK por causa do banho ja volto galera.
Reply
#4

enums e variaveis globais sгo colocadas no inicio de script. Em nenhuma callback.
Reply
#5

Codigo Inteiro:
Nao ta identificando a PlayerInfo
Vejam o codigo inteiro e me ajudem!
Код:
C:\Users\Cliente\Desktop\GM\RP\gamemodes\RP.pwn(65) : warning 217: loose indentation
public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); // Linha 65

C:\Users\Cliente\Desktop\GM\RP\gamemodes\RP.pwn(94) : error 017: undefined symbol "PlayerInfo"
C:\Users\Cliente\Desktop\GM\RP\gamemodes\RP.pwn(94) : warning 215: expression has no effect
C:\Users\Cliente\Desktop\GM\RP\gamemodes\RP.pwn(94) : error 001: expected token: ";", but found "]"
C:\Users\Cliente\Desktop\GM\RP\gamemodes\RP.pwn(94) : error 029: invalid expression, assumed zero
C:\Users\Cliente\Desktop\GM\RP\gamemodes\RP.pwn(94) : fatal error 107: too many error messages on one line
Linha 94
DOF2_SetInt(file, "Kills",PlayerInfo[playerid][pKills]);
pawn Код:
#include <a_samp>
#include <Double-O-Files_2>

#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2

#if defined FILTERSCRIPT

#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2

enum pInfo
{
    pKills,
    pDeaths,
    pMoney,
    pAdmin
}
new PlayerInfo[MAX_PLAYERS][pInfo];
//
public OnGameModeExit()
{
    DOF2_Exit();
    return 1;
}
//
public OnPlayerConnect(playerid)
{
     new file[64]; // We declare the size of the file
    GetPlayerName(playerid,file,sizeof(file)); // We get the file name
    format(file,sizeof(file),DOF2_File(file));// Here we get the path from DOF2_File (/Users)
    if(DOF2_FileExists(file)) // We check if the player is registered
    {
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Welcome.Please log-in","{FFFFFF}Type your {00FF22}password {FFFFFF}here to log-in","Log-in","Quit");
        // The log-in dialog will pop up
    }
    else // If not registered
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Please register!","{FFFFFF}Type your {00FF22}password {FFFFFF}here to register.","Register","Quit");
        // The register dialog will pop up
    }
    return 1;
}
//
public OnPlayerDisconnect(playerid, reason)
{
    new file[64]; // We declare the size of the file
    GetPlayerName(playerid,file,sizeof(file)); // We get the file name
    format(file,sizeof(file),DOF2_File(file));// We get the user path from DOF2_File (folder Users)
    DOF2_SetInt(file, "Kills",PlayerInfo[playerid][pKills]); // We set/update the players settings.
    DOF2_SetInt(file, "Deaths",PlayerInfo[playerid][pDeaths]);
    DOF2_SetInt(file, "Money",PlayerInfo[playerid][pMoney]);
    DOF2_SetInt(file, "AdminLevel",PlayerInfo[playerid][pAdmin]);
    return 1;
}
//
public OnPlayerDeath(playerid, killerid, reason)
{
    {
    PlayerInfo[killerid][pKills]++; // Will increase the killerid kills
    PlayerInfo[playerid][pDeaths]++; // Will increase the playerid ( the one who died ) the deaths.
    return 1;
}
//
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid) // We switch our dialog id's
    {
        case DIALOG_REGISTER: // If the dialog_register shows up ( id 1111)
        {
            if(!response) Kick(playerid); // If he click on Quit, he will get kicked
            if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Please register!","{FFFFFF}Type your {00FF22}password {FFFFFF}here to register.","Register","Quit");
            // If he doesn't type anything, the dialog will show again.
            if(response) // If he click on Register
            {
                new file[64]; // We declare the size of the file
                GetPlayerName(playerid,file,sizeof(file)); // We get the file name
                format(file,sizeof(file),DOF2_File(file)); // We get the path name from DOF2_File, that means from Users folder.
                DOF2_CreateFile(file, inputtext); // Creates the file and the password.
                DOF2_SetInt(file, "Kills", 0); // When the player register his kills will be set to 0, you can change
                DOF2_SetInt(file, "Deaths", 0); // His deaths will be set to 0, you can change
                DOF2_SetInt(file, "Money", 1000); // His money will be set to 1000, you can change
                DOF2_SetInt(file, "AdminLevel", 0); // His Admin Level will be set to 0, you can change
                DOF2_SaveFile(); // Saves the file.
                SetSpawnInfo(playerid, 0, 0, 1722.5123, -1912.7931, 13.5647, 269.15, 0, 0, 0, 0, 0, 0); // Sets where the player will spawn, this coordinates are from the Unity Station in Los Santos
                SpawnPlayer(playerid); // After registering, the player will spawn.
            }
        }
        case DIALOG_LOGIN: // If dialog_login (id 2222) shows up
        {
            if(!response) Kick(playerid); // If he click on Quit, he will get kicked.
            if(response) // If he click on Log-in
            {
                new file[64]; // We declare the size of the file
                GetPlayerName(playerid,file,sizeof(file)); // We get the file name
                format(file,sizeof(file),DOF2_File(file)); // We get the user path from DOF2_File ( folder Users )
                if(DOF2_FileExists(file)) // If he is registered
                {
                    if(DOF2_CheckLogin(file,inputtext)) // We check if the password match
                    {
                        PlayerInfo[playerid][pKills] = DOF2_GetInt(file,"Kills"); // We load our settings
                        PlayerInfo[playerid][pDeaths] = DOF2_GetInt(file,"Deaths");
                        PlayerInfo[playerid][pMoney] = DOF2_GetInt(file,"Money");
                        PlayerInfo[playerid][pAdmin] = DOF2_GetInt(file,"AdminLevel");
                        SetSpawnInfo(playerid, 0, 0, 1722.5123, -1912.7931, 13.5647, 269.15, 0, 0, 0, 0, 0, 0); // We set the spawn (Unity Station)
                        SpawnPlayer(playerid); // The player spawns after log-in
                        GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]); // We give the player his money
                        return 1;
                    }
                    else // If the password don't match, they will get an error
                    {
                        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Wrong Password!","{F81414}You have typed a wrong password\n{FFFFFF}Type your password here to log-in!","Log-in","Quit");
                       return 1;
                    }
                }
            }
        }
    }
    return 1;
}
// Pronto
Reply
#6

Apague
pawn Код:
#if defined FILTERSCRIPT
Reply
#7

Код:
C:\Users\Cliente\Desktop\GM\RP\gamemodes\RP.pwn(69) : warning 217: loose indentation
C:\Users\Cliente\Desktop\GM\RP\gamemodes\RP.pwn(307) : warning 217: loose indentation
pawn Код:
// Linha 69
GetPlayerName(playerid,file,sizeof(file)); // We get the file name

// Linha 307
                       return 1;
Reply
#8

pawn Код:
public OnPlayerConnect(playerid)
{
    new file[64]; // We declare the size of the file
    GetPlayerName(playerid,file,sizeof(file)); // We get the file name
    format(file,sizeof(file),DOF2_File(file));// Here we get the path from DOF2_File (/Users)
    if(DOF2_FileExists(file)) // We check if the player is registered
    {
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Welcome.Please log-in","{FFFFFF}Type your {00FF22}password {FFFFFF}here to log-in","Log-in","Quit");
        // The log-in dialog will pop up
    }
    else // If not registered
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Please register!","{FFFFFF}Type your {00FF22}password {FFFFFF}here to register.","Register","Quit");
        // The register dialog will pop up
    }
    return 1;
}
Reply
#9

Mals Pasta errada do gamemode

Tudo certo vlw!
Reply
#10

Erroa auto explicativo u.u troca a senha da rcon pra uma de tua preferencia
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)