diff --git a/client/main.lua b/client/main.lua index 9c8019c3..5c8be801 100644 --- a/client/main.lua +++ b/client/main.lua @@ -266,47 +266,6 @@ AddEventHandler('esx:setJob', function(job) end end) -RegisterNetEvent('esx:loadIPL') -AddEventHandler('esx:loadIPL', function(name) - Citizen.CreateThread(function() - RequestIpl(name) - end) -end) - -RegisterNetEvent('esx:unloadIPL') -AddEventHandler('esx:unloadIPL', function(name) - Citizen.CreateThread(function() - RemoveIpl(name) - end) -end) - -RegisterNetEvent('esx:playAnim') -AddEventHandler('esx:playAnim', function(dict, anim) - Citizen.CreateThread(function() - local playerPed = PlayerPedId() - RequestAnimDict(dict) - - while not HasAnimDictLoaded(dict) do - Citizen.Wait(1) - end - - TaskPlayAnim(playerPed, dict, anim, 1.0, -1.0, 20000, 0, 1, true, true, true) - end) -end) - -RegisterNetEvent('esx:playEmote') -AddEventHandler('esx:playEmote', function(emote) - Citizen.CreateThread(function() - - local playerPed = PlayerPedId() - - TaskStartScenarioInPlace(playerPed, emote, 0, false); - Citizen.Wait(20000) - ClearPedTasks(playerPed) - - end) -end) - RegisterNetEvent('esx:spawnVehicle') AddEventHandler('esx:spawnVehicle', function(model) local playerPed = PlayerPedId() @@ -317,23 +276,6 @@ AddEventHandler('esx:spawnVehicle', function(model) end) end) -RegisterNetEvent('esx:spawnObject') -AddEventHandler('esx:spawnObject', function(model) - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) - local forward = GetEntityForwardVector(playerPed) - local x, y, z = table.unpack(coords + forward * 1.0) - - ESX.Game.SpawnObject(model, { - x = x, - y = y, - z = z - }, function(obj) - SetEntityHeading(obj, GetEntityHeading(playerPed)) - PlaceObjectOnGroundProperly(obj) - end) -end) - RegisterNetEvent('esx:pickup') AddEventHandler('esx:pickup', function(id, label, player) local ped = GetPlayerPed(GetPlayerFromServerId(player)) @@ -374,25 +316,6 @@ AddEventHandler('esx:pickupWeapon', function(weaponPickup, weaponName, ammo) CreateAmbientPickup(weaponHash, pickupCoords, 0, ammo, 1, false, true) end) -RegisterNetEvent('esx:spawnPed') -AddEventHandler('esx:spawnPed', function(model) - model = (tonumber(model) ~= nil and tonumber(model) or GetHashKey(model)) - local playerPed = PlayerPedId() - local coords = GetEntityCoords(playerPed) - local forward = GetEntityForwardVector(playerPed) - local x, y, z = table.unpack(coords + forward * 1.0) - - Citizen.CreateThread(function() - RequestModel(model) - - while not HasModelLoaded(model) do - Citizen.Wait(1) - end - - CreatePed(5, model, x, y, z, 0.0, true, false) - end) -end) - RegisterNetEvent('esx:deleteVehicle') AddEventHandler('esx:deleteVehicle', function() local playerPed = PlayerPedId() diff --git a/locales/br.lua b/locales/br.lua index 6dc07cba..e2c5b503 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -53,16 +53,9 @@ Locales['br'] = { ['id_param'] = 'o ID do jogador', ['setjob_param2'] = 'o trabalho que voce deseja atribuir', ['setjob_param3'] = 'o nivel de emprego', - ['load_ipl'] = 'carregar IPL', - ['unload_ipl'] = 'descarregar o IPL', - ['play_anim'] = 'Iniciar animacao', - ['play_emote'] = 'Iniciar emote', ['spawn_car'] = 'spawn um carro', ['spawn_car_param'] = 'nome do carro', ['delete_vehicle'] = 'excluir Veiculo', - ['spawn_object'] = 'spawn objeto', - ['spawn_ped'] = 'spawn ped', - ['spawn_ped_param'] = 'exemplo a_m_m_hillbilly_01', ['givemoney'] = 'dar dinheiro', ['setmoney'] = 'set money for a player', ['money_type'] = 'valid money types: cash, bank, black', diff --git a/locales/cs.lua b/locales/cs.lua index 92e3c5f4..c1dc7c82 100644 --- a/locales/cs.lua +++ b/locales/cs.lua @@ -53,16 +53,9 @@ Locales['cs'] = { ['id_param'] = 'iD hráče', ['setjob_param2'] = 'název přiřazované práce', ['setjob_param3'] = 'úroveň práce', - ['load_ipl'] = 'načíst IPL', - ['unload_ipl'] = 'odnačíst IPL', - ['play_anim'] = 'přehrát animaci', - ['play_emote'] = 'přehrát emoci', ['spawn_car'] = 'spawn auto', ['spawn_car_param'] = 'název auta', ['delete_vehicle'] = 'odstranit vozidlo', - ['spawn_object'] = 'spawn objekt', - ['spawn_ped'] = 'spawn peda', - ['spawn_ped_param'] = 'příklad a_m_m_hillbilly_01', ['givemoney'] = 'dát peníze', ['setmoney'] = 'nastavit peníze hráči', ['money_type'] = 'platné typy peněz: cash, bank, black', diff --git a/locales/de.lua b/locales/de.lua index 91cf4c82..3ba684dd 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -53,16 +53,9 @@ Locales['de'] = { ['id_param'] = 'the ID of the player', ['setjob_param2'] = 'the job you wish to assign', ['setjob_param3'] = 'the job level', - ['load_ipl'] = 'load IPL', - ['unload_ipl'] = 'unload IPL', - ['play_anim'] = 'play animation', - ['play_emote'] = 'play emote', ['spawn_car'] = 'spawn a car', ['spawn_car_param'] = 'name of car', ['delete_vehicle'] = 'deletes Vehicle', - ['spawn_object'] = 'spawn object', - ['spawn_ped'] = 'spawn ped', - ['spawn_ped_param'] = 'example a_m_m_hillbilly_01', ['givemoney'] = 'give money', ['setmoney'] = 'set money for a player', ['money_type'] = 'valid money types: cash, bank, black', diff --git a/locales/en.lua b/locales/en.lua index ecb89bff..d10db002 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -53,16 +53,9 @@ Locales['en'] = { ['id_param'] = 'the ID of the player', ['setjob_param2'] = 'the job you wish to assign', ['setjob_param3'] = 'the job level', - ['load_ipl'] = 'load IPL', - ['unload_ipl'] = 'unload IPL', - ['play_anim'] = 'play animation', - ['play_emote'] = 'play emote', ['spawn_car'] = 'spawn a car', ['spawn_car_param'] = 'name of car', ['delete_vehicle'] = 'deletes Vehicle', - ['spawn_object'] = 'spawn object', - ['spawn_ped'] = 'spawn ped', - ['spawn_ped_param'] = 'example a_m_m_hillbilly_01', ['givemoney'] = 'give money', ['setmoney'] = 'set money for a player', ['money_type'] = 'valid money types: cash, bank, black', diff --git a/locales/fi.lua b/locales/fi.lua index 5cbca385..0898fde3 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -53,16 +53,9 @@ Locales['fi'] = { ['id_param'] = 'käyttäjän ID', ['setjob_param2'] = 'työ jonka haluat määrittää', ['setjob_param3'] = 'työn taso', - ['load_ipl'] = 'lataa IPL', - ['unload_ipl'] = 'poista IPL', - ['play_anim'] = 'toista animaatio', - ['play_emote'] = 'toista ele', ['spawn_car'] = 'spawnaa ajoneuvo', ['spawn_car_param'] = 'ajoneuvon nimi', ['delete_vehicle'] = 'poistaa ajoneuvon', - ['spawn_object'] = 'spawnaa objekti', - ['spawn_ped'] = 'spawnaa pedi', - ['spawn_ped_param'] = 'esimerkki a_m_m_hillbilly_01', ['givemoney'] = 'anna rahaa', ['setmoney'] = 'aseta pelaajan rahat', ['money_type'] = 'hyväksytyt rahatyypit: cash, bank, black', diff --git a/locales/fr.lua b/locales/fr.lua index b3f77b7c..09266cfd 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -53,16 +53,9 @@ Locales['fr'] = { ['id_param'] = 'identification du joueur', ['setjob_param2'] = 'le travail que vous souhaitez assigner', ['setjob_param3'] = 'le niveau d\'emploi', - ['load_ipl'] = 'charger IPL', - ['unload_ipl'] = 'décharger IPL', - ['play_anim'] = 'jouer animation', - ['play_emote'] = 'jouer emote', ['spawn_car'] = 'spawn un véhicule', ['spawn_car_param'] = 'nom de la voiture', ['delete_vehicle'] = 'supprimer le véhicule', - ['spawn_object'] = 'engendre un objet', - ['spawn_ped'] = 'spawn ped', - ['spawn_ped_param'] = 'example a_m_m_hillbilly_01', ['givemoney'] = 'donner de l\'argent', ['setmoney'] = 'définir l\'argent pour un joueur', ['money_type'] = 'types de monnaies valides: cash, bank, black', diff --git a/locales/pl.lua b/locales/pl.lua index 09e61c5a..a67dc75a 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -53,16 +53,9 @@ Locales['pl'] = { ['id_param'] = 'ID użytkownika', ['setjob_param2'] = 'praca, którą chcesz przydzielić', ['setjob_param3'] = 'poziom pracy', - ['load_ipl'] = 'załaduj IPL', - ['unload_ipl'] = 'usuń IPL', - ['play_anim'] = 'uruchom animację', - ['play_emote'] = 'uruchom emocje', ['spawn_car'] = 'sprowadź pojazd', ['spawn_car_param'] = 'nazwa samochodu', ['delete_vehicle'] = 'usuń pojazd', - ['spawn_object'] = 'pojaw obiekt', - ['spawn_ped'] = 'pojaw peda', - ['spawn_ped_param'] = 'np. a_m_m_hillbilly_01', ['givemoney'] = 'daj pieniądze', ['setmoney'] = 'ustaw pieniądze dla gracza', ['money_type'] = 'aktualne typy pieniędzy: cash, bank, black', diff --git a/locales/sv.lua b/locales/sv.lua index d15ce060..d0ab8171 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -53,16 +53,9 @@ Locales['sv'] = { ['id_param'] = 'spelarens ID', ['setjob_param2'] = 'det jobb du vill tilldela', ['setjob_param3'] = 'job level', - ['load_ipl'] = 'load IPL', - ['unload_ipl'] = 'unload IPL', - ['play_anim'] = 'spela animering', - ['play_emote'] = 'spela emote', ['spawn_car'] = 'spawna ett fordon', ['spawn_car_param'] = 'namn på fordon', ['delete_vehicle'] = 'ta bort fordon', - ['spawn_object'] = 'spawna föremål', - ['spawn_ped'] = 'spawna NPC', - ['spawn_ped_param'] = 'exempelvis a_m_m_hillbilly_01', ['givemoney'] = 'ge pengar', ['setmoney'] = 'bestäm mängd pengar till en valfri person', ['money_type'] = 'giltiga typer: cash, bank, black', diff --git a/server/commands.lua b/server/commands.lua index 20044962..097fef9a 100644 --- a/server/commands.lua +++ b/server/commands.lua @@ -26,7 +26,6 @@ TriggerEvent('es:addGroupCommand', 'setjob', 'jobmaster', function(source, args, else TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'That job does not exist.' } }) end - else TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Player not online.' } }) end @@ -37,30 +36,6 @@ end, function(source, args, user) TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } }) end, {help = _U('setjob'), params = {{name = 'id', help = _U('id_param')}, {name = 'job', help = _U('setjob_param2')}, {name = 'grade_id', help = _U('setjob_param3')}}}) -TriggerEvent('es:addGroupCommand', 'loadipl', 'admin', function(source, args, user) - TriggerClientEvent('esx:loadIPL', -1, args[1]) -end, function(source, args, user) - TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } }) -end, {help = _U('load_ipl')}) - -TriggerEvent('es:addGroupCommand', 'unloadipl', 'admin', function(source, args, user) - TriggerClientEvent('esx:unloadIPL', -1, args[1]) -end, function(source, args, user) - TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } }) -end, {help = _U('unload_ipl')}) - -TriggerEvent('es:addGroupCommand', 'playanim', 'admin', function(source, args, user) - TriggerClientEvent('esx:playAnim', -1, args[1], args[3]) -end, function(source, args, user) - TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } }) -end, {help = _U('play_anim')}) - -TriggerEvent('es:addGroupCommand', 'playemote', 'admin', function(source, args, user) - TriggerClientEvent('esx:playEmote', -1, args[1]) -end, function(source, args, user) - TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } }) -end, {help = _U('play_emote')}) - TriggerEvent('es:addGroupCommand', 'car', 'admin', function(source, args, user) TriggerClientEvent('esx:spawnVehicle', source, args[1]) end, function(source, args, user) @@ -79,18 +54,6 @@ end, function(source, args, user) TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } }) end, {help = _U('delete_vehicle')}) -TriggerEvent('es:addGroupCommand', 'spawnped', 'admin', function(source, args, user) - TriggerClientEvent('esx:spawnPed', source, args[1]) -end, function(source, args, user) - TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } }) -end, {help = _U('spawn_ped'), params = {{name = 'name', help = _U('spawn_ped_param')}}}) - -TriggerEvent('es:addGroupCommand', 'spawnobject', 'admin', function(source, args, user) - TriggerClientEvent('esx:spawnObject', source, args[1]) -end, function(source, args, user) - TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } }) -end, {help = _U('spawn_object'), params = {{name = 'name'}}}) - TriggerEvent('es:addGroupCommand', 'setmoney', 'admin', function(source, args, user) local _source = source local target = tonumber(args[1]) @@ -99,7 +62,7 @@ TriggerEvent('es:addGroupCommand', 'setmoney', 'admin', function(source, args, u local xPlayer = ESX.GetPlayerFromId(target) - if target and money_type and money_amount and xPlayer ~= nil then + if target and money_type and money_amount and xPlayer then if money_type == 'cash' then xPlayer.setMoney(money_amount) elseif money_type == 'bank' then @@ -130,8 +93,8 @@ TriggerEvent('es:addGroupCommand', 'giveaccountmoney', 'admin', function(source, local account = args[2] local amount = tonumber(args[3]) - if amount ~= nil then - if xPlayer.getAccount(account) ~= nil then + if amount then + if xPlayer.getAccount(account) then xPlayer.addAccountMoney(account, amount) else TriggerClientEvent('esx:showNotification', _source, _U('invalid_account')) @@ -149,8 +112,8 @@ TriggerEvent('es:addGroupCommand', 'giveitem', 'admin', function(source, args, u local item = args[2] local count = (args[3] == nil and 1 or tonumber(args[3])) - if count ~= nil then - if xPlayer.getInventoryItem(item) ~= nil then + if count then + if xPlayer.getInventoryItem(item) then xPlayer.addInventoryItem(item, count) else TriggerClientEvent('esx:showNotification', _source, _U('invalid_item')) @@ -216,15 +179,14 @@ TriggerEvent('es:addGroupCommand', 'clearinventory', 'admin', function(source, a 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) + if xPlayer then + for i=1, #xPlayer.inventory, 1 do + if xPlayer.inventory[i].count > 0 then + xPlayer.setInventoryItem(xPlayer.inventory[i].name, 0) + end end + else + TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Player not online.' } }) end end, function(source, args, user) TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } }) @@ -239,13 +201,12 @@ TriggerEvent('es:addGroupCommand', 'clearloadout', 'admin', function(source, arg xPlayer = ESX.GetPlayerFromId(source) end - if not xPlayer then + if xPlayer then + for i=#xPlayer.loadout, 1, -1 do + xPlayer.removeWeapon(xPlayer.loadout[i].name) + end + else TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Player not online.' } }) - return - end - - for i=#xPlayer.loadout, 1, -1 do - xPlayer.removeWeapon(xPlayer.loadout[i].name) end end, function(source, args, user) TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } })