enum { DIALOG_LOGIN, DIALOG_REGISTER, DIALOG_SEX, DIALOG_AGE, DIALOG_EMAIL }
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
static string[500],strong[1500],string2[120];
static named[30];
GetPlayerName(playerid,named,sizeof(named));
if( strfind(inputtext, "%", true) != -1 ||
strfind(inputtext, "'", true) != -1 ||
strfind(inputtext, "`", true) != -1 ||
strfind(inputtext, ";", true) != -1 )
{
SCM(playerid,COLOR_RED,"don't use this characters!");
return 0;
}
switch(dialogid)
{
case DIALOG_LOGIN:
{
enum dialogs { DIALOG_LOGIN, DIALOG_REGISTER, DIALOG_SEX, DIALOG_AGE, DIALOG_EMAIL } new DialogID[dialogs]; DialogID[DIALOG_LOGIN] = 1 /*Any unique id*/; DialogID[DIALOG_REGISTER] = 2 /*Any unique id*/; DialogID[DIALOG_SEX] = 3 /*Any unique id*/; DialogID[DIALOG_AGE] = 4 /*Any unique id*/; DialogID[DIALOG_EMAIL] = 5 /*Any unique id*/;
I think its because you are not setting the value of the dialogs (dialogids)
Try doing it like this: Код:
enum dialogs { DIALOG_LOGIN, DIALOG_REGISTER, DIALOG_SEX, DIALOG_AGE, DIALOG_EMAIL } new DialogID[dialogs]; DialogID[DIALOG_LOGIN] = 1 /*Any unique id*/; DialogID[DIALOG_REGISTER] = 2 /*Any unique id*/; DialogID[DIALOG_SEX] = 3 /*Any unique id*/; DialogID[DIALOG_AGE] = 4 /*Any unique id*/; DialogID[DIALOG_EMAIL] = 5 /*Any unique id*/; |
No need to set id''s because enum allready does that
DIALOG_LOGIN //= 0 DIALOG_REGISTER //= 1 ... |
What if you want to set the id to 100 or any other unique id to prevent dialog ids collision?
Read the post before commenting.Or take English learning classes if you can't understand basic sentences. |
What if you want to set the id to 100 or any other unique id to prevent dialog ids collision?
Read the post before commenting.Or take English learning classes if you can't understand basic sentences. |
Search for "#define DIALOG_LOGIN .." in your script and remove it (where .. is a number).
Collisions have nothing to do with compiling and the error he gets. |