added /clearinventory /clearloadout

This commit is contained in:
ElPumpo
2018-12-29 14:07:04 +01:00
parent e6f07a6f80
commit 4279cc03f7
9 changed files with 94 additions and 9 deletions
+5
View File
@@ -46,6 +46,7 @@ Locales['br'] = {
['act_imp'] = 'acao impossivel',
['in_vehicle'] = 'voce nao pode dar nada para alguem no veiculo',
['cannot_pickup_room'] = 'voce nao tem espaço suficiente no seu inventario para pegar ~y~%s~s~!',
-- Commands
['setjob'] = 'atribuir um trabalho a um usuario',
['id_param'] = 'o ID do jogador',
@@ -77,9 +78,13 @@ Locales['br'] = {
['disconnect'] = 'disconnect from the server',
['chat_clear'] = 'clear the chat',
['chat_clear_all'] = 'clear the chat for everyone',
['command_clearinventory'] = 'clear all items from inventory',
['command_clearloadout'] = 'remove all weapons from loadout',
['command_playerid_param'] = 'specify playerId or leave blank for yourself',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
['locale_currency'] = '$%s',
-- Weapons
['weapon_knife'] = 'faca',
['weapon_nightstick'] = 'cacetete',
+5
View File
@@ -46,6 +46,7 @@ Locales['cs'] = {
['act_imp'] = 'akce není možná',
['in_vehicle'] = 'nemůže nic dát osobě ve vozidle',
['cannot_pickup_room'] = 've vašem inventáři není dostatek místa pro ~y~%s~s~!',
-- Commands
['setjob'] = 'přiřadit práci hráči',
['id_param'] = 'iD hráče',
@@ -77,9 +78,13 @@ Locales['cs'] = {
['disconnect'] = 'odpojit od serveru',
['chat_clear'] = 'vyčistit chat',
['chat_clear_all'] = 'vyčistit chat pro všechny',
['command_clearinventory'] = 'clear all items from inventory',
['command_clearloadout'] = 'remove all weapons from loadout',
['command_playerid_param'] = 'specify playerId or leave blank for yourself',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
['locale_currency'] = '$%s',
-- Weapons
['weapon_knife'] = 'knife',
['weapon_nightstick'] = 'nightstick',
+5
View File
@@ -46,6 +46,7 @@ Locales['de'] = {
['act_imp'] = 'Aktion nicht möglich',
['in_vehicle'] = 'you can\'t give anything to someone in a vehicle',
['cannot_pickup_room'] = 'you do not have enough space in your inventory to pick up ~y~%s~s~!',
-- Commands
['setjob'] = 'assign a job to a user',
['id_param'] = 'the ID of the player',
@@ -77,9 +78,13 @@ Locales['de'] = {
['disconnect'] = 'disconnect from the server',
['chat_clear'] = 'clear the chat',
['chat_clear_all'] = 'clear the chat for everyone',
['command_clearinventory'] = 'clear all items from inventory',
['command_clearloadout'] = 'remove all weapons from loadout',
['command_playerid_param'] = 'specify playerId or leave blank for yourself',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
['locale_currency'] = '$%s',
-- Weapons
['weapon_knife'] = 'Messer',
['weapon_nightstick'] = 'Schlagstock',
+11 -6
View File
@@ -46,6 +46,7 @@ Locales['en'] = {
['act_imp'] = 'action impossible',
['in_vehicle'] = 'you can\'t give anything to someone in a vehicle',
['cannot_pickup_room'] = 'you do not have enough space in your inventory to pick up ~y~%s~s~!',
-- Commands
['setjob'] = 'assign a job to a user',
['id_param'] = 'the ID of the player',
@@ -77,9 +78,13 @@ Locales['en'] = {
['disconnect'] = 'disconnect from the server',
['chat_clear'] = 'clear the chat',
['chat_clear_all'] = 'clear the chat for everyone',
['command_clearinventory'] = 'clear all items from inventory',
['command_clearloadout'] = 'remove all weapons from loadout',
['command_playerid_param'] = 'specify playerId or leave blank for yourself',
-- Locale settings
['locale_digit_grouping_symbol'] = ',',
['locale_currency'] = '$%s',
-- Weapons
['weapon_knife'] = 'knife',
['weapon_nightstick'] = 'nightstick',
@@ -89,16 +94,16 @@ Locales['en'] = {
['weapon_crowbar'] = 'crow bar',
['weapon_pistol'] = 'pistol',
['weapon_combatpistol'] = 'combat pistol',
['weapon_appistol'] = 'ap pistol',
['weapon_appistol'] = 'AP pistol',
['weapon_pistol50'] = 'pistol .50',
['weapon_microsmg'] = 'micro smg',
['weapon_smg'] = 'smg',
['weapon_assaultsmg'] = 'assault smg',
['weapon_microsmg'] = 'micro SMG',
['weapon_smg'] = 'SMG',
['weapon_assaultsmg'] = 'assault SMG',
['weapon_assaultrifle'] = 'assault rifle',
['weapon_carbinerifle'] = 'carbine rifle',
['weapon_advancedrifle'] = 'advanced rifle',
['weapon_mg'] = 'mg',
['weapon_combatmg'] = 'combat mg',
['weapon_mg'] = 'MG',
['weapon_combatmg'] = 'combat MG',
['weapon_pumpshotgun'] = 'pump shotgun',
['weapon_sawnoffshotgun'] = 'sawed off shotgun',
['weapon_assaultshotgun'] = 'assault shotgun',
+5
View File
@@ -46,6 +46,7 @@ Locales['fi'] = {
['act_imp'] = 'toiminto mahdoton',
['in_vehicle'] = 'et voi antaa ajoneuvossa olevalle mitään.',
['cannot_pickup_room'] = 'sinulla ei ole tilaa repussa nostaaksesi ~y~%s~s~!',
-- Commands
['setjob'] = 'määritä työ käyttäjälle',
['id_param'] = 'käyttäjän ID',
@@ -77,9 +78,13 @@ Locales['fi'] = {
['disconnect'] = 'poistu serveriltä',
['chat_clear'] = 'tyhjennä chatti',
['chat_clear_all'] = 'tyhjennä chatti kaikilta',
['command_clearinventory'] = 'clear all items from inventory',
['command_clearloadout'] = 'remove all weapons from loadout',
['command_playerid_param'] = 'specify playerId or leave blank for yourself',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
['locale_currency'] = '$%s',
-- Weapons
['weapon_knife'] = 'veitsi',
['weapon_nightstick'] = 'pamppu',
+5
View File
@@ -46,6 +46,7 @@ Locales['fr'] = {
['act_imp'] = 'action impossible',
['in_vehicle'] = 'Vous ne pouvez rien donner à quelqu\'un dans un véhicule',
['cannot_pickup_room'] = 'vous n\'avez plus de place pour ~y~%s~s~!',
-- Commands
['setjob'] = 'assigner job',
['id_param'] = 'identification du joueur',
@@ -77,9 +78,13 @@ Locales['fr'] = {
['disconnect'] = 'disconnect from the server',
['chat_clear'] = 'clear the chat',
['chat_clear_all'] = 'clear the chat for everyone',
['command_clearinventory'] = 'clear all items from inventory',
['command_clearloadout'] = 'remove all weapons from loadout',
['command_playerid_param'] = 'specify playerId or leave blank for yourself',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
['locale_currency'] = '$%s',
-- Weapons
['weapon_knife'] = 'couteau',
['weapon_nightstick'] = 'matraque',
+5
View File
@@ -46,6 +46,7 @@ Locales['pl'] = {
['act_imp'] = 'działanie niemożliwe',
['in_vehicle'] = 'nie możesz przekazywać przedmiotów w pojeździe',
['cannot_pickup_room'] = 'nie masz wystarczająco dużo miejsca w ekwipunku, aby podnieść ~y~%s~s~!',
-- Commands
['setjob'] = 'przydziel prace użytkownikowi',
['id_param'] = 'iD użyszkodnika',
@@ -77,9 +78,13 @@ Locales['pl'] = {
['disconnect'] = 'odłącz się od serwera',
['chat_clear'] = 'clear the chat',
['chat_clear_all'] = 'clear the chat for everyone',
['command_clearinventory'] = 'clear all items from inventory',
['command_clearloadout'] = 'remove all weapons from loadout',
['command_playerid_param'] = 'specify playerId or leave blank for yourself',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
['locale_currency'] = '$%s',
-- Weapons
['weapon_knife'] = 'nóż',
['weapon_nightstick'] = 'pałka',
+5
View File
@@ -46,6 +46,7 @@ Locales['sv'] = {
['act_imp'] = 'åtgärd omöjlig',
['in_vehicle'] = 'du kan inte ge saker till en som sitter i ett fordon!',
['cannot_pickup_room'] = 'du har inte plats för att plocka upp ~y~%s~s~!',
-- Commands
['setjob'] = 'tilldela ett jobb till en användare',
['id_param'] = 'spelarens ID',
@@ -77,9 +78,13 @@ Locales['sv'] = {
['disconnect'] = 'koppla från servern',
['chat_clear'] = 'töm chatten',
['chat_clear_all'] = 'töm chatten för alla',
['command_clearinventory'] = 'clear all items from inventory',
['command_clearloadout'] = 'remove all weapons from loadout',
['command_playerid_param'] = 'specify playerId or leave blank for yourself',
-- Locale settings
['locale_digit_grouping_symbol'] = ' ',
['locale_currency'] = '%s SEK',
-- Weapons
['weapon_knife'] = 'kniv',
['weapon_nightstick'] = 'batong',
+48 -3
View File
@@ -19,13 +19,14 @@ end, {help = "Teleport to coordinates", params = {{name = "x", help = "X coords"
TriggerEvent('es:addGroupCommand', 'setjob', 'jobmaster', function(source, args, user)
if tonumber(args[1]) and args[2] and tonumber(args[3]) then
local xPlayer = ESX.GetPlayerFromId(args[1])
if xPlayer ~= nil then
if xPlayer then
xPlayer.setJob(args[2], tonumber(args[3]))
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Player not online.")
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Player not online.' } })
end
else
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Invalid usage.")
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Invalid usage.' } })
end
end, function(source, args, user)
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } })
@@ -200,3 +201,47 @@ TriggerEvent('es:addGroupCommand', 'clearall', 'admin', function(source, args, u
end, function(source, args, user)
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } })
end, {help = _U('chat_clear_all')})
TriggerEvent('es:addGroupCommand', 'clearinventory', 'admin', function(source, args, user)
local xPlayer
if args[1] then
xPlayer = ESX.GetPlayerFromId(args[1])
else
xPlayer = ESX.GetPlayerFromId(source)
end
if not xPlayer then
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Player not online.' } })
return
end
for i=1, #xPlayer.inventory, 1 do
if xPlayer.inventory[i].count > 0 then
xPlayer.setInventoryItem(xPlayer.inventory[i].name, 0)
end
end
end, function(source, args, user)
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } })
end, {help = _U('command_clearinventory'), params = {{name = "playerId", help = _U('command_playerid_param')}}})
TriggerEvent('es:addGroupCommand', 'clearloadout', 'admin', function(source, args, user)
local xPlayer
if args[1] then
xPlayer = ESX.GetPlayerFromId(args[1])
else
xPlayer = ESX.GetPlayerFromId(source)
end
if not xPlayer then
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Player not online.' } })
return
end
for i=1, #xPlayer.loadout, 1 do
xPlayer.removeWeapon(xPlayer.loadout[i].name)
end
end, function(source, args, user)
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } })
end, {help = _U('command_clearloadout'), params = {{name = "playerId", help = _U('command_playerid_param')}}})