[Ajuda] Erro ao compilar o FS
#1

Baixei esse FS compiei oque estava dentro e salvei na pasta de FS e depois compiel mais deu esse erro

pawn Код:
C:\Users\Leandro\Desktop\BRASIL MATA MATA 2014\filterscripts\Registro&Login.pwn(53) : error 017: undefined symbol "DIALOG_STYLE_PASSWORD"
C:\Users\Leandro\Desktop\BRASIL MATA MATA 2014\filterscripts\Registro&Login.pwn(135) : error 017: undefined symbol "DIALOG_STYLE_PASSWORD"
C:\Users\Leandro\Desktop\BRASIL MATA MATA 2014\filterscripts\Registro&Login.pwn(166) : error 017: undefined symbol "DIALOG_STYLE_PASSWORD"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
https://sampforum.blast.hk/showthread.php?tid=468205
Reply
#2

Topo:

Код:
#define DIALOG_STYLE_MSGBOX     0
#define DIALOG_STYLE_INPUT      1
#define DIALOG_STYLE_LIST       2
#define DIALOG_STYLE_PASSWORD   3
Reply
#3

Bom de certo mais a senha so pode conter numeros como faco pra conter letras e numeros ?

pawn Код:
#define FILTERSCRIPT

#include <a_samp>
#include <DOF2>
#include <a_players>

// * Enums * //
enum Player
{
    Senha,
    Dinheiro,
    Skin,
    Score,
    Ativada
}
new p[MAX_PLAYERS][Player];

// * Defines * //
#define Login 1
#define Registro 2
#define InfosP 3
#define DIALOG_STYLE_MSGBOX 0
#define DIALOG_STYLE_INPUT 1
#define DIALOG_STYLE_LIST 2
#define DIALOG_STYLE_PASSWORD 3

// * News * //
new errousenha[MAX_PLAYERS];

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Sistema de Registro feito by Leandro_CQC");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    DOF2_Exit();
    return 1;
}

#endif

public OnPlayerRequestClass(playerid, classid)
{
    new archiveNew[40], name[MAX_PLAYER_NAME];
    new Messages[182];
    GetPlayerName(playerid, name, 32);
    format(archiveNew, 40, "Players/%s.txt", name);
    if(p[playerid][Ativada] == 1)
    {
        format(Messages, sizeof(Messages), "{f4e60c}Seu Nick: {FF0000}%s\n\n{FF0000}Digite sua Senha para logar", name);
        ShowPlayerDialog(playerid, Login, DIALOG_STYLE_PASSWORD, "Logar", Messages, "Confirma", "Cancelar");
    }
    if(p[playerid][Ativada] == 0)
    {
        ShowPlayerDialog(playerid, Registro, DIALOG_STYLE_INPUT, "Registro", "{f4e60c}Vocк ainda nгo й Registrado\n{FF0000}Digite uma senha para se registrar!", "Confirma", "Cancelar");
    }
    return 1;
}

