RegisterCommand("kill", function(source, args, rawCommand) -- /kill [ID]
if source ~= 0 then
local xPlayer = ESX.GetPlayerFromId(source)
if havePermission(xPlayer) then
if args[1] and tonumber(args[1]) then
local targetId = tonumber(args[1])
local xTarget = ESX.GetPlayerFromId(targetId)
if xTarget then
TriggerClientEvent("esx_admin:killPlayer", xTarget.playerId)
--TriggerClientEvent("chatMessage", xPlayer.playerId, _U('kill_admin', targetId))
--TriggerClientEvent('chatMessage', xTarget.playerId, _U('kill_by_admin'))
TriggerClientEvent('notification', xPlayer.playerId, _U('kill_admin', targetId), 1)
TriggerClientEvent('notification', xTarget.playerId, _U('kill_by_admin'), 1)
else
TriggerClientEvent('notification', source, 'ID Bulunamadı!', 2)
end
else
TriggerClientEvent('notification', source, 'Geçersiz ID!', 2)
end
else
TriggerClientEvent('notification', source, 'Bu komutu kullanmak için yetkin yok!', 2)
end
end
end, false)