• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Windows Character creating problem (Avesta distrubtion (SQL))

Nikkster

Programmer
Joined
May 9, 2008
Messages
2,848
Reaction score
9
Location
Confidential
Hey there,

I've been trying to fix this on my own but can't figure out a solution so I was hoping I could get some support here.

I've tried to manually create the players in the DB and used a 7.6 Nicaw AAC (Noone works, getting the same error). Here's the error:

Code:
Player::make() Cannot insert attributes:
Error #1452
INSERT INTO `players` (`id`,`name`,`account_id`,`group_id`,`rank_id`,`vocation`,`sex`,`level`,`experience`,`health`,`healthmax`,`looktype`,`maglevel`,`mana`,`manamax`,`cap`,`town_id`,`posx`,`posy`,`posz`,`conditions`) VALUES (NULL,'Nikkster',649096,1,0,1,1,8,4200,185,185,130,0,40,40,470,1,410,573,7,'');
Cannot add or update a child row: a foreign key constraint fails (`tibiaserver`.`players`, CONSTRAINT `players_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`))

player.php on line: 192
Script was terminated because something unexpected happened. You can report this, if you think it's a bug.

And a similar problem when I'm manually trying to create the players.

Here is the SQL code (When creating the players table)
PHP:
CREATE TABLE `players` (
    `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(255) NOT NULL,
    `account_id` INT UNSIGNED NOT NULL,
    `group_id` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'users group',
    `sex` INT UNSIGNED NOT NULL DEFAULT 0,
    `vocation` INT UNSIGNED NOT NULL DEFAULT 0,
    `experience` BIGINT UNSIGNED NOT NULL DEFAULT 0,
    `level` INT UNSIGNED NOT NULL DEFAULT 1,
    `maglevel` INT UNSIGNED NOT NULL DEFAULT 0,
    `health` INT UNSIGNED NOT NULL DEFAULT 100,
    `healthmax` INT UNSIGNED NOT NULL DEFAULT 100,
    `mana` INT UNSIGNED NOT NULL DEFAULT 100,
    `manamax` INT UNSIGNED NOT NULL DEFAULT 100,
    `manaspent` INT UNSIGNED NOT NULL DEFAULT 0,
    `soul` INT UNSIGNED NOT NULL DEFAULT 0,
    `direction` INT UNSIGNED NOT NULL DEFAULT 0,
    `lookbody` INT UNSIGNED NOT NULL DEFAULT 10,
    `lookfeet` INT UNSIGNED NOT NULL DEFAULT 10,
    `lookhead` INT UNSIGNED NOT NULL DEFAULT 10,
    `looklegs` INT UNSIGNED NOT NULL DEFAULT 10,
    `looktype` INT UNSIGNED NOT NULL DEFAULT 136,
    `posx` INT NOT NULL DEFAULT 0,
    `posy` INT NOT NULL DEFAULT 0,
    `posz` INT NOT NULL DEFAULT 0,
    `cap` INT NOT NULL DEFAULT 0,
    `lastlogin` INT UNSIGNED NOT NULL DEFAULT 0,
    `lastip` INT UNSIGNED NOT NULL DEFAULT 0,
    `save` TINYINT(1) NOT NULL DEFAULT TRUE,
    `conditions` BLOB NOT NULL COMMENT 'drunk, poisoned etc (maybe also food and redskull)',
    `redskulltime` INT UNSIGNED NOT NULL DEFAULT 0,
    `redskull` TINYINT(1) NOT NULL DEFAULT FALSE,
    `guildnick` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'additional nick in guild - mostly for web interfaces i think',
    `loss_experience` INT NOT NULL DEFAULT 10,
    `loss_mana` INT NOT NULL DEFAULT 10,
    `loss_skills` INT NOT NULL DEFAULT 10,
    `loss_items` INT NOT NULL DEFAULT 10,
    `rank_id` INT UNSIGNED NOT NULL COMMENT 'by this field everything with guilds is done - player has a rank which belongs to certain guild',
    `town_id` INT NOT NULL COMMENT 'old masterpos, temple spawn point position',
    `balance` INT NOT NULL DEFAULT 0 COMMENT 'money balance of the player for houses paying',
    PRIMARY KEY (`id`),
    UNIQUE (`name`),
    FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
    FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`)
) ENGINE = InnoDB;

Any help would be appreciated
 
Back
Top Bottom