[ajuda] Sistema de registro.
#1

Bom, eu to montando um server rpg do zero e eu queria pedir se alguem faz um tutorial ensinando a fazer um sistema de registro em box (nao quero fs) para eu por no gm, que upasse por respeito e salva-se o seguinte:

→Level
→Respeito
→Dinheiro
→Quantos Matou
→Morreu
→Horas Jogadas


Ajudem ai
Reply
#2

pawn Код:
new Info[MAX_PLAYERS][Level];
new Info[MAX_PLAYERS][Respeito];
new Info[MAX_PLAYERS][Dinheiro];
new Info[MAX_PLAYERS][Matou];
new Info[MAX_PLAYERS][Morreu];
new Info[MAX_PLAYERS][Horas];

public OnPlayerConnect(playerid)
{
    new file[50];
    GetPlayerName(playerid,file,50);
    format(file,50,"%s.ini",file);
    if(dini_Exists(file))
    {
        ShowPlayerDialog(playerid,1001,DIALOG_STYLE_INPUT,"Login","Digite a senha abaixo","Logar","Fechar");
        return 1;
    }else{
        ShowPlayerDialog(playerid,1002,DIALOG_STYLE_INPUT,"Registro","Digite a senha abaixo","Registrar","Fechar");
        return 1;    
    }
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new file[50];
    GetPlayerName(playerid,file,50);
    format(file,50,"%s.ini",file);
    if(dialogid == 1001)//login
    {
        if(!response)return Kick(playerid);
        if(strcmp(inputtext,dini_Get(file,"Senha"),false)==0)
        {
            Info[playerid][Level] = dini_Int(file,"Level");
            Info[playerid][Respeito] = dini_Int(file,"Respeito");
            Info[playerid][Dinheiro] = dini_Int(file,"Dinheiro");
            Info[playerid][Matou] = dini_Int(file,"Matou");
            Info[playerid][Morreu] = dini_Int(file,"Morreu");
            Info[playerid][Horas] = dini_Int(file,"Horas");
            SetPlayerScore(playerid,Info[playerid][Level]);
            ResetPlayerMoney(playerid);
            GivePlayerMoney(playerid,Info[playerid][Dinheiro]);
            SpawnPlayer(playerid);
        }else{
            ShowPlayerDialog(playerid,1001,DIALOG_STYLE_INPUT,"Login","Digite a senha abaixo\nSenha errada noob","Logar","Fechar");
            return 1;
        }
    }
    if(dialogid== 1002)//registro
    {
        if(response)
        {
             if(strlen(inputtext) == 0)return ShowPlayerDialog(playerid,1002,DIALOG_STYLE_INPUT,"Registro","Digite a senha abaixo","Logar","Fechar");
             dini_Create(file);
             dini_Set(file,"Senha",inputtext);
             dini_IntSet(file,"Level",1);
             dini_IntSet(file,"Respeito",0);
             dini_IntSet(file,"Dinheiro",0);  
             dini_IntSet(file,"Morreu",0);  
             dini_IntSet(file,"Matou",0);  
             dini_IntSet(file,"Horas",0);  
             SpawnPlayer(playerid);//registrado
        }
    }
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    SalvarPlayer(playerid);
    return 1;
}
stock SalvarPlayer(id)
{
    new file[50];
    GetPlayerName(playerid,file,50);
    format(file,50,"%s.ini",file);
    if(dini_Exists(file))
    {
        dini_IntSet(file,"Level",Info[id][Level]);
        dini_IntSet(file,"Respeito",Info[id][Respeito]);
        dini_IntSet(file,"Dinheiro",Info[id][Dinheiro]);  
        dini_IntSet(file,"Morreu",Info[id][Morreu]);  
        dini_IntSet(file,"Matou",Info[id][Matou]);  
        dini_IntSet(file,"Horas",Info[id][Horas]);
        return 1;
    }
}
fis este cуdigo tudo aki no fуrum sem ajuda entгo se tiver erros e fale ok, tй mais

