Skip to content

Commit

Permalink
Add translation to HorseComp (#128)
Browse files Browse the repository at this point in the history
* Add translation to HorseComp

Now you can add your custom translation for Horse Components

* Update bcc_stables.sql

* Update horseinfo.lua

* Update main.lua

- add config setting for horse training distance
- update translations to merge with Byte's pr
- housekeeping

* Update comps.lua

* Update main.lua

* Create translations

* Update fxmanifest.lua

* Update main.lua

* Update package.json

* Update App.vue

* Update TackShopMenu.vue

* Update index.js

* Update version

---------

Co-authored-by: Apollyon <37031311+JusCampin@users.noreply.github.com>
  • Loading branch information
kind-king and JusCampin authored Nov 28, 2024
1 parent c7dce41 commit 1c6a3b9
Show file tree
Hide file tree
Showing 14 changed files with 1,046 additions and 1,062 deletions.
54 changes: 24 additions & 30 deletions bcc_stables.sql
Original file line number Diff line number Diff line change
@@ -1,39 +1,33 @@
CREATE TABLE IF NOT EXISTS `player_horses` (
`id` INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
`id` INT(11) NOT NULL AUTO_INCREMENT,
`identifier` VARCHAR(50) NOT NULL,
`charid` INT(11) NOT NULL,
`selected` INT(11) NOT NULL DEFAULT 0,
`name` VARCHAR(100) NOT NULL,
`model` VARCHAR(100) NOT NULL,
`gender` ENUM('male', 'female') DEFAULT 'male',
`components` VARCHAR(5000) NOT NULL DEFAULT '{}',
`xp` INT(11) NOT NULL DEFAULT 0,
`health` INT(11) NOT NULL DEFAULT 50,
`stamina` INT(11) NOT NULL DEFAULT 50,
`captured` INT(11) NOT NULL DEFAULT 0,
`born` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
`dead` INT(11) NOT NULL DEFAULT 0
`components` VARCHAR(5000) NOT NULL DEFAULT '{}',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS (`gender` ENUM('male', 'female') DEFAULT 'male');
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS (`xp` INT(11) NOT NULL DEFAULT 0);
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS (`captured` INT(11) NOT NULL DEFAULT 0);
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS (`born` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP());
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS (`health` INT(11) NOT NULL DEFAULT 50);
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS (`stamina` INT(11) NOT NULL DEFAULT 50);
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS (`dead` INT(11) NOT NULL DEFAULT 0);
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `gender` ENUM('male', 'female') DEFAULT 'male';
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `xp` INT(11) NOT NULL DEFAULT 0;
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `captured` INT(11) NOT NULL DEFAULT 0;
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `born` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP();
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `health` INT(11) NOT NULL DEFAULT 50;
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `stamina` INT(11) NOT NULL DEFAULT 50;
ALTER TABLE `player_horses` ADD COLUMN IF NOT EXISTS `dead` INT(11) NOT NULL DEFAULT 0;

INSERT INTO `items`(`item`, `label`, `limit`, `can_remove`, `type`, `usable`, `desc`) VALUES ('oil_lantern', 'Oil Lantern', 1, 1, 'item_standard', 1, 'A portable light source.')
ON DUPLICATE KEY UPDATE `item`='oil_lantern', `label`='Oil Lantern', `limit`=1, `can_remove`=1, `type`='item_standard', `usable`=1, `desc`='A portable light source.';

INSERT INTO `items`(`item`, `label`, `limit`, `can_remove`, `type`, `usable`, `desc`) VALUES ('consumable_horse_reviver', 'Horse Reviver', 3, 1, 'item_standard', 1, 'Curative compound for injured horse.')
ON DUPLICATE KEY UPDATE `item`='consumable_horse_reviver', `label`='Horse Reviver', `limit`=3, `can_remove`=1, `type`='item_standard', `usable`=1, `desc`='Curative compound for injured horse.';

INSERT INTO `items`(`item`, `label`, `limit`, `can_remove`, `type`, `usable`, `desc`) VALUES ('consumable_haycube', 'Haycube', 10, 1, 'item_standard', 1, 'A compact cube of hay.')
ON DUPLICATE KEY UPDATE `item`='consumable_haycube', `label`='Haycube', `limit`=10, `can_remove`=1, `type`='item_standard', `usable`=1, `desc`='A compact cube of hay.';

INSERT INTO `items`(`item`, `label`, `limit`, `can_remove`, `type`, `usable`, `desc`) VALUES ('consumable_apple', 'Apple', 10, 1, 'item_standard', 1, 'A juicy and deliciuos fruit.')
ON DUPLICATE KEY UPDATE `item`='consumable_apple', `label`='Apple', `limit`=10, `can_remove`=1, `type`='item_standard', `usable`=1, `desc`='A juicy and deliciuos fruit.';

INSERT INTO `items`(`item`, `label`, `limit`, `can_remove`, `type`, `usable`, `desc`) VALUES ('consumable_carrots', 'Carrots', 10, 1, 'item_standard', 1, 'An orange root vegetable commonly used in cooking.')
ON DUPLICATE KEY UPDATE `item`='consumable_carrots', `label`='Carrots', `limit`=10, `can_remove`=1, `type`='item_standard', `usable`=1, `desc`='An orange root vegetable commonly used in cooking.';
INSERT INTO `items`(`item`, `label`, `limit`, `can_remove`, `type`, `usable`, `desc`)
VALUES
('oil_lantern', 'Oil Lantern', 1, 1, 'item_standard', 1, 'A portable light source.'),
('consumable_horse_reviver', 'Horse Reviver', 3, 1, 'item_standard', 1, 'Curative compound for injured horse.'),
('consumable_haycube', 'Haycube', 10, 1, 'item_standard', 1, 'A compact cube of hay.'),
('consumable_apple', 'Apple', 10, 1, 'item_standard', 1, 'A juicy and deliciuos fruit.'),
('consumable_carrots', 'Carrots', 10, 1, 'item_standard', 1, 'An orange root vegetable commonly used in cooking.')
ON DUPLICATE KEY UPDATE
`label`=VALUES(`label`),
`limit`=VALUES(`limit`),
`can_remove`=VALUES(`can_remove`),
`type`=VALUES(`type`),
`usable`=VALUES(`usable`),
`desc`=VALUES(`desc`);
14 changes: 7 additions & 7 deletions client/horseinfo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ local function ListenForPromptEvent(iEventGroup, hWhichEvent, iEventDataSize, tO
-- just to make it easier we'll just write the data to a passed table
local bDataExists = Citizen.InvokeNative(0x57EC5FA4D4D6AFCA, 0, i, EventDataStruct:Buffer(), iEventDataSize) -- GET_EVENT_DATA
if bDataExists then
tOutTable[1] = EventDataStruct:GetInt32(8 * 0)
tOutTable[2] = EventDataStruct:GetInt32(8 * 1)
tOutTable[3] = EventDataStruct:GetInt32(8 * 2)
tOutTable[4] = EventDataStruct:GetInt32(8 * 3)
tOutTable[5] = EventDataStruct:GetInt32(8 * 4)
tOutTable[6] = EventDataStruct:GetInt32(8 * 5)
tOutTable[7] = EventDataStruct:GetInt32(8 * 6)
tOutTable[1] = EventDataStruct:GetInt32(8 * 0) -- Prompt Type Id
tOutTable[2] = EventDataStruct:GetInt32(8 * 1) -- Unknown
tOutTable[3] = EventDataStruct:GetInt32(8 * 2) -- Target Entity Id
tOutTable[4] = EventDataStruct:GetInt32(8 * 3) -- Unknown
tOutTable[5] = EventDataStruct:GetInt32(8 * 4) -- (float) Player Ped Coord x
tOutTable[6] = EventDataStruct:GetInt32(8 * 5) -- (float) Player Ped Coord y
tOutTable[7] = EventDataStruct:GetInt32(8 * 6) -- (float) Player Ped Coord z
else
print('ListenForPromptEvent: bDataExists was false?!')
return false
Expand Down
Loading

0 comments on commit 1c6a3b9

Please sign in to comment.