Help me My Gun has no aim
Help me
You probably have this native running somewhere : HideHudComponentThisFrame(14)
You probably want to do a search into the files, your text editor probably has such a function.
Can show clearly which item is not available
I Donât Know Which part of the file you can show me, please help me
Just check your resources
You litteraly have a script called nocrosshairâŚ
Please help me, I donât know where to fix it
Bro just delete
âstart nocrosshairâ
and save it. Restart the server and it should work.
Thank you so very much Love You
Pro help me with this problem anti cheat
Delete the keybinding in es_extened client main.lua
Frobski just told you how to do it. If that seems to complicated to understand, then idk whatâs simple.
Can you help me anti cheat apologize to my bad english?
I went to the search and didnât find the key f2 anywhere
local isLoadoutLoaded, isPaused, isPlayerSpawned, isDead = false, false, false, false
local lastLoadout, pickups = {}, {}
RegisterNetEvent(âesx:playerLoadedâ)
AddEventHandler(âesx:playerLoadedâ, function(xPlayer)
ESX.PlayerLoaded = true
ESX.PlayerData = xPlayer
if Config.EnableHud then
for i=1, #xPlayer.accounts, 1 do
local accountTpl = '<div><img src="img/accounts/' .. xPlayer.accounts[i].name .. '.png"/> {{money}}</div>'
ESX.UI.HUD.RegisterElement('account_' .. xPlayer.accounts[i].name, i-1, 0, accountTpl, {
money = 0
})
ESX.UI.HUD.UpdateElement('account_' .. xPlayer.accounts[i].name, {
money = ESX.Math.GroupDigits(xPlayer.accounts[i].money)
})
end
local jobTpl = '<div>{{job_label}} - {{grade_label}}</div>'
if xPlayer.job.grade_label == '' then
jobTpl = '<div>{{job_label}}</div>'
end
ESX.UI.HUD.RegisterElement('job', #xPlayer.accounts, 0, jobTpl, {
job_label = '',
grade_label = ''
})
ESX.UI.HUD.UpdateElement('job', {
job_label = xPlayer.job.label,
grade_label = xPlayer.job.grade_label
})
else
TriggerEvent('es:setMoneyDisplay', 0.0)
end
end)
AddEventHandler(âplayerSpawnedâ, function()
while not ESX.PlayerLoaded do
Citizen.Wait(1)
end
local playerPed = PlayerPedId()
-- Restore position
if ESX.PlayerData.lastPosition then
SetEntityCoords(playerPed, ESX.PlayerData.lastPosition.x, ESX.PlayerData.lastPosition.y, ESX.PlayerData.lastPosition.z)
end
TriggerEvent('esx:restoreLoadout') -- restore loadout
isLoadoutLoaded = true
isPlayerSpawned = true
isDead = false
end)
AddEventHandler(âesx:onPlayerDeathâ, function()
isDead = true
end)
AddEventHandler(âskinchanger:loadDefaultModelâ, function()
isLoadoutLoaded = false
end)
AddEventHandler(âskinchanger:modelLoadedâ, function()
while not ESX.PlayerLoaded do
Citizen.Wait(1)
end
TriggerEvent('esx:restoreLoadout')
end)
AddEventHandler(âesx:restoreLoadoutâ, function()
local playerPed = PlayerPedId()
local ammoTypes = {}
RemoveAllPedWeapons(playerPed, true)
for i=1, #ESX.PlayerData.loadout, 1 do
local weaponName = ESX.PlayerData.loadout[i].name
local weaponHash = GetHashKey(weaponName)
GiveWeaponToPed(playerPed, weaponHash, 0, false, false)
local ammoType = GetPedAmmoTypeFromWeapon(playerPed, weaponHash)
for j=1, #ESX.PlayerData.loadout[i].components, 1 do
local weaponComponent = ESX.PlayerData.loadout[i].components[j]
local componentHash = ESX.GetWeaponComponent(weaponName, weaponComponent).hash
GiveWeaponComponentToPed(playerPed, weaponHash, componentHash)
end
if not ammoTypes[ammoType] then
AddAmmoToPed(playerPed, weaponHash, ESX.PlayerData.loadout[i].ammo)
ammoTypes[ammoType] = true
end
end
isLoadoutLoaded = true
end)
RegisterNetEvent(âesx:setAccountMoneyâ)
AddEventHandler(âesx:setAccountMoneyâ, function(account)
for i=1, #ESX.PlayerData.accounts, 1 do
if ESX.PlayerData.accounts[i].name == account.name then
ESX.PlayerData.accounts[i] = account
break
end
end
if Config.EnableHud then
ESX.UI.HUD.UpdateElement('account_' .. account.name, {
money = ESX.Math.GroupDigits(account.money)
})
end
end)
RegisterNetEvent(âes:activateMoneyâ)
AddEventHandler(âes:activateMoneyâ, function(money)
ESX.PlayerData.money = money
end)
RegisterNetEvent(âesx:addInventoryItemâ)
AddEventHandler(âesx:addInventoryItemâ, function(item, count)
for i=1, #ESX.PlayerData.inventory, 1 do
if ESX.PlayerData.inventory[i].name == item.name then
ESX.PlayerData.inventory[i] = item
break
end
end
ESX.UI.ShowInventoryItemNotification(true, item, count)
if ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
ESX.ShowInventory()
end
end)
RegisterNetEvent(âesx:removeInventoryItemâ)
AddEventHandler(âesx:removeInventoryItemâ, function(item, count)
for i=1, #ESX.PlayerData.inventory, 1 do
if ESX.PlayerData.inventory[i].name == item.name then
ESX.PlayerData.inventory[i] = item
break
end
end
ESX.UI.ShowInventoryItemNotification(false, item, count)
if ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
ESX.ShowInventory()
end
end)
RegisterNetEvent(âesx:setJobâ)
AddEventHandler(âesx:setJobâ, function(job)
ESX.PlayerData.job = job
end)
RegisterNetEvent(âesx:addWeaponâ)
AddEventHandler(âesx:addWeaponâ, function(weaponName, ammo)
local playerPed = PlayerPedId()
local weaponHash = GetHashKey(weaponName)
GiveWeaponToPed(playerPed, weaponHash, ammo, false, false)
--AddAmmoToPed(playerPed, weaponHash, ammo) possibly not needed
end)
RegisterNetEvent(âesx:addWeaponComponentâ)
AddEventHandler(âesx:addWeaponComponentâ, function(weaponName, weaponComponent)
local playerPed = PlayerPedId()
local weaponHash = GetHashKey(weaponName)
local componentHash = ESX.GetWeaponComponent(weaponName, weaponComponent).hash
GiveWeaponComponentToPed(playerPed, weaponHash, componentHash)
end)
RegisterNetEvent(âesx:removeWeaponâ)
AddEventHandler(âesx:removeWeaponâ, function(weaponName, ammo)
local playerPed = PlayerPedId()
local weaponHash = GetHashKey(weaponName)
RemoveWeaponFromPed(playerPed, weaponHash)
if ammo then
local pedAmmo = GetAmmoInPedWeapon(playerPed, weaponHash)
local finalAmmo = math.floor(pedAmmo - ammo)
SetPedAmmo(playerPed, weaponHash, finalAmmo)
else
SetPedAmmo(playerPed, weaponHash, 0) -- remove leftover ammo
end
end)
RegisterNetEvent(âesx:removeWeaponComponentâ)
AddEventHandler(âesx:removeWeaponComponentâ, function(weaponName, weaponComponent)
local playerPed = PlayerPedId()
local weaponHash = GetHashKey(weaponName)
local componentHash = ESX.GetWeaponComponent(weaponName, weaponComponent).hash
RemoveWeaponComponentFromPed(playerPed, weaponHash, componentHash)
end)
â Commands
RegisterNetEvent(âesx:teleportâ)
AddEventHandler(âesx:teleportâ, function(pos)
pos.x = pos.x + 0.0
pos.y = pos.y + 0.0
pos.z = pos.z + 0.0
RequestCollisionAtCoord(pos.x, pos.y, pos.z)
while not HasCollisionLoadedAroundEntity(PlayerPedId()) do
RequestCollisionAtCoord(pos.x, pos.y, pos.z)
Citizen.Wait(1)
end
SetEntityCoords(PlayerPedId(), pos.x, pos.y, pos.z)
end)
RegisterNetEvent(âesx:setJobâ)
AddEventHandler(âesx:setJobâ, function(job)
if Config.EnableHud then
ESX.UI.HUD.UpdateElement(âjobâ, {
job_label = job.label,
grade_label = job.grade_label
})
end
end)
RegisterNetEvent(âesx:loadIPLâ)
AddEventHandler(âesx:loadIPLâ, function(name)
Citizen.CreateThread(function()
LoadMpDlcMaps()
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()
local coords = GetEntityCoords(playerPed)
ESX.Game.SpawnVehicle(model, coords, 90.0, function(vehicle)
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
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))
local coords = GetEntityCoords(ped)
local forward = GetEntityForwardVector(ped)
local x, y, z = table.unpack(coords + forward * -2.0)
ESX.Game.SpawnLocalObject('prop_money_bag_01', {
x = x,
y = y,
z = z - 2.0,
}, function(obj)
SetEntityAsMissionEntity(obj, true, false)
PlaceObjectOnGroundProperly(obj)
pickups[id] = {
id = id,
obj = obj,
label = label,
inRange = false,
coords = {
x = x,
y = y,
z = z
}
}
end)
end)
RegisterNetEvent(âesx:removePickupâ)
AddEventHandler(âesx:removePickupâ, function(id)
ESX.Game.DeleteObject(pickups[id].obj)
pickups[id] = nil
end)
RegisterNetEvent(âesx:pickupWeaponâ)
AddEventHandler(âesx:pickupWeaponâ, function(weaponPickup, weaponName, ammo)
local playerPed = PlayerPedId()
local pickupCoords = GetOffsetFromEntityInWorldCoords(playerPed, 2.0, 0.0, 0.5)
local weaponHash = GetHashKey(weaponPickup)
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()
local vehicle = ESX.Game.GetVehicleInDirection()
if IsPedInAnyVehicle(playerPed, true) then
vehicle = GetVehiclePedIsIn(playerPed, false)
end
if DoesEntityExist(vehicle) then
ESX.Game.DeleteVehicle(vehicle)
end
end)
â Pause menu disable HUD display
if Config.EnableHud then
Citizen.CreateThread(function()
while true do
Citizen.Wait(300)
if IsPauseMenuActive() and not isPaused then
isPaused = true
TriggerEvent('es:setMoneyDisplay', 0.0)
ESX.UI.HUD.SetDisplay(0.0)
elseif not IsPauseMenuActive() and isPaused then
isPaused = false
TriggerEvent('es:setMoneyDisplay', 1.0)
ESX.UI.HUD.SetDisplay(1.0)
end
end
end)
end
â Save loadout
Citizen.CreateThread(function()
while true do
Citizen.Wait(5000)
local playerPed = PlayerPedId()
local loadout = {}
local loadoutChanged = false
if IsPedDeadOrDying(playerPed) then
isLoadoutLoaded = false
end
for i=1, #Config.Weapons do
local weaponName = Config.Weapons[i].name
local weaponHash = GetHashKey(weaponName)
local weaponComponents = {}
if HasPedGotWeapon(playerPed, weaponHash, false) and weaponName ~= 'WEAPON_UNARMED' then
local ammo = GetAmmoInPedWeapon(playerPed, weaponHash)
local components = Config.Weapons[i].components
for j=1, #components do
if HasPedGotWeaponComponent(playerPed, weaponHash, components[j].hash) then
table.insert(weaponComponents, components[j].name)
end
end
if not lastLoadout[weaponName] or lastLoadout[weaponName] ~= ammo then
loadoutChanged = true
end
lastLoadout[weaponName] = ammo
table.insert(loadout, {
name = weaponName,
ammo = ammo,
label = Config.Weapons[i].label,
components = weaponComponents
})
else
if lastLoadout[weaponName] then
loadoutChanged = true
end
lastLoadout[weaponName] = nil
end
end
if loadoutChanged and isLoadoutLoaded then
ESX.PlayerData.loadout = loadout
TriggerServerEvent('esx:updateLoadout', loadout)
end
end
end)
â Menu interactions
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsControlJustReleased(0, 289) and IsInputDisabled(0) and not isDead and not ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
ESX.ShowInventory()
end
end
end)
â Disable wanted level
if Config.DisableWantedLevel then
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local playerId = PlayerId()
if GetPlayerWantedLevel(playerId) ~= 0 then
SetPlayerWantedLevel(playerId, 0, false)
SetPlayerWantedLevelNow(playerId, false)
end
end
end)
end
â pickups
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
-- if there's no nearby pickups we can wait a bit to save performance
if next(pickups) == nil then
Citizen.Wait(500)
end
for k,v in pairs(pickups) do
local distance = GetDistanceBetweenCoords(coords, v.coords.x, v.coords.y, v.coords.z, true)
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if distance <= 5.0 then
ESX.Game.Utils.DrawText3D({
x = v.coords.x,
y = v.coords.y,
z = v.coords.z + 0.25
}, v.label)
end
if (closestDistance == -1 or closestDistance > 3) and distance <= 1.0 and not v.inRange and IsPedOnFoot(playerPed) then
TriggerServerEvent('esx:onPickup', v.id)
PlaySoundFrontend(-1, 'PICK_UP', 'HUD_FRONTEND_DEFAULT_SOUNDSET', false)
v.inRange = true
end
end
end
end)
â Last position
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
if ESX.PlayerLoaded and isPlayerSpawned then
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
if not IsEntityDead(playerPed) then
ESX.PlayerData.lastPosition = {x = coords.x, y = coords.y, z = coords.z}
end
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
local playerPed = PlayerPedId()
if IsEntityDead(playerPed) and isPlayerSpawned then
isPlayerSpawned = false
end
end
end)
U have this on
start nocrosshair
in #Other if u want to enable and disable it u can either remove it from the server.cfg or by doing âstop nocrosshairâ in the CMD process of ur server