Hi, very nice script, how can I make it work with weapons that are item? I tried to fix it by inserting an addinventoryitem instead of addweapon but the problem is that when it exits the lobby it doesn’t remove the weapon and ammo item. Thanks in advance.
Hey, thanks, I guess if the weapon and the ammo is an item then you need to remove them as an item, so probably use RemoveInventoryItem instead of RemoveWeapon at the end.
I’ve tried, but I can’t get it to work. Because the removeinventoryitem also needs the number and not just the name of the item. Since each time the number of ammunition is different, not all of them can be removed. Something would be needed to remove all items from the inventory after the lobby ends. But the problem is that it should give back the saved things before starting. I’ve tried so many options but can’t fix it.
I guess you can get the player’s full inventory, so before lobby end you need to get the inventory, remove all items (you will get the exact number of each item, so the amount problem shouldn’t be a problem) and after that the match end part will run down (or you can write it to the end part, just before the item restore happens), where it will give the previous items back to it’s owner.
I’m trying and trying again and again but I don’t understand the event that I have to insert, even trying some of them I can’t do it correctly.
Hello, I have the problem that the players are not revived.
I have made a change in the AmbulanceJob.
Hello, you should check your scripts, maybe there is an other script which uses the ambulance job function. There was a similar problem as yours for one of my customers, but it turned out there was an other script which ran down at player death and that was the problem.
we have visn_are . But there I can not find such a trigger or I was blind. :-/
Hey David, was there any updates since 2021?
Bekommt man noch eine Antwort?
Ich habe die Lösung gefunden.
Sollte mal wieder jemand das Problem haben, den DeathUI nicht aus zu bekommen…
AddEventHandler(‘esx:onPlayerDeath’, function(data)
local playerPed = PlayerPedId()
ESX.TriggerServerCallback(‘esx_airsoft:server:getPlayerLobbyData’, function(lobby)
if (lobby and not lobby.started and not lobby.teleported) or lobby == nil then
OnPlayerDeath()
else
Wait(5000)
TriggerEvent(“visn_are:resetHealthBuffer”)
FreezeEntityPosition(playerPed, false)
end
end)
end)
Das Event muss, im ambulancejob>>client>>main.lua so abgeändert werden. (Bearbeitet)
Ebenfalls, um keinen Fehler zu bekommen sollte man im ESX Mechicjob,policejob und justizjob das Event auch ändern, in folgendes:
AddEventHandler(‘esx:onPlayerDeath’, function(data)
local playerPed = PlayerPedId()
ESX.TriggerServerCallback(‘esx_airsoft:server:getPlayerLobbyData’, function(lobby)
if (lobby and not lobby.started and not lobby.teleported) or lobby == nil then
else
Wait(5000)
TriggerEvent(“visn_are:resetHealthBuffer”)
FreezeEntityPosition(playerPed, false)
end
end)
end)
what?
I have esx legacy
Hi, I wrote the script before the getSharedObject deprecation happened.
You can change the esx import part in the script by this documentation (you need to change it on client and on server side too): esx:getSharedObject Deprecation | ESX Documentation
Hey, it looks like the ui didn’t get the locales.
At client side in the main.lua file you can find a part like this:
SetNuiFocus(true, true)
SendNUIMessage({
type = 'SET_AIRSOFT_DATA',
visible = true,
identifier = GetPlayerServerId(PlayerId()),
lobbySettings = Config.LobbySettings,
mapTypes = types
})
Change it to this:
SetNuiFocus(true, true)
SendNUIMessage({
type = 'SET_AIRSOFT_DATA',
visible = true,
identifier = GetPlayerServerId(PlayerId()),
lobbySettings = Config.LobbySettings,
locales = Config.Language.UI,
mapTypes = types
})
So I made this change, after that an error came
Hi, Thank you for the observation, I’m currently checking the problems.
Okay, now everything is looks fine, I think you can re-download the file from Tebex and I hope it will work fine. The problem with the maps was I don’t know why but it looks like the ui sending event didn’t got the processed maps in time, so I have added a timer before that, it worked.
hmm I can’t find a button to download the file again, the old download link has expired