public OnPlayerConnect(playerid)
{
    new arquivo[40], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, 32);
    format(arquivo, 40, "Players/%s.txt", name);
    p[playerid][Ativada] = DOF2_GetInt(arquivo, "Ativada");
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new arquivo[40], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, 32);
    format(arquivo, 40, "Players/%s.txt", name);
    DOF2_CreateFile(arquivo);
    DOF2_SetInt(arquivo, "Senha", p[playerid][Senha]);
    DOF2_SetInt(arquivo, "Skin", GetPlayerSkin(playerid));
    DOF2_SetInt(arquivo, "Dinheiro", GetPlayerMoney(playerid));
    DOF2_SetInt(arquivo, "Score", p[playerid][Score]);
    DOF2_SaveFile();
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new arquivo[40], name[MAX_PLAYER_NAME];
    new Messages[182];
    GetPlayerName(playerid, name, 32);
    format(arquivo, 40, "Players/%s.txt", name);
    if(dialogid == Registro)
    {


        if(!strval(inputtext))
        {


            ShowPlayerDialog(playerid, Registro, DIALOG_STYLE_INPUT, "Registro", "{f4e60c}Digite apenas nъmeros!\n{FF0000}Digite sua senha novamente para se registrar!", "Confirma", "Cancelar");
            return 1;
        }
        if(!response)
        {


            Kick(playerid);
            return 1;
        }
        else
        {


            p[playerid][Senha] = strval(inputtext);
            DOF2_CreateFile(arquivo);
            DOF2_SetInt(arquivo, "Senha", p[playerid][Senha]);
            DOF2_SetInt(arquivo, "Skin", GetPlayerSkin(playerid));
            DOF2_SetInt(arquivo, "Dinheiro", GetPlayerMoney(playerid));
            DOF2_SetInt(arquivo, "Score", p[playerid][Score]);
            DOF2_SetInt(arquivo, "Ativada", p[playerid][Ativada]);
            p[playerid][Ativada] = 1;
            DOF2_SaveFile();
            SendClientMessage(playerid, -1, " Registrado com sucesso!");
            SpawnPlayer(playerid);
        }
    }
    if(dialogid == Login)
    {


        if(!strval(inputtext))
        {


            format(Messages, sizeof(Messages), "{f4e60c}Seu Nick: {FF0000}%s\n\n{FF0000}Digite sua Senha para logar", name);
            ShowPlayerDialog(playerid, Login, DIALOG_STYLE_PASSWORD, "Logar", Messages, "Confirma", "Cancelar");
            return 1;
        }
        if(!response)
        {


            Kick(playerid);
            return 1;
        }
        else
        {


            p[playerid][Senha] = DOF2_GetInt(arquivo, "Senha");
            if(strval(inputtext) == p[playerid][Senha])
            {


                p[playerid][Score] = DOF2_GetInt(arquivo, "Score");
                SetPlayerScore(playerid, p[playerid][Score]);
                p[playerid][Dinheiro] = DOF2_GetInt(arquivo, "Dinheiro");
                GivePlayerMoney(playerid, p[playerid][Dinheiro]);
                p[playerid][Skin] = DOF2_GetInt(arquivo, "Skin");
                SetPlayerSkin(playerid, p[playerid][Skin]);
                SpawnPlayer(playerid);
            }
            else
            {


                ShowPlayerDialog(playerid, Login, DIALOG_STYLE_PASSWORD, "Logar", "{f4e60c}Vocк digitou sua senha errada, digite-a novamente para logar!\nSe errar 3 vezes voce serб kikado!", "Confirma", "Cancelar");
                errousenha[playerid]++;
                if(errousenha[playerid] == 3)
                {


                    SendClientMessage(playerid, -1, "{3cff00}[SERVER]{FFFFFF}Voce foi kikado por errar a senha 3 vezes!");
                    Kick(playerid);
                    return 1;
                }
            }
        }
    }
    return 1;
}
Reply
#4

Usa strlen em vez de strval
Reply
#5

Quote:
Originally Posted by PT
Посмотреть сообщение
Usa strlen em vez de strval
Nгo!

Strlen й para medir o tamanho da string! Por exemplo, se a pass tiver 5 dнgitos (ex: arroz), e se ele colocar outra pass completamente diferente com 5 dнgitos, vai conseguir logar.

Tem de usar strcmp!

Use assim:

PHP код:
if(!strcmp(DOF2_GetString(ficheiro,"Password"), inputtextfalse))
{
    
// pass aceite
}
else
{
    
// pass negada

Para comparar as passwords.
Reply
#6

Faz uns testes ae e vez...

Tou na escola pelo Tele se nгo mostrava-te
Reply
#7

Hehe, hoje й feriado municipal

Mas na wiki diz que й para ver o tamanho da string, mas nunca testei.

Strlen
Reply
#8

Deu certo troquei e deu certo kk
Reply
#9

Quote:
Originally Posted by bruxo00
Посмотреть сообщение
Hehe, hoje й feriado municipal

Mas na wiki diz que й para ver o tamanho da string, mas nunca testei.

Strlen
sortudo quando eu chegar a casa vou fazer uns testes, adiciona-me skype depois digo-tк la algo se quiseres
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)