Jump to content
  • 0

error 010: invalid function or declaration


Browse

Question

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    switch(dialogid) {
          case DIALOG_REGISTER: {
            if(!response) return Kick(playerid);
            if(strlen(inputtext) < 6 || strlen(inputtext) > 32)
                format(szMessage, -1, "Hello %s. Welcome to server!", szPlayerName);
                SendClientMessage(playerid, 0x844185FF, szMessage);
                SendClientMessage(playerid, -1, "You aren't registered yet. Please enter your desired password in the dialog box to register.");
                ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "SERVER: Registration", "{844185}Hello.\n\{FFFFFF}Please enter your desired password below!", "Register", "Cancel");
                /*format(string, sizeof(string),"{FFFFFF}Please enter your desired password below!",GetName(playerid));
                ShowPlayerDialog(playerid, DIALOG_REGISTER,DIALOG_STYLE_PASSWORD, "SERVER: Registration", string, "Register", "Cancel");*/
            }
            else {
                WP_Hash(playerVariables[playerid][ppassword], 129, inputtext);

                format(szQuery, sizeof(szQuery), "INSERT INTO `users` (name, password, IP) VALUES ('%s', '%s', '%s')", GetName(playerid), playerVariables[playerid][ppassword], playerVariables[playerid][pip]);
                mysql_function_query(handle, szQuery, true, "insertAccount", "ii", THREAD_NO_RESULT, playerid);
                
                format(szMediumString, 156, "New account: %s (%d).", szPlayerName, playerid);
                //submitToAdmins(COLOR_RED, szMediumString, 1);
                SendClientMessage(playerid, -1, szMediumString);

                ShowPlayerDialog(playerid, DIALOG_LANGUAGE, DIALOG_STYLE_MSGBOX, "SERVER: Language", "Alege limba in care vor fi afisate mesajele.\nChoose the language that you speak.", "Romana", "English");
            }
        }
           case DIALOG_LANGUAGE: {
            if(response) {
                playerVariables[playerid][pLanguage] = 2; SendClientMessage(playerid, -1, "Limba setata: romana.", "[EN] To set the language to English, use /en.");
            }
            else {
                playerVariables[playerid][pLanguage] = 1; SendClientMessage(playerid, -1, "Language set to english.", "[RO] Pentru a seta limba romana foloseste /ro.");
            }
            ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_LIST, "Alege sexul caracterului", "Barbat\nFemeie", "Alege");
            SendClientMessage(playerid, 0xFFFB00FF, "Alege sexul caracterului tau.");
        }
        case DIALOG_SEX: {
            switch(listitem) {
                case 0: {
                    SendClientMessage(playerid, 0xFFFB00FF, "Sex setat: barbat.");
                    playerVariables[playerid][psex] = 1;
                }
                case 1: {
                    SendClientMessage(playerid, 0xFFFB00FF, "Sex setat: femeie.");
                    playerVariables[playerid][psex] = 2;
                }
            }
            ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Varsta", "Scrie varsta caracterului tau:", "Ok");
    }
    return 1;
}

 

C:\Users\Costin\Desktop\0.3\gamemodes\gm.pwn(237) : warning 209: function "OnDialogResponse" should return a value
C:\Users\Costin\Desktop\0.3\gamemodes\gm.pwn(238) : error 010: invalid function or declaration

Citat

- la case DIALOG_LANGUAGE: { 

Dar nu inteleg de ce.
 

Citat

 

C:\Users\Costin\Desktop\0.3\gamemodes\gm.pwn(239) : error 010: invalid function or declaration

            if(response) {
                playerVariables[playerid][pLanguage] = 2; SendClientMessage(playerid, -1, "Limba setata: romana.", "[EN] To set the language to English, use /en.");
            }

 


C:\Users\Costin\Desktop\0.3\gamemodes\gm.pwn(242) : error 010: invalid function or declaration

Citat

case DIALOG_LANGUAGE: {
            if(response) {
                playerVariables[playerid][pLanguage] = 2; SendClientMessage(playerid, -1, "Limba setata: romana.", "[EN] To set the language to English, use /en.");
            }
            else {
                playerVariables[playerid][pLanguage] = 1; SendClientMessage(playerid, -1, "Language set to english.", "[RO] Pentru a seta limba romana foloseste /ro.");
            }
            ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_LIST, "Alege sexul caracterului", "Barbat\nFemeie", "Alege");
            SendClientMessage(playerid, 0xFFFB00FF, "Alege sexul caracterului tau.");
        }

Toate astea dau eroare la:

	case DIALOG_SEX: {
			switch(listitem) {
				case 0: {
					SendClientMessage(playerid, 0xFFFB00FF, "Sex setat: barbat.");
					playerVariables[playerid][psex] = 1;
				}
				case 1: {
				    SendClientMessage(playerid, 0xFFFB00FF, "Sex setat: femeie.");
				    playerVariables[playerid][psex] = 2;
				}
			}
			ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Varsta", "Scrie varsta caracterului tau:", "Ok");
		}

