22.12.2018, 19:16
Estou iniciando um GM do 0 e comeзando com o sistema de Login/Registro, porйm estou fazendo a programaзгo modularizada, oq me leva ter dor de cabeзa as vezes.
Erro:
C:\CaioVillar - Arquivos\Caio Villar\Jogos\GTA - SAMP\Servidor Local\gamemodes\main.pwn(211) : error 029: invalid expression, assumed zero
OBS: Linha 211 da main.pwn й OnDialogResponse
<Main.pwn>
<login_OnPlayerConnect>
<login_OnDialogResponse>
<Funcoes.pwn>
Erro:
C:\CaioVillar - Arquivos\Caio Villar\Jogos\GTA - SAMP\Servidor Local\gamemodes\main.pwn(211) : error 029: invalid expression, assumed zero
OBS: Linha 211 da main.pwn й OnDialogResponse
<Main.pwn>
Код:
#include <a_samp> #include <sscanf2> #include <DOF2> #include "..\modulos\LoginRegistro\login_OnPlayerConnect.pwn" #include "..\modulos\LoginRegistro\login_OnDialogResponse.pwn" public OnPlayerConnect(playerid) { login_OnPlayerConnect(playerid); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { login_OnDialogResponse(playerid, dialogid, response, inputtext[]); return 1; }
Код:
#include <DOF2> #include "..\..\modulos\Servidor\Servidor_DialogsIds.pwn" #include "..\..\modulos\LoginRegistro\Includes\Funcoes.pwn" forward login_OnPlayerConnect(playerid); forward login_OnGamemodeExit(); public login_OnPlayerConnect(playerid){ if(!DOF2_FileExists(pArquivo(playerid))){ ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Aroeira - Registro", "1є Registro", "REGISTRAR", "SAIR"); } return true; } public login_OnGamemodeExit(){ DOF2_Exit(); return true; }
Код:
#include "..\..\modulos\Servidor\Servidor_DialogsIds.pwn" forward login_OnDialogResponse(playerid, dialogid, response, inputtext[]); public login_OnDialogResponse(playerid, dialogid, response, inputtext[]){ switch(dialogid){ case DIALOG_REGISTER:{ if(response){ if(strlen(inputtext) < 5 || strlen(inputtext) > 20 || !strlen(inputtext)){ ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Aroeira - Registro", "2є Registro / Senha Errada", "REGISTRAR", "SAIR"); return true; } DOF2_CreateFile(pArquivo(playerid)); DOF2_SetString(pArquivo(playerid), "Senha", inputtext); SendClientMessage(playerid, -1, "Registrado"); }else{ Kick(playerid); } } } return true; }
Код:
#include <a_samp> #define PASTA_CONTAS "A_Contas/%s.ini" pArquivo(playerid){ new nArquivo[50]; format(nArquivo, sizeof(nArquivo), PASTA_CONTAS, pNome(playerid)); return nArquivo; } stock pNome(playerid){ new nome[MAX_PLAYER_NAME]; GetPlayerName(playerid, nome, sizeof(nome)); return nome; }