PVP COIN [ESX]

SAVING DATA IN THE DATABASE:

The data will be saved every time the player leaves the server.


SQL:

CREATE TABLE CodeUnity_PvPCoin (
    `Identifier` VARCHAR(255),
    `Kill` INTEGER,
    `Death` INTEGER,
    `Coin` INTEGER,
    `Animations` TEXT 
);

CFG:

CodeUnity_PvPCoin_Cfg = {}

CodeUnity_PvPCoin_Cfg.Language = 'en'
CodeUnity_PvPCoin_Cfg.Translations = {
    ['en'] = {
        ['Title_PvPMenu'] = 'Menu Coin PvP',
        ['Title_BuyAnimations'] = 'Animation list',
        ['Title_MyAnimations'] = 'My Animation list',
        ['Title_Settings_Animation'] = 'Animation: %s',
        ['Name_Coin'] = 'Code&Unity Coin',
        ['Menu_Kill'] = 'Kill: %s',
        ['Menu_Death'] = 'Death: %s',
        ['Menu_Coin'] = 'Coin: %s',
        ['Menu_Buy_Animations'] = 'Buy Animations',
        ['Menu_My_Animations'] = 'Possessed Animation',
        ['Preview_Anim'] = 'Watch Preview Animation',
        ['Buy_Anim'] = 'Buy Animation: %s %s',
        ['No_Animations'] = 'No Animations purchased',
        ['Owned'] = 'OWNED',
        ['Animation_Purchased'] = 'You bought the %s animation at: %s %s',
        ['No_Enough_Coin'] = 'You don\'t have enough Coins, you are missing: %s %s'
    }
}

CodeUnity_PvPCoin_Cfg.Keys = {
    ['Key_Menu'] = 'F5',
    ['Remove_Photo'] = 'DELETE',
    ['Cancel_Animation'] = 'X'
}

CodeUnity_PvPCoin_Cfg.Coin = {
    Enable_Kill_Coin = true,
    Coin_Added_To_Kill = 1,
    Coin_Removed_For_Kill = 1
}

CodeUnity_PvPCoin_Cfg.EnableShop_Animations = true
CodeUnity_PvPCoin_Cfg.Animations = {
    ['Test'] = {
        Anim = 'clown_idle_4',
        Dict = 'rcm_barry2',
        Image = 'https://cdn.discordapp.com/attachments/1139366956936478730/1193444998725767178/image.png?ex=65acbd44&is=659a4844&hm=9a0d02687d358c7af1adb58bacdeafa6bfcb291b63ef6eb8dc87f48d63e7bbad&',
        Price = 30,
    },
}

CodeUnity_PvPCoin_Cfg.Notify = function (side,notify,src)
    if side == 'Client' then
        ESX.ShowNotification(notify)
    elseif side == 'Server' then
        TriggerClientEvent('esx:showNotification', src, notify)
    end
end

Last updated