[Help] Error
#1

I making two language script, and I got error:
Код:
IC_war.pwn(2714) : error 040: duplicate "case" label (value 16)
Line is bolded:
Quote:
case DIALOG_LOG:
{
if(response)
{
new
pFile[35],dialog[128];

format(pFile, 35, Player_File, GetName(playerid));

INI_ParseFile(pFile, "LoadP_Data", .bExtra = true, .extra = playerid);


if(udb_hash(inputtext) == P_Data[playerid][pPassword])
{
SetPVarInt(playerid, "Logged", 1);
SCM(playerid,-1,"To proceed with further play click on spawn. Thanks for playing at our server.");
}
else
{
format(dialog, sizeof(dialog),""COL_BLUE"The password you entered is incorrect!\nIf you forgot your password, contact\nsome of Administrator on forum.", GetName(playerid));
ShowPlayerDialog(playerid, DIALOG_LOG, DIALOG_STYLE_PASSWORD, "Xoomer - Login",dialog, "Login", "Izadji");
}
}
else Kick(playerid);
}

Reply
#2

what are the dialog defines list? search "#define DIALOG_" and see if any of the numbers after them are the same
Reply
#3

Quote:
Originally Posted by MeDaKewlDude
Посмотреть сообщение
what are the dialog defines list? search "#define DIALOG_" and see if any of the numbers after them are the same
Thanks, but i have new error. Line is bolded.
Код:
	else
    {
        format(dialog, sizeof(dialog),""COL_BLUE"Welcome back, %s!\n\nInsert a password of your account\nand login.", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOG, DIALOG_STYLE_PASSWORD, ""COL_YELLOW"Xoomer - Login",dialog, "Login", "Quit");
    }
Код:
error 029: invalid expression, assumed zero
Reply
#4

replace #define DIALOG_LOG 16 with #define DIALOG_LOG 1236
Reply
#5

Quote:
Originally Posted by MeDaKewlDude
Посмотреть сообщение
replace #define DIALOG_LOG 16 with #define DIALOG_LOG 1236
Doesn't help.
Reply
#6

what is the "if" statement before this? ex. if(...)
pawn Код:
else
    {
        format(dialog, sizeof(dialog),""COL_BLUE"Welcome back, %s!\n\nInsert a password of your account\nand login.", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOG, DIALOG_STYLE_PASSWORD, ""COL_YELLOW"Xoomer - Login",dialog, "Login", "Quit");
    }
Reply
#7

Quote:
Originally Posted by MeDaKewlDude
Посмотреть сообщение
what is the "if" statement before this? ex. if(...)
pawn Код:
else
    {
        format(dialog, sizeof(dialog),""COL_BLUE"Welcome back, %s!\n\nInsert a password of your account\nand login.", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOG, DIALOG_STYLE_PASSWORD, ""COL_YELLOW"Xoomer - Login",dialog, "Login", "Quit");
    }
Here is OnPlayerConnect:

Код:
public OnPlayerConnect(playerid)
{
 	new dialog[128], string[128];
    format(string, 35, Player_File, GetName(playerid));

	if(!INI_Exists(string))
	{
		format(dialog, sizeof(dialog),"English: Choose the language to use for your account\nHrvatski: Izaberite jezik koji biste koristili za vaљ korisnički račun", GetName(playerid));
 		ShowPlayerDialog(playerid, DIALOG_JEZIK, DIALOG_STYLE_LIST, "Registration - 1. step", dialog, "Next", "Quit");
	}
 	else if(!INI_Exists(string))
    {
        format(dialog, sizeof(dialog),""COL_BLUE"Select and enter the password\nyou want to use for your account.", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_REG, DIALOG_STYLE_PASSWORD,""COL_YELLOW"Registration - 2. step", dialog, "Registration", "Quit");
    }
    else if(!INI_Exists(string))
    {
        format(dialog, sizeof(dialog),""COL_BLUE"Odaberite i unesite lozinku koju ћelite\nkoristiti za svoj korisnički račun.", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""COL_YELLOW"Registracija - 2. korak", dialog, "Registracija", "Izađi");
    }
	else
    {
        format(dialog, sizeof(dialog),""COL_BLUE"Welcome back, %s!\n\nInsert a password of your account\nand login.", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOG, DIALOG_STYLE_PASSWORD, ""COL_YELLOW"Xoomer - Login",dialog, "Login", "Quit");
    }
	else
    {
        format(dialog, sizeof(dialog),""COL_BLUE"Dobrodoљli natrag, %s!\n\nMolimo da unesete lozinku vaseg korisničkog\nračuna i da se prijavite.", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""COL_YELLOW"Xoomer - Login",dialog, "Login", "Izadji");
    }
	SetPVarInt(playerid, "Join", 1);
 return 1;
}
Reply
#8

ok. add this to OnDialogResponse after Switch(dialogid)
pawn Код:
case DIALOG_REG:
    {
    if(response)
    {
    if(!INI_Exists(string))
    {
        format(dialog, sizeof(dialog),""COL_BLUE"Select and enter the password\nyou want to use for your account.", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_REG, DIALOG_STYLE_PASSWORD,""COL_YELLOW"Registration - 2. step", dialog, "Registration", "Quit");
    }
    else
    {
        format(dialog, sizeof(dialog),""COL_BLUE"Welcome back, %s!\n\nInsert a password of your account\nand login.", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOG, DIALOG_STYLE_PASSWORD, ""COL_YELLOW"Xoomer - Login",dialog, "Login", "Quit");
    }
    }
    else Kick(playerid);
   
    }
    case DIALOG_JEZIK:
    {
    if(response)
    {
    if(!INI_Exists(string))
    {
        format(dialog, sizeof(dialog),""COL_BLUE"Odaberite i unesite lozinku koju želite\nkoristiti za svoj korisnički račun.", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""COL_YELLOW"Registracija - 2. korak", dialog, "Registracija", "Izađi");
    }
   
    else
    {
        format(dialog, sizeof(dialog),""COL_BLUE"Dobrodošli natrag, %s!\n\nMolimo da unesete lozinku vaseg korisničkog\nračuna i da se prijavite.", GetName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, ""COL_YELLOW"Xoomer - Login",dialog, "Login", "Izadji");
    }
    else Kick(playerid);
    }
and replace OnPlayerConnect with this:
pawn Код:
public OnPlayerConnect(playerid)
{
    new dialog[128], string[128];
    format(string, 35, Player_File, GetName(playerid));

    format(dialog, sizeof(dialog),"English: Choose the language to use for your account\nHrvatski: Izaberite jezik koji biste koristili za vaš korisnički račun", GetName(playerid));
    ShowPlayerDialog(playerid, DIALOG_JEZIK, DIALOG_STYLE_LIST, "Registration - 1. step", dialog, "Next", "Quit");
   
    SetPVarInt(playerid, "Join", 1);
 return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)