[Ajuda] Invalid expression, assumed zero
#1

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>
Код:
#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;
}
<login_OnPlayerConnect>
Код:
#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;
}
<login_OnDialogResponse>
Код:
#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;
}
<Funcoes.pwn>
Код:
#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;
}
Reply
#2

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
// retire os colchetes
    
login_OnDialogResponse(playeriddialogidresponseinputtext);
    return 
1;

Reply
#3

Obrigado!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)