[PAID][ESX] Airsoft

Hey, did you changed the resource folder name?

I converted this to vrp and everything works fine, but when the game is over and the winner is shown, other peopleā€™s scores are not added up, only my score is displayed.
So I looked for a syntax to trigger when a player dies to solve this, but there was nowhere to sync kills to all players.

At the onPlayerKilled function there is an esx_airsoft:client:setCurrentLobby event trigger where the lobby refreshed for all the players in the lobby and the lobby contains the players with the kills.

I tried to retrieve that event in the onPlayerKilled function, but it was not retrieved.

I would love to buy this if there is a standalone version available??

Hey, I donā€™t think there will be a standalone version.

Do your community a favor and BUY this script asap!! Its loads of fun and also top quality work!

1 Like

Hey loving the script, but there is one big issue. The cops are getting all the shots fired alerts when matches take place making things very hectic. Any tips on what i could do to stop them?

1 Like

Hey, I assume itā€™s in your policejob, you need to check if the player is in a match.

ESX.TriggerServerCallback('esx_airsoft:server:getPlayerLobbyData', function(lobby) 
    if (lobby and not lobby.started and not lobby.teleported) or lobby == nil then
	    //Send shooting message to police
    end
end)

For example like this.

I am using linden_outlawalert. I am trying to add the Trigger event to it now!

main.lua (19.0 KB)

I have added it to the top of the function but then Im getting no alerts at all.

Hey David, Great script but I have found two issues! If a player logs out in a game or the server restarts, they lose all inventory items and they get to KEEP the weapons the script adds for them. This is extremely exploitable. Idk what kind of fix you could make for this but at the moment its pretty risky to have around!

O also I canā€™t add attachments to the weapons! I saw you had a check for it but cant get it to work! any ideas?

2 Likes

Hey, the item save should work at logout, maybe your database saves the items/weapons otherwise than the original v1.2 esx system? At server restart all playing players inventory will be lost. I have tried to save the data but there is not enough time for that, it is only possible if you stop the resource 10-20 seconds before the server stop so it could have the time to save the data.

I donā€™t know about the attachments, i will check a little later.

1 Like

If ibuy can you help with changing it to work with qbus?

Hello, no sorry this is only for ESX, maybe later i will create a qbus version.

We have used this script on a windows fivem server and was working great. We currently switched to a Linux fivem server, but the menu is not showing. If you press ā€œEā€ to open the menu nothing is shown and you are stuck inside. Is this a known bug and has someone had the same issue? I see no errors in console, so I assume the menu is just not compatible with linux?

David_HD, I purchased this script about 2 months ago when it first released and was wanting to check if any updated have been made.

Hey, I donā€™t exactly know what should be the problem, I have tested it on windows server, will check if one of my friend uses linux server. The frontend part was written in vue.js so it shouldnā€™t be a problem but most likely that will be the case.

Any fix?

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
                })