OBS: antes de faze um gamemode saiba fazer um ¬¬
Reply
#3

voce definiu para cada hora ele ganhar 1 respeito?
Reply
#4

26 erros kkk se quiser as linhas so pedir.

C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(5) : error 017: undefined symbol "Level"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(5) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(6) : error 017: undefined symbol "Respeito"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(6) : error 021: symbol already defined: "Info"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(7) : error 017: undefined symbol "Dinheiro"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(7) : error 021: symbol already defined: "Info"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn( : error 017: undefined symbol "Matou"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn( : error 021: symbol already defined: "Info"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(9) : error 017: undefined symbol "Morreu"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(9) : error 021: symbol already defined: "Info"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(10) : error 017: undefined symbol "Horas"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(10) : error 021: symbol already defined: "Info"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(16) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(20) : error 017: undefined symbol "Level"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(21) : error 017: undefined symbol "Respeito"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(22) : error 017: undefined symbol "Dinheiro"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(23) : error 017: undefined symbol "Morreu"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(24) : error 017: undefined symbol "Matou"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(25) : error 017: undefined symbol "Horas"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(2 : warning 209: function "SalvarPlayer" should return a value
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(7 : warning 225: unreachable code
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(257) : error 017: undefined symbol "Level"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(25 : error 017: undefined symbol "Respeito"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(259) : error 017: undefined symbol "Dinheiro"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(260) : error 017: undefined symbol "Matou"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(261) : error 017: undefined symbol "Morreu"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(262) : error 017: undefined symbol "Horas"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(263) : error 017: undefined symbol "Level"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Reply
#5

Quote:
Originally Posted by HarryPoter(Owner)
Посмотреть сообщение
voce definiu para cada hora ele ganhar 1 respeito?
nao mais coloque isto no

pawn Код:
new timer[MAX_PLAYERS];//topo gm
//onplayerconnect
timer[playerid] = SetTimerEx("DarExp",600000,true,"%d",playerid);
//onplayerdisconnect
KillTimer(timer[playerid]);
falow
Reply
#6

Continua os mesmos erros
Reply
#7

Quote:
Originally Posted by HarryPoter(Owner)
Посмотреть сообщение
26 erros kkk se quiser as linhas so pedir.

C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(5) : error 017: undefined symbol "Level"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(5) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(6) : error 017: undefined symbol "Respeito"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(6) : error 021: symbol already defined: "Info"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(7) : error 017: undefined symbol "Dinheiro"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(7) : error 021: symbol already defined: "Info"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn( : error 017: undefined symbol "Matou"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn( : error 021: symbol already defined: "Info"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(9) : error 017: undefined symbol "Morreu"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(9) : error 021: symbol already defined: "Info"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(10) : error 017: undefined symbol "Horas"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(10) : error 021: symbol already defined: "Info"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(16) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(20) : error 017: undefined symbol "Level"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(21) : error 017: undefined symbol "Respeito"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(22) : error 017: undefined symbol "Dinheiro"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(23) : error 017: undefined symbol "Morreu"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(24) : error 017: undefined symbol "Matou"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(25) : error 017: undefined symbol "Horas"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(2 : warning 209: function "SalvarPlayer" should return a value
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(7 : warning 225: unreachable code
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(257) : error 017: undefined symbol "Level"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(25 : error 017: undefined symbol "Respeito"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(259) : error 017: undefined symbol "Dinheiro"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(260) : error 017: undefined symbol "Matou"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(261) : error 017: undefined symbol "Morreu"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(262) : error 017: undefined symbol "Horas"
C:\Documents and Settings\Toni Santolia\Desktop\GM\gamemodes\BPL.pwn(263) : error 017: undefined symbol "Level"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.
pawn Код:
#include <a_samp>
#include <dini>

enum pinfo
{
    Level,
    Respeito,
    Dinheiro,
    Matou,
    Morreu,
    Horas,
}
new Info[MAX_PLAYERS][pinfo];

public OnPlayerConnect(playerid)
{
    new file[50];
    GetPlayerName(playerid,file,50);
    format(file,50,"%s.ini",file);
    if(dini_Exists(file))
    {
        ShowPlayerDialog(playerid,1001,DIALOG_STYLE_INPUT,"Login","Digite a senha abaixo","Logar","Fechar");
        return 1;
    }else{
        ShowPlayerDialog(playerid,1002,DIALOG_STYLE_INPUT,"Registro","Digite a senha abaixo","Registrar","Fechar");
        return 1;
    }
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new file[50];
    GetPlayerName(playerid,file,50);
    format(file,50,"%s.ini",file);
    if(dialogid == 1001)//login
    {
        if(!response)return Kick(playerid);
        if(strcmp(inputtext,dini_Get(file,"Senha"),false)==0)
        {
            Info[playerid][Level] = dini_Int(file,"Level");
            Info[playerid][Respeito] = dini_Int(file,"Respeito");
            Info[playerid][Dinheiro] = dini_Int(file,"Dinheiro");
            Info[playerid][Matou] = dini_Int(file,"Matou");
            Info[playerid][Morreu] = dini_Int(file,"Morreu");
            Info[playerid][Horas] = dini_Int(file,"Horas");
            SetPlayerScore(playerid,Info[playerid][Level]);
            ResetPlayerMoney(playerid);
            GivePlayerMoney(playerid,Info[playerid][Dinheiro]);
            SpawnPlayer(playerid);
        }else{
            ShowPlayerDialog(playerid,1001,DIALOG_STYLE_INPUT,"Login","Digite a senha abaixo\nSenha errada noob","Logar","Fechar");
            return 1;
        }
    }
    if(dialogid== 1002)//registro
    {
        if(response)
        {
             if(strlen(inputtext) == 0)return ShowPlayerDialog(playerid,1002,DIALOG_STYLE_INPUT,"Registro","Digite a senha abaixo","Logar","Fechar");
             dini_Create(file);
             dini_Set(file,"Senha",inputtext);
             dini_IntSet(file,"Level",1);
             dini_IntSet(file,"Respeito",0);
             dini_IntSet(file,"Dinheiro",0);
             dini_IntSet(file,"Morreu",0);
             dini_IntSet(file,"Matou",0);
             dini_IntSet(file,"Horas",0);
             SpawnPlayer(playerid);//registrado
        }
    }
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    SalvarPlayer(playerid);
    return 1;
}
stock SalvarPlayer(id)
{
    new file[50];
    GetPlayerName(id,file,50);
    format(file,50,"%s.ini",file);
    if(dini_Exists(file))
    {
        dini_IntSet(file,"Level",Info[id][Level]);
        dini_IntSet(file,"Respeito",Info[id][Respeito]);
        dini_IntSet(file,"Dinheiro",Info[id][Dinheiro]);
        dini_IntSet(file,"Morreu",Info[id][Morreu]);
        dini_IntSet(file,"Matou",Info[id][Matou]);
        dini_IntSet(file,"Horas",Info[id][Horas]);
        return 1;
    }
    return 1;
}
Reply
#8

Код:
#include <a_samp>
#include <dini>

enum pinfo
{
    Level,
    Respeito,
    Dinheiro,
    Matou,
    Morreu,
    Horas // o ultimo nunca se coloca virgula :D
}
new Info[MAX_PLAYERS][pinfo];

public OnPlayerConnect(playerid)
{
    new file[50];
    GetPlayerName(playerid,file,50);
    format(file,50,"%s.ini",file);
    if(dini_Exists(file))
    {
        ShowPlayerDialog(playerid,1001,DIALOG_STYLE_INPUT,"Login","Digite a senha abaixo","Logar","Fechar");
        return 1;
    }else{
        ShowPlayerDialog(playerid,1002,DIALOG_STYLE_INPUT,"Registro","Digite a senha abaixo","Registrar","Fechar");
        return 1;
    }
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new file[50];
    GetPlayerName(playerid,file,50);
    format(file,50,"%s.ini",file);
    if(dialogid == 1001)//login
    {
        if(!response)return Kick(playerid);
        if(strcmp(inputtext,dini_Get(file,"Senha"),false)==0)
        {
            Info[playerid][Level] = dini_Int(file,"Level");
            Info[playerid][Respeito] = dini_Int(file,"Respeito");
            Info[playerid][Dinheiro] = dini_Int(file,"Dinheiro");
            Info[playerid][Matou] = dini_Int(file,"Matou");
            Info[playerid][Morreu] = dini_Int(file,"Morreu");
            Info[playerid][Horas] = dini_Int(file,"Horas");
            SetPlayerScore(playerid,Info[playerid][Level]);
            ResetPlayerMoney(playerid);
            GivePlayerMoney(playerid,Info[playerid][Dinheiro]);
            SpawnPlayer(playerid);
        }else{
            ShowPlayerDialog(playerid,1001,DIALOG_STYLE_INPUT,"Login","Digite a senha abaixo\nSenha errada noob","Logar","Fechar");
            return 1;
        }
    }
    if(dialogid== 1002)//registro
    {
        if(response)
        {
             if(strlen(inputtext) == 0)return ShowPlayerDialog(playerid,1002,DIALOG_STYLE_INPUT,"Registro","Digite a senha abaixo","Logar","Fechar");
             dini_Create(file);
             dini_Set(file,"Senha",inputtext);
             dini_IntSet(file,"Level",1);
             dini_IntSet(file,"Respeito",0);
             dini_IntSet(file,"Dinheiro",0);
             dini_IntSet(file,"Morreu",0);
             dini_IntSet(file,"Matou",0);
             dini_IntSet(file,"Horas",0);
             SpawnPlayer(playerid);//registrado
        }
    }
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    SalvarPlayer(playerid);
    return 1;
}
stock SalvarPlayer(id)
{
    new file[50];
    GetPlayerName(id,file,50);
    format(file,50,"%s.ini",file);
    if(dini_Exists(file))
    {
        dini_IntSet(file,"Level",Info[id][Level]);
        dini_IntSet(file,"Respeito",Info[id][Respeito]);
        dini_IntSet(file,"Dinheiro",Info[id][Dinheiro]);
        dini_IntSet(file,"Morreu",Info[id][Morreu]);
        dini_IntSet(file,"Matou",Info[id][Matou]);
        dini_IntSet(file,"Horas",Info[id][Horas]);
        return 1;
    }
    return 1;
}
Reply
#9

Calmai, para tudo, reveja sua assinatura...

Viu ? algo a declarar ?
Reply
#10

Eu fiz igual ta aqui e deu esses 4 erros sabe oq й ?

ta dando o erro nessa linha aqui
Код:
dini_IntSet(file,"Level",Info[id][Level]);
Aqui e o comando inteiro
Код:
stock SalvarPlayer(id)
{
    new file[50];
    GetPlayerName(id,file,50);
    format(file,50,"%s.ini",file);
    if(dini_Exists(file))
    {
    	dini_IntSet(file,"Level",Info[id][Level]);
    	dini_IntSet(file,"Respeito",Info[id][Respeito]);
    	dini_IntSet(file,"Dinheiro",Info[id][Dinheiro]);
     dini_IntSet(file,"Morreu",Info[id][Morreu]);
     dini_IntSet(file,"Matou",Info[id][Matou]);
     dini_IntSet(file,"Horas",Info[id][Horas]);
        return 1;
    }
    return 1;
}
Esses sгo os erros
Код:
C:\Documents and Settings\thaw\Desktop\Erro.pwn(84) : error 017: undefined symbol "Info"
C:\Documents and Settings\thaw\Desktop\Erro.pwn(84) : warning 215: expression has no effect
C:\Documents and Settings\thaw\Desktop\Erro.pwn(84) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\thaw\Desktop\Erro.pwn(84) : error 029: invalid expression, assumed zero
C:\Documents and Settings\thaw\Desktop\Erro.pwn(84) : fatal error 107: too many error messages on one line
Coloquei a include dini se alguem souber o que й agradeзo :d
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)