From 0fc8c4d9c5028944e34ff72b73c4adb039be88d8 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 23 Mar 2020 12:10:25 +0100 Subject: [PATCH] Added /save and /saveall commands --- locales/br.lua | 2 ++ locales/cs.lua | 2 ++ locales/de.lua | 2 ++ locales/en.lua | 2 ++ locales/fi.lua | 2 ++ locales/fr.lua | 2 ++ locales/pl.lua | 2 ++ locales/sv.lua | 2 ++ server/commands.lua | 10 ++++++++++ 9 files changed, 26 insertions(+) diff --git a/locales/br.lua b/locales/br.lua index c2b46a7b..0dd62b99 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -62,6 +62,8 @@ Locales['br'] = { ['command_clearall'] = 'limpar o chat para todos', ['command_clearinventory'] = 'remover todos os itens do inventário', ['command_clearloadout'] = 'remova todas as armas do carregamento', + ['command_save'] = 'save a player to database', + ['command_saveall'] = 'save all players to database', ['command_setcoords'] = 'teleport to coordinates', ['command_setcoords_x'] = 'x axis', ['command_setcoords_y'] = 'y axis', diff --git a/locales/cs.lua b/locales/cs.lua index 178bf89f..11441283 100644 --- a/locales/cs.lua +++ b/locales/cs.lua @@ -62,6 +62,8 @@ Locales['cs'] = { ['command_clearall'] = 'clear chat for all players', ['command_clearinventory'] = 'clear player inventory', ['command_clearloadout'] = 'clear a player loadout', + ['command_save'] = 'save a player to database', + ['command_saveall'] = 'save all players to database', ['command_setcoords'] = 'teleport to coordinates', ['command_setcoords_x'] = 'x axis', ['command_setcoords_y'] = 'y axis', diff --git a/locales/de.lua b/locales/de.lua index 1b218200..c1d2fb9a 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -62,6 +62,8 @@ Locales['de'] = { ['command_clearall'] = 'clear chat for all players', ['command_clearinventory'] = 'clear player inventory', ['command_clearloadout'] = 'clear a player loadout', + ['command_save'] = 'save a player to database', + ['command_saveall'] = 'save all players to database', ['command_setcoords'] = 'teleport to coordinates', ['command_setcoords_x'] = 'x axis', ['command_setcoords_y'] = 'y axis', diff --git a/locales/en.lua b/locales/en.lua index 9c3efda4..b76aba04 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -62,6 +62,8 @@ Locales['en'] = { ['command_clearall'] = 'clear chat for all players', ['command_clearinventory'] = 'clear player inventory', ['command_clearloadout'] = 'clear a player loadout', + ['command_save'] = 'save a player to database', + ['command_saveall'] = 'save all players to database', ['command_setcoords'] = 'teleport to coordinates', ['command_setcoords_x'] = 'x axis', ['command_setcoords_y'] = 'y axis', diff --git a/locales/fi.lua b/locales/fi.lua index 9831b26e..ec4eac0e 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -62,6 +62,8 @@ Locales['fi'] = { ['command_clearall'] = 'clear chat for all players', ['command_clearinventory'] = 'clear player inventory', ['command_clearloadout'] = 'clear a player loadout', + ['command_save'] = 'save a player to database', + ['command_saveall'] = 'save all players to database', ['command_setcoords'] = 'teleport to coordinates', ['command_setcoords_x'] = 'x axis', ['command_setcoords_y'] = 'y axis', diff --git a/locales/fr.lua b/locales/fr.lua index 0e4a4fd2..c1dd3746 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -62,6 +62,8 @@ Locales['fr'] = { ['command_clearall'] = 'vider le chat pour tous', ['command_clearinventory'] = 'vider l\'inventaire d\'un joueur', ['command_clearloadout'] = 'vider le loadout d\'un joueur', + ['command_save'] = 'save a player to database', + ['command_saveall'] = 'save all players to database', ['command_setcoords'] = 'se téléporter aux coordonnées', ['command_setcoords_x'] = 'axe X', ['command_setcoords_y'] = 'axe Y', diff --git a/locales/pl.lua b/locales/pl.lua index db4f89ae..1d95f19b 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -62,6 +62,8 @@ Locales['pl'] = { ['command_clearall'] = 'clear chat for all players', ['command_clearinventory'] = 'clear player inventory', ['command_clearloadout'] = 'clear a player loadout', + ['command_save'] = 'save a player to database', + ['command_saveall'] = 'save all players to database', ['command_setcoords'] = 'teleport to coordinates', ['command_setcoords_x'] = 'x axis', ['command_setcoords_y'] = 'y axis', diff --git a/locales/sv.lua b/locales/sv.lua index b41a434e..8f9c449a 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -62,6 +62,8 @@ Locales['sv'] = { ['command_clearall'] = 'töm chatten för alla spelare', ['command_clearinventory'] = 'töm en spelares inventory', ['command_clearloadout'] = 'töm en spelares loadout', + ['command_save'] = 'spara en spelare i databas', + ['command_saveall'] = 'spara alla spelare i databas', ['command_setcoords'] = 'teleportera till koordinater', ['command_setcoords_x'] = 'x axel', ['command_setcoords_y'] = 'y axel', diff --git a/server/commands.lua b/server/commands.lua index b8a187f1..39c4a6ce 100644 --- a/server/commands.lua +++ b/server/commands.lua @@ -116,3 +116,13 @@ end, true, {help = _U('command_setgroup'), validate = true, arguments = { {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'}, {name = 'group', help = _U('command_setgroup_group'), type = 'string'}, }}) + +ESX.RegisterCommand('save', 'admin', function(xPlayer, args, showError) + ESX.SavePlayer(args.playerId) +end, true, {help = _U('command_save'), validate = true, arguments = { + {name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'} +}}) + +ESX.RegisterCommand('saveall', 'admin', function(xPlayer, args, showError) + ESX.SavePlayers() +end, true, {help = _U('command_saveall')})