Deleting Character and Creating Character dialog.
#1

pawn Код:
case DIALOG_MAIN_MENU_CHARACTER_DELETE:
        {
            if(response)
            {
                if(strlen(inputtext) >= 1)
                {
                    if(CharacterExists(mysql_real_escape_string(inputtext, InsertPlayerUnderscoreString))) //2457
                    {
                        new escapedstring[50];
                        mysql_real_escape_string(InsertPlayerUnderscoreString(inputtext), escapedstring);
                        if(PlayerOwnsCharacter_Name(playerid, escapedstring)); //2461
                        {
                            new query[128];
                            format(query, sizeof(query), "DELETE FROM `Character` WHERE `cName` = '%s'", (InsertPlayerUnderscoreString(inputtext)); //(InsertPlayerUnderscoreString(inputtext) //2464
                           
                            format(query, sizeof(query), "[I:] You have successfully deleted character: %s.", inputtext);
                            SendClientMessage(playerid, COLOR_YELLOW, query);
                            ShowMenuDialog(playerid);
                        }
                        else //2470
                        {
                            ShowPlayerDialog(playerid,DIALOG_MAIN_MENU_CHARACTER_DELETE,DIALOG_STYLE_INPUT,"Master Account - Delete Character","What is the name of the character you wish to delete?\nYou will not be able to recover it after it has been deleted!\n(Firstname Lastname format)","Delete","Go Back");
                        }
                    }
                    else
                    {
                         ShowPlayerDialog(playerid,DIALOG_MAIN_MENU_CHARACTER_DELETE,DIALOG_STYLE_INPUT,"Master Account - Delete Character","What is the name of the character you wish to delete?\nYou will not be able to recover it after it has been deleted!\n(Firstname Lastname format)","Delete","Go Back");
                    }
                }
                else
                {
                     ShowPlayerDialog(playerid,DIALOG_MAIN_MENU_CHARACTER_DELETE,DIALOG_STYLE_INPUT,"Master Account - Delete Character","What is the name of the character you wish to delete?\nYou will not be able to recover it after it has been deleted!\n(Firstname Lastname format)","Delete","Go Back");
                }
            }
            else
            {
                ShowPlayerDialog(playerid, DIALOG_MAIN_MENU_OPTIONS, DIALOG_STYLE_LIST, "Main Menu - Options", "Create New Character\nDelete Character\nChange Password\nDisconnect", "Continue", "Go Back");
            }
        }
        case DIALOG_MAIN_MENU_CREATE_CHARACTER_NAME:
        {
            new firstname[MAX_PLAYER_NAME], lastname[MAX_PLAYER_NAME];
            if(response)
            {
                if(strlen(inputtext) >= 1 && strlen(inputtext) <= MAX_PLAYER_NAME)
                {
                    if(!CharacterExists(InsertPlayerUnderscoreString(inputtext)))
                    {
                        if(RPName(InsertPlayerUnderscoreString(inputtext), firstname, lastname))
                        {
                            SetPVarString(playerid,"TEMP_C_NAME",InsertPlayerUnderscoreString(sqlite_escape_string(inputtext))); //2501
                        }
                        else
                        {
                            ShowPlayerDialog(playerid,DIALOG_MAIN_MENU_CREATE_CHARACTER_NAME,DIALOG_STYLE_INPUT,"Master Account - New Character","The character name you entered is not a valid roleplay name.\n(Firstname Lastname format).","Continue","Go Back");
                        }
                    }
                    else
                    {
                        ShowPlayerDialog(playerid,DIALOG_MAIN_MENU_CREATE_CHARACTER_NAME,DIALOG_STYLE_INPUT,"Master Account - New Character","A character with that name is already registered, please choose another name.\n(Firstname Lastname format).","Continue","Go Back");
                    }
                }
                else
                {
                    ShowPlayerDialog(playerid,DIALOG_MAIN_MENU_CREATE_CHARACTER_NAME,DIALOG_STYLE_INPUT,"Master Account - New Character","What do you want your character to be called?\n(Firstname Lastname format).","Continue","Go Back");
                }
                CreateCharacter(playerid, //2517
                GetPVarStringEx(playerid, "TEMP_C_NAME"),
                CivilianSpawn[Float:CivX], //2519
                CivilianSpawn[Float:CivY],
                CivilianSpawn[Float:CivZ],
                CivilianSpawn[World],
                CivilianSpawn[Interior],
                CivilianSpawn[Angle],
                Settings[sDEFAULT_P_CASH],
                Settings[sDEFAULT_P_BANK],
                Settings[sDEFAULT_P_SKIN]);
                DeletePVar(playerid, "TEMP_C_NAME");
                ShowMenuDialog(playerid);
            }
            else
            {
                ShowPlayerDialog(playerid, DIALOG_MAIN_MENU_CREATE_CHARACTER_NAME, DIALOG_STYLE_LIST, "Master Account - New Character","What do you want your character to be called?\n(Firstname Lastname format).","Continue","Go Back");
            }   // Go back.
        }
    }
    return 1;
}
pawn Код:
(2457) : error 076: syntax error in the expression, or invalid function call
(2461) : error 036: empty statement
(2464) : error 001: expected token: ",", but found ";"
(2467) : error 017: undefined symbol "COLOR_YELLOW"
(2470) : error 029: invalid expression, assumed zero
(2501) : error 017: undefined symbol "sqlite_escape_string"
(2517 -- 2519) : error 017: undefined symbol "CivilianSpawn"
(2519) : warning 221: label name "Float" shadows tag name
(2519) : error 017: undefined symbol "CivX"
(2519) : error 029: invalid expression, assumed zero
(2519) : fatal error 107: too many error messages on one line
I need it in mysql with cacheing, I've tried but can't spot where the error is, or what callback/function to use.
Help is much appreciated!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)