mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 09:18:53 +00:00
36d82c922f
- reworked /setmoney [id] [money type] [amount] - implemented /disc (/disconnect) - the give submenu does no longer appear if there's no one nearby - if you have 0 cash, bank or black money it wont appear in your f2 inventory - when selecting a item, let the item label be the title of the menu (inventory menu) - minor improvements
169 lines
7.7 KiB
Lua
169 lines
7.7 KiB
Lua
TriggerEvent('es:addGroupCommand', 'tp', 'admin', function(source, args, user)
|
|
local x = tonumber(args[1])
|
|
local y = tonumber(args[2])
|
|
local z = tonumber(args[3])
|
|
|
|
if x and y and z then
|
|
TriggerClientEvent("esx:teleport", source, {
|
|
x = x,
|
|
y = y,
|
|
z = z
|
|
})
|
|
else
|
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Invalid coordinates!")
|
|
end
|
|
end, function(source, args, user)
|
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
|
|
end, {help = "Teleport to coordinates", params = {{name = "x", help = "X coords"}, {name = "y", help = "Y coords"}, {name = "z", help = "Z coords"}}})
|
|
|
|
TriggerEvent('es:addGroupCommand', 'setjob', 'jobmaster', function(source, args, user)
|
|
local xPlayer = ESX.GetPlayerFromId(args[1])
|
|
xPlayer.setJob(args[2], tonumber(args[3]))
|
|
end, function(source, args, user)
|
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "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('chatMessage', source, "SYSTEM", {255, 0, 0}, "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('chatMessage', source, "SYSTEM", {255, 0, 0}, "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('chatMessage', source, "SYSTEM", {255, 0, 0}, "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('chatMessage', source, "SYSTEM", {255, 0, 0}, "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)
|
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
|
|
end, {help = _U('spawn_car'), params = {{name = "car", help = _U('spawn_car_param')}}})
|
|
|
|
TriggerEvent('es:addGroupCommand', 'dv', 'admin', function(source, args, user)
|
|
TriggerClientEvent('esx:deleteVehicle', source)
|
|
end, function(source, args, user)
|
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
|
|
end, {help = _U('delete_vehicle'), params = {{name = "car", help = _U('delete_veh_param')}}})
|
|
|
|
|
|
TriggerEvent('es:addGroupCommand', 'spawnped', 'admin', function(source, args, user)
|
|
TriggerClientEvent('esx:spawnPed', source, args[1])
|
|
end, function(source, args, user)
|
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "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('chatMessage', source, "SYSTEM", {255, 0, 0}, "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])
|
|
local money_type = args[2]
|
|
local money_amount = tonumber(args[3])
|
|
|
|
local xTarget = ESX.GetPlayerFromId(target)
|
|
|
|
if target and money_type and money_amount and xTarget ~= nil then
|
|
if money_type == 'cash' then
|
|
xTarget.setMoney(money_amount)
|
|
elseif money_type == 'bank' then
|
|
xTarget.setAccountMoney('bank', money_amount)
|
|
elseif money_type == 'black' then
|
|
xTarget.setAccountMoney('black_money', money_amount)
|
|
else
|
|
TriggerClientEvent('chatMessage', _source, "SYSTEM", {255, 0, 0}, "^2" .. money_type .. " ^0 is not a valid money type!")
|
|
return
|
|
end
|
|
else
|
|
TriggerClientEvent('chatMessage', _source, "SYSTEM", {255, 0, 0}, "Invalid arguments.")
|
|
return
|
|
end
|
|
|
|
print('es_extended: ' .. GetPlayerName(source) .. ' just set $' .. money_amount .. ' (' .. money_type .. ') to ' .. xTarget.name)
|
|
TriggerClientEvent('esx:showNotification', xTarget.source, _U('money_set', money_amount, money_type))
|
|
end, function(source, args, user)
|
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
|
|
end, {help = _U('setmoney'), params = {{name = "id", help = _U('id_param')}, {name = "money type", help = _U('money_type')}, {name = "amount", help = _U('money_amount')}}})
|
|
|
|
TriggerEvent('es:addGroupCommand', 'giveaccountmoney', 'admin', function(source, args, user)
|
|
|
|
local _source = source
|
|
local xPlayer = ESX.GetPlayerFromId(args[1])
|
|
local account = args[2]
|
|
local amount = tonumber(args[3])
|
|
|
|
if amount ~= nil then
|
|
if xPlayer.getAccount(account) ~= nil then
|
|
xPlayer.addAccountMoney(account, amount)
|
|
else
|
|
TriggerClientEvent('esx:showNotification', _source, _U('invalid_account'))
|
|
end
|
|
else
|
|
TriggerClientEvent('esx:showNotification', _source, _U('amount_invalid'))
|
|
end
|
|
|
|
end, function(source, args, user)
|
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
|
|
end, {help = _U('giveaccountmoney'), params = {{name = "id", help = _U('id_param')}, {name = "account", help = _U('account')}, {name = "amount", help = _U('money_amount')}}})
|
|
|
|
TriggerEvent('es:addGroupCommand', 'giveitem', 'admin', function(source, args, user)
|
|
|
|
local _source = source
|
|
local xPlayer = ESX.GetPlayerFromId(args[1])
|
|
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
|
|
xPlayer.addInventoryItem(item, count)
|
|
else
|
|
TriggerClientEvent('esx:showNotification', _source, _U('invalid_item'))
|
|
end
|
|
else
|
|
TriggerClientEvent('esx:showNotification', _source, _U('invalid_amount'))
|
|
end
|
|
|
|
end, function(source, args, user)
|
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
|
|
end, {help = _U('giveitem'), params = {{name = "id", help = _U('id_param')}, {name = "item", help = _U('item')}, {name = "amount", help = _U('amount')}}})
|
|
|
|
TriggerEvent('es:addGroupCommand', 'giveweapon', 'admin', function(source, args, user)
|
|
|
|
local xPlayer = ESX.GetPlayerFromId(args[1])
|
|
local weaponName = string.upper(args[2])
|
|
|
|
xPlayer.addWeapon(weaponName, 1000)
|
|
|
|
end, function(source, args, user)
|
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
|
|
end, {help = _U('giveweapon'), params = {{name = "id", help = _U('id_param')}, {name = "weapon", help = _U('weapon')}}})
|
|
|
|
TriggerEvent('es:addGroupCommand', 'disc', 'admin', function(source, args, user)
|
|
DropPlayer(source, 'You have been disconnected')
|
|
end, function(source, args, user)
|
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
|
|
end, {help = _U('disconnect')})
|
|
|
|
TriggerEvent('es:addGroupCommand', 'disconnect', 'admin', function(source, args, user)
|
|
DropPlayer(source, 'You have been disconnected')
|
|
end, function(source, args, user)
|
|
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
|
|
end, {help = _U('disconnect')}) |