[ESX] MSK Armor - Multiple Armor Vests

Tebex [2.20€]: https://mskscripts.tebex.io/

Preview: msk_armor - Usable Armor Vests | by Musiker15

Description

  • You can use the armor Item then you get nobproof Item and a Vest will be added to the Ped.
  • With the nobproof Item then the Vest will be removed from Ped.
  • Script checks all Config.Refresh times your status and save it in database.
  • Health and Armor will be saved in Database and restored after player relog.
  • You can set as much vests as you want to add

Config

Config = {}
----------------------------------------------------------------
Config.Locale = 'de'
Config.VersionChecker = true
Config.Debug = false
Config.getSharedObject = 'esx:getSharedObject'
----------------------------------------------------------------
-- !!! This function is clientside AND serverside !!!
-- Look for type == 'client' and type == 'server'
Config.Notification = function(src, type, xPlayer, message) -- xPlayer = ESX.GetPlayerFromId(src)
    if type == 'client' then -- clientside
        ESX.ShowNotification(message) -- replace this with your Notify
    elseif type == 'server' then -- serverside
        xPlayer.showNotification(message) -- replace this with your Notify
    end
end
----------------------------------------------------------------
-- How often Armor Status should be saved in database
Config.EnableRefresh = true
Config.Refresh = 30 -- in seconds (default: 30 seconds)
Config.CheckRemoveArmor = true -- Checks the current Armor status and removes the Vest if armor = 0
------------------------------------------------------------
-- Animation for put on the Vest
Config.AnimWait = 2 -- in seconds (default: 1 second)
Config.Animations = {
    dict = 'clothingtie',
    anim = 'try_tie_neutral_a'
}
----------------------------------------------------------------
-- Set the Armor ID you want to use after Player Relog
Config.defaultSkin = {
    male = {skin1 = 11, skin2 = 1}, -- Male
    female = {skin1 = 3, skin2 = 1}, -- Female
}
----------------------------------------------------------------
Config.Armories = {
    ['bulletproof'] = { -- Item
        percent = 100,
        skin = {
            male = {skin1 = 11, skin2 = 1},
            female = {skin1 = 3, skin2 = 1}
        },
        removeItem = true
    },
    ['bulletproof2'] = { -- Item
        percent = 50,
        skin = {
            male = {skin1 = 11, skin2 = 1},
            female = {skin1 = 3, skin2 = 1}
        },
        removeItem = true
    },
    ['bulletproofpolice'] = { -- Item
        percent = 100,
        skin = {
            male = {skin1 = 12, skin2 = 3},
            female = {skin1 = 13, skin2 = 1}
        },
        removeItem = true
    },
}
Code accessible No
Subscription based No
Lines (approximately) ~ 250
Requirements ESX 1.2 or Legacy, esx_skin, skinchanger
Support Yes

My other Scripts

Changelogs

Update v2.1
  • Performance improvements
  • Fixed Error with refreshArmor after player connection

Re-download msk_armor at your keymaster

Update v2.0
  • You can now set you own vests as much as you want to add
Update v1.5

➥ You can edit getSharedObject now in config
➥ You can edit the Notification now in config

Re-download msk_armor at your keymaster

Update v1.4.1

Added

  • Config.CheckRemoveArmor is stable now

Fixed

  • Fixed issue were xPlayer = nil
Update v1.3

Added

  • On Player Joined, if armor status is 0 then the Vest and the Item nobproof will be removed from ped.

Fixed

  • If a Player relog then the Player get the saved status from database and a Vest will be added to the Ped.

Big thanks to @Kiminaze for helping me with the MySQL query.
https://kiminazes-script-gems.tebex.io/

4 Likes

thank you bro

1 Like

Hello ! seems not working with esx_legacy ox_inventory

1 Like

Hey I know this error and I am trying to fix this. But the Script works fine except for restore armor status after relog.
As I said I’m trying to fix this :slight_smile:

1 Like

Update v1.3

Added

  • On Player Joined, if armor status is 0 then the Vest and the Item nobproof will be removed from ped.

Fixed

  • If a Player relog then the Player get the saved status from database and a Vest will be added to the Ped.

Big thanks to @Kiminaze for helping me with the MySQL query.
https://kiminazes-script-gems.tebex.io/

1 Like

thank you thank you master hehe

1 Like

Update v1.4.1

Added

  • Config.CheckRemoveArmor is stable now

Fixed

  • Fixed issue were xPlayer = nil

Big thanks to @Kiminaze
https://kiminazes-script-gems.tebex.io/

Update v1.5

➥ You can edit getSharedObject now in config
➥ You can edit the Notification now in config

Re-download msk_armor at your keymaster

Update v2.0

  • You can now set you own vests as much as you want to add

Re-download msk_armor at your keymaster

Update v2.1

  • Performance improvements
  • Fixed Error with refreshArmor after player connection

Re-download msk_armor at your keymaster

The vest and life are unfortunately not saved what can be the reason ?

Did you uploaded the sql file? Do you use mysql-async or oxmysql ? Any errors?

yes the sql is in it it also stores it in the database but as soon as you make a relog the vest is removed although in the database 100 is stored, I use mysql-async and no no errors in the console

Do you use the latest version? If not please redownload and try again.

We recently bought it (about 2h) so we should have the latest version

Activate Config.Debug and send me the prints in client and serverconsole

In debug mode it retrieves the data, as soon as I turn it off the vest is removed after the relog!

console

join

putveston

afterrelog

So with Config.Debug = true it works but with Config.Debug = false it doesn’t?

Thats strange. I will have a look at this and fix this asap

Yes exactly in debug mode it works when it is off not

There is a problem with ESX_Legacy when creating a new character the skin menu does not open anymore