mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 17:58:54 +00:00
f89e051756
This commit implements a new way of saving and getting player coords. Player coords are synced with its assigned xPlayer, the syncing interval is defined in the configuration file. Also coords wont sync if the player is too close to their previous location. Existing servers must change their database to account for the new length of the position varchar, at 53 chars max. There's also a column default value specified in the sql file. New xPlayer functions: - .getCoords() - .setCoords() (x,y,z,heading (optional) table - .updateCoords() The last one is used for syncing coords from client (interval). The second one will teleport the player. First one is a renamed .getLastPosition()
63 lines
1.6 KiB
SQL
63 lines
1.6 KiB
SQL
USE `essentialmode`;
|
|
|
|
ALTER TABLE `users`
|
|
ADD COLUMN `name` VARCHAR(50) NULL DEFAULT '' AFTER `money`,
|
|
ADD COLUMN `skin` LONGTEXT NULL AFTER `name`,
|
|
ADD COLUMN `job` VARCHAR(50) NULL DEFAULT 'unemployed' AFTER `skin`,
|
|
ADD COLUMN `job_grade` INT NULL DEFAULT 0 AFTER `job`,
|
|
ADD COLUMN `loadout` LONGTEXT NULL AFTER `job_grade`,
|
|
ADD COLUMN `position` VARCHAR(53) NULL DEFAULT '{"x":-269.4,"y":-955.3,"z":31.2,"heading":205.8}' AFTER `loadout`
|
|
;
|
|
|
|
CREATE TABLE `items` (
|
|
`name` VARCHAR(50) NOT NULL,
|
|
`label` VARCHAR(50) NOT NULL,
|
|
`weight` INT(11) NOT NULL DEFAULT 1,
|
|
`rare` TINYINT(1) NOT NULL DEFAULT 0,
|
|
`can_remove` TINYINT(1) NOT NULL DEFAULT 1,
|
|
|
|
PRIMARY KEY (`name`)
|
|
);
|
|
|
|
CREATE TABLE `job_grades` (
|
|
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
|
`job_name` VARCHAR(50) DEFAULT NULL,
|
|
`grade` INT(11) NOT NULL,
|
|
`name` VARCHAR(50) NOT NULL,
|
|
`label` VARCHAR(50) NOT NULL,
|
|
`salary` INT(11) NOT NULL,
|
|
`skin_male` LONGTEXT NOT NULL,
|
|
`skin_female` LONGTEXT NOT NULL,
|
|
|
|
PRIMARY KEY (`id`)
|
|
);
|
|
|
|
INSERT INTO `job_grades` VALUES (1,'unemployed',0,'unemployed','Unemployed',200,'{}','{}');
|
|
|
|
CREATE TABLE `jobs` (
|
|
`name` VARCHAR(50) NOT NULL,
|
|
`label` VARCHAR(50) DEFAULT NULL,
|
|
|
|
PRIMARY KEY (`name`)
|
|
);
|
|
|
|
INSERT INTO `jobs` VALUES ('unemployed','Unemployed');
|
|
|
|
CREATE TABLE `user_accounts` (
|
|
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
|
`identifier` VARCHAR(22) NOT NULL,
|
|
`name` VARCHAR(50) NOT NULL,
|
|
`money` INT(11) NOT NULL DEFAULT '0',
|
|
|
|
PRIMARY KEY (`id`)
|
|
);
|
|
|
|
CREATE TABLE `user_inventory` (
|
|
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
|
`identifier` VARCHAR(22) NOT NULL,
|
|
`item` VARCHAR(50) NOT NULL,
|
|
`count` INT(11) NOT NULL,
|
|
|
|
PRIMARY KEY (`id`)
|
|
);
|