Creating Character error, again.
#1

pawn Код:
forward CreateCharacter(playerid, charactername[],playercash, playerbank, playerskin); // Creates a character.
public CreateCharacter(playerid, charactername[], playercash, playerbank, playerskin)
{
    if(AccountExists(playerid)) // Checking if master account exists.
    {
        if(MasterAccount[playerid][mLoggedIn]) // Checking if players logged in.
        {
            if(!CharacterExists(charactername)) // Continue if character does not exist.
            {
                if(PlayerCharacterCount(playerid) <= MAX_CHARACTER_SLOTS) // Checking if player has went over his character limit.
                {
                    if(strlen(charactername) >= 1)
                    {
                        new query[256];
                        format(query, sizeof(query), "INSERT INTO `PlayerCharacter` cName=%s, cOwnerID=%d, Level=%d, cAdminLevel=%d, cCash=%d, cBank=%d, cMask=%d, ExperiencePoints=%d, SpawnPoint=%d, CellPhoneNumber=%d, Accent='%s', CellBattery=%d, Job=%d, cID=%d, Deaths=%d, Kills=%d, CarKey1=%d, CarKey2=%d, CarKey3=%d WHERE Username='%s'",
                        /*cName,
                        cOwnerID,
                        Level,
                        cAdminLevel,
                        cCash,
                        cBank,
                        cMask,
                        ExperiencePoints,
                        SpawnPoint,
                        CellPhoneNumber,
                        Accent,
                        CellBattery,
                        Job,
                        cID,
                        Deaths,
                        Kills,
                        CarKey1,
                        CarKey2,
                        CarKey3,*/

                        MasterAccount[playerid][mID]);
                        mysql_query(1, query);
                        format(query, sizeof(query), "Your character ID = %d.", Character[playerid][cID]);
                        SendClientMessage(playerid, COLOR_WHITE, query);
                        return true;
                       
                       
                        //"INSERT INTO `PlayerCharacter` (`admin_level`,`cash`,`sex`,`age`,`bank`,`skin`,`religion`,`name`,`owner_id`) VALUES ( 0, %d, %d, %d, %d, %d, %d, '%s', %d)"
                    }
                    else
                    {
                        ShowPlayerDialog(playerid,DIALOG_MAIN_MENU_CREATE_CHARACTER_NAME,DIALOG_STYLE_INPUT,"Master Account - New Character","You left the character name field blank.\n(Firstname Lastname format).","Continue","Go Back");
                    }
                }
                else
                {
                    ShowMenuDialog(playerid);
                    SendClientMessage(playerid, COLOR_RED, "[I:] You have exceeded your character limit, and cannot create a new character.");
                }
            }
            else
            {
                ShowPlayerDialog(playerid,DIALOG_MAIN_MENU_CREATE_CHARACTER_NAME,DIALOG_STYLE_INPUT,"Master Account - New Character","That character name already exists, choose another.\n(Firstname Lastname format).","Continue","Go Back");
            }
        }
    }
    return false;
}
pawn Код:
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(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(inputtext, //2526
                GetPVarStringEx(playerid, "TEMP_C_NAME"),
               
               
                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.
        }
    } //2540
    return 1;
}

// Final step of Creating a Character.
pawn Код:
MyProject.pwn(2526) : error 035: argument type mismatch (argument 1)
MyProject.pwn(2526 -- 2529) : warning 213: tag mismatch
MyProject.pwn(2526 -- 2529) : error 001: expected token: ",", but found ";"
Sorry about this, I have no idea how I could fix it.
CreateCharacter(playerid)
That doesn't work..
Reply
#2

Show us your CreatCharacter forward / stock

Or try

CreateCharacter(playerid,inputtext);
Reply
#3

It's the first code?
Please read..
Reply
#4

Fixed
Reply


Forum Jump:


Users browsing this thread: