Hi Guys
sorry for my bad english
guys , i want this script make player while playing warzone script and force disconnect from server (playerDropped, for loot every gun what is not allowed on normal world) guns get remove
this is my code in server.lua
RegisterNetEvent('FORCEDC:ALT+F4')
AddEventHandler('FORCEDC:ALT+F4', function(source)
local xPlayer = ESX.GetPlayerFromId(source)
if xPlayer ~= nil then
for i=1, #xPlayer.loadout, 1 do
if xPlayer.loadout[i].name then
xPlayer.removeWeapon(xPlayer.loadout[i].name)
end
end
if xPlayer.getInventoryItem('BRD') then
xPlayer.removeInventoryItem('BRD', 4000)
end
end
TriggerEvent('DiscordBot:ToDiscord', 'warzone', 'WarZone' , "```css\n" .. GetPlayerName(source) .. " DC\n```",'user', source, true, false)
end)
AddEventHandler('playerDropped', function(source, resoan)
local source = source
TriggerClientEvent('FORCEDC:ALT+F4', source)
print('TEST')
end)
Its fine , No error , BUT Not Working ! Not remove the guns !!
Tnx for help