C:\Users\Costin\Desktop\0.3\gamemodes\gm.pwn(248) : error 010: invalid function or declaration
C:\Users\Costin\Desktop\0.3\gamemodes\gm.pwn(249) : error 010: invalid function or declaration
C:\Users\Costin\Desktop\0.3\gamemodes\gm.pwn(250) : error 010: invalid function or declaration
C:\Users\Costin\Desktop\0.3\gamemodes\gm.pwn(254) : error 010: invalid function or declaration
C:\Users\Costin\Desktop\0.3\gamemodes\gm.pwn(261) : error 010: invalid function or declaration

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    switch(dialogid) {
          case DIALOG_REGISTER: {
			if(!response) return Kick(playerid);
            if(strlen(inputtext) < 6 || strlen(inputtext) > 32) {
                format(szMessage, -1, "Hello %s. Welcome to server!", szPlayerName);
                SendClientMessage(playerid, 0x844185FF, szMessage);
                SendClientMessage(playerid, -1, "You aren't registered yet. Please enter your desired password in the dialog box to register.");
                ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "SERVER: Registration", "{844185}Hello.\n\{FFFFFF}Please enter your desired password below!", "Register", "Cancel");
                /*format(string, sizeof(string),"{FFFFFF}Please enter your desired password below!",GetName(playerid));
                ShowPlayerDialog(playerid, DIALOG_REGISTER,DIALOG_STYLE_PASSWORD, "SERVER: Registration", string, "Register", "Cancel");*/
            }
            else {
                WP_Hash(playerVariables[playerid][ppassword], 129, inputtext);

                format(szQuery, sizeof(szQuery), "INSERT INTO `users` (name, password, IP) VALUES ('%s', '%s', '%s')", GetName(playerid), playerVariables[playerid][ppassword], playerVariables[playerid][pip]);
                mysql_function_query(handle, szQuery, true, "insertAccount", "ii", THREAD_NO_RESULT, playerid);
                
                format(szMediumString, 156, "New account: %s (%d).", szPlayerName, playerid);
                //submitToAdmins(COLOR_RED, szMediumString, 1);
                SendClientMessage(playerid, -1, szMediumString);

                ShowPlayerDialog(playerid, DIALOG_LANGUAGE, DIALOG_STYLE_MSGBOX, "SERVER: Language", "Alege limba in care vor fi afisate mesajele.\nChoose the language that you speak.", "Romana", "English");
            }
		}
		case DIALOG_LANGUAGE: {
			if(response) {
                playerVariables[playerid][pLanguage] = 2; SendClientMessage(playerid, -1, "Limba setata: romana.", "[EN] To set the language to English, use /en.");
            }
            else {
                playerVariables[playerid][pLanguage] = 1; SendClientMessage(playerid, -1, "Language set to english.", "[RO] Pentru a seta limba romana foloseste /ro.");
            }
            ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_LIST, "Alege sexul caracterului", "Barbat\nFemeie", "Alege");
            SendClientMessage(playerid, 0xFFFB00FF, "Alege sexul caracterului tau.");
        }
        case DIALOG_SEX: {
            switch(listitem) {
                case 0: {
                    SendClientMessage(playerid, 0xFFFB00FF, "Sex setat: barbat.");
                    playerVariables[playerid][psex] = 1;
                }
                case 1: {
                    SendClientMessage(playerid, 0xFFFB00FF, "Sex setat: femeie.");
                    playerVariables[playerid][psex] = 2;
                }
            }
            ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Varsta", "Scrie varsta caracterului tau:", "Ok");
        }
    }
    return 1;
}

incearca

  • Upvote 1
Link to comment
Share on other sites

  • 1
Chiar acum, Browse a spus:
enum pVar { pSQLID, pip[16], pname[MAX_PLAYER_NAME], ppassword[129], pLanguage, psex, page }
new playerVariables[MAX_PLAYERS][pVar];

 

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    switch(dialogid) {
          case DIALOG_REGISTER: {
			if(!response) return Kick(playerid);
            if(strlen(inputtext) < 6 || strlen(inputtext) > 32) {
                format(szMessage, -1, "Hello %s. Welcome to server!", szPlayerName);
                SendClientMessage(playerid, 0x844185FF, szMessage);
                SendClientMessage(playerid, -1, "You aren't registered yet. Please enter your desired password in the dialog box to register.");
                ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "SERVER: Registration", "{844185}Hello.\n\{FFFFFF}Please enter your desired password below!", "Register", "Cancel");
                /*format(string, sizeof(string),"{FFFFFF}Please enter your desired password below!",GetName(playerid));
                ShowPlayerDialog(playerid, DIALOG_REGISTER,DIALOG_STYLE_PASSWORD, "SERVER: Registration", string, "Register", "Cancel");*/
            }
            else {
                WP_Hash(playerVariables[playerid][ppassword], 129, inputtext);

                format(szQuery, sizeof(szQuery), "INSERT INTO `users` (name, password, IP) VALUES ('%s', '%s', '%s')", GetName(playerid), playerVariables[playerid][ppassword], playerVariables[playerid][pip]);
                mysql_function_query(handle, szQuery, true, "insertAccount", "ii", THREAD_NO_RESULT, playerid);
                
                format(szMediumString, 156, "New account: %s (%d).", szPlayerName, playerid);
                //submitToAdmins(COLOR_RED, szMediumString, 1);
                SendClientMessage(playerid, -1, szMediumString);

                ShowPlayerDialog(playerid, DIALOG_LANGUAGE, DIALOG_STYLE_MSGBOX, "SERVER: Language", "Alege limba in care vor fi afisate mesajele.\nChoose the language that you speak.", "Romana", "English");
            }
		}
		case DIALOG_LANGUAGE: {
			if(response) {
                playerVariables[playerid][pLanguage] = 2; SendClientMessage(playerid, -1, "[EN] To set the language to English, use /en.");
            }
            else {
                playerVariables[playerid][pLanguage] = 1; SendClientMessage(playerid, -1, "[RO] Pentru a seta limba romana foloseste /ro.");
            }
            ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_LIST, "Alege sexul caracterului", "Barbat\nFemeie", "Alege");
            SendClientMessage(playerid, 0xFFFB00FF, "Alege sexul caracterului tau.");
        }
        case DIALOG_SEX: {
            switch(listitem) {
                case 0: {
                    SendClientMessage(playerid, 0xFFFB00FF, "Sex setat: barbat.");
                    playerVariables[playerid][psex] = 1;
                }
                case 1: {
                    SendClientMessage(playerid, 0xFFFB00FF, "Sex setat: femeie.");
                    playerVariables[playerid][psex] = 2;
                }
            }
            ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Varsta", "Scrie varsta caracterului tau:", "Ok");
        }
    }
    return 1;
}

 

  • Upvote 1
Link to comment
Share on other sites

  • 0
1 oră în urmă, MiritaXD a spus:


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    switch(dialogid) {
          case DIALOG_REGISTER: {
			if(!response) return Kick(playerid);
            if(strlen(inputtext) < 6 || strlen(inputtext) > 32) {
                format(szMessage, -1, "Hello %s. Welcome to server!", szPlayerName);
                SendClientMessage(playerid, 0x844185FF, szMessage);
                SendClientMessage(playerid, -1, "You aren't registered yet. Please enter your desired password in the dialog box to register.");
                ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "SERVER: Registration", "{844185}Hello.\n\{FFFFFF}Please enter your desired password below!", "Register", "Cancel");
                /*format(string, sizeof(string),"{FFFFFF}Please enter your desired password below!",GetName(playerid));
                ShowPlayerDialog(playerid, DIALOG_REGISTER,DIALOG_STYLE_PASSWORD, "SERVER: Registration", string, "Register", "Cancel");*/
            }
            else {
                WP_Hash(playerVariables[playerid][ppassword], 129, inputtext);

                format(szQuery, sizeof(szQuery), "INSERT INTO `users` (name, password, IP) VALUES ('%s', '%s', '%s')", GetName(playerid), playerVariables[playerid][ppassword], playerVariables[playerid][pip]);
                mysql_function_query(handle, szQuery, true, "insertAccount", "ii", THREAD_NO_RESULT, playerid);
                
                format(szMediumString, 156, "New account: %s (%d).", szPlayerName, playerid);
                //submitToAdmins(COLOR_RED, szMediumString, 1);
                SendClientMessage(playerid, -1, szMediumString);

                ShowPlayerDialog(playerid, DIALOG_LANGUAGE, DIALOG_STYLE_MSGBOX, "SERVER: Language", "Alege limba in care vor fi afisate mesajele.\nChoose the language that you speak.", "Romana", "English");
            }
		}
		case DIALOG_LANGUAGE: {
			if(response) {
                playerVariables[playerid][pLanguage] = 2; SendClientMessage(playerid, -1, "Limba setata: romana.", "[EN] To set the language to English, use /en.");
            }
            else {
                playerVariables[playerid][pLanguage] = 1; SendClientMessage(playerid, -1, "Language set to english.", "[RO] Pentru a seta limba romana foloseste /ro.");
            }
            ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_LIST, "Alege sexul caracterului", "Barbat\nFemeie", "Alege");
            SendClientMessage(playerid, 0xFFFB00FF, "Alege sexul caracterului tau.");
        }
        case DIALOG_SEX: {
            switch(listitem) {
                case 0: {
                    SendClientMessage(playerid, 0xFFFB00FF, "Sex setat: barbat.");
                    playerVariables[playerid][psex] = 1;
                }
                case 1: {
                    SendClientMessage(playerid, 0xFFFB00FF, "Sex setat: femeie.");
                    playerVariables[playerid][psex] = 2;
                }
            }
            ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Varsta", "Scrie varsta caracterului tau:", "Ok");
        }
    }
    return 1;
}

incearca

case DIALOG_LANGUAGE: {
			if(response) {
                playerVariables[playerid][pLanguage] = 2; SendClientMessage(playerid, -1, "Limba setata: romana.", "[EN] To set the language to English, use /en."); //linia 246
            }
            else {
                playerVariables[playerid][pLanguage] = 1; SendClientMessage(playerid, -1, "Language set to english.", "[RO] Pentru a seta limba romana foloseste /ro."); // linia 249
            }
            ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_LIST, "Alege sexul caracterului", "Barbat\nFemeie", "Alege"); //linia 251
            SendClientMessage(playerid, 0xFFFB00FF, "Alege sexul caracterului tau.");
        }
        case DIALOG_SEX: {
            switch(listitem) {
                case 0: {
                    SendClientMessage(playerid, 0xFFFB00FF, "Sex setat: barbat.");
                    playerVariables[playerid][psex] = 1;
                }
                case 1: {
                    SendClientMessage(playerid, 0xFFFB00FF, "Sex setat: femeie.");
                    playerVariables[playerid][psex] = 2;
                }
            }
            ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Varsta", "Scrie varsta caracterului tau:", "Ok"); // linia 265
        }
    }
    return 1;
}

C:\Users\Costin\Desktop\0.3\gamemodes\nephrite.pwn(246) : warning 202: number of arguments does not match definition
C:\Users\Costin\Desktop\0.3\gamemodes\nephrite.pwn(249) : warning 202: number of arguments does not match definition
C:\Users\Costin\Desktop\0.3\gamemodes\nephrite.pwn(251) : warning 202: number of arguments does not match definition
C:\Users\Costin\Desktop\0.3\gamemodes\nephrite.pwn(265) : warning 202: number of arguments does not match definition

 

Nu am DIALOG_AGE, dar este definit.

Link to comment
Share on other sites

  • 0
Acum 22 minute, Browse a spus:
case DIALOG_LANGUAGE: {
			if(response) {
                playerVariables[playerid][pLanguage] = 2; SendClientMessage(playerid, -1, "Limba setata: romana.", "[EN] To set the language to English, use /en."); //linia 246
            }
            else {
                playerVariables[playerid][pLanguage] = 1; SendClientMessage(playerid, -1, "Language set to english.", "[RO] Pentru a seta limba romana foloseste /ro."); // linia 249
            }
            ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_LIST, "Alege sexul caracterului", "Barbat\nFemeie", "Alege"); //linia 251
            SendClientMessage(playerid, 0xFFFB00FF, "Alege sexul caracterului tau.");
        }
        case DIALOG_SEX: {
            switch(listitem) {
                case 0: {
                    SendClientMessage(playerid, 0xFFFB00FF, "Sex setat: barbat.");
                    playerVariables[playerid][psex] = 1;
                }
                case 1: {
                    SendClientMessage(playerid, 0xFFFB00FF, "Sex setat: femeie.");
                    playerVariables[playerid][psex] = 2;
                }
            }
            ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Varsta", "Scrie varsta caracterului tau:", "Ok"); // linia 265
        }
    }
    return 1;
}

C:\Users\Costin\Desktop\0.3\gamemodes\nephrite.pwn(246) : warning 202: number of arguments does not match definition
C:\Users\Costin\Desktop\0.3\gamemodes\nephrite.pwn(249) : warning 202: number of arguments does not match definition
C:\Users\Costin\Desktop\0.3\gamemodes\nephrite.pwn(251) : warning 202: number of arguments does not match definition
C:\Users\Costin\Desktop\0.3\gamemodes\nephrite.pwn(265) : warning 202: number of arguments does not match definition

 

Nu am DIALOG_AGE, dar este definit.

Arata cum sunt declarate

  • Upvote 1
Link to comment
Share on other sites

  • 0
ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_LIST, "Alege sexul caracterului", "Barbat/nFemeie", "Alege");
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Varsta", "Scrie varsta caracterului tau:", "Ok");

C:\Users\Costin\Desktop\0.3\gamemodes\nephrite.pwn(252) : warning 202: number of arguments does not match definition
C:\Users\Costin\Desktop\0.3\gamemodes\nephrite.pwn(266) : warning 202: number of arguments does not match definition

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.