This guide will help you set up and customize the Bottle Spin script for your FiveM server. Follow the steps below to configure the settings according to your preferences.
Bottle Spin Script Configuration
1. Language Setting
Defines the language for the script. Supported languages are English (en), German (de), French (fr), Spanish (sp), and Polish (pl).
Defines the model for the bottle used in the script.
STG.BottleModel = 'prop_wine_bot_01'
4. Marker Color
Sets the color for the marker in the script.
STG.MarkerColor = { r = 0, g = 169, b = 255 }
5. Movement Setting
Determines whether players can move while the bottle is spinning.
STG.canMoveWhileSpinning = false
6. Custom Notify
Custom notify event or function for messages.
STG.CustomNotify = function(message)
TriggerEvent('esx:showNotification', message)
end
7. Cooldown Messages
Messages displayed during the cooldown period in different languages.
STG.CooldownMessages = {
en = "THE BOTTLE IS SPINNING, YOU CAN PICK IT UP AFTER IT STOPS.",
de = "DIE FLASCHE DREHT SICH, DU KANNST SIE ERST DANACH AUFHEBEN.",
fr = "LA BOUTEILLE TOURNE, VOUS POUVEZ LA RAMASSER APRÈS QU'ELLE S'ARRÊTE.",
sp = "LA BOTELLA ESTÁ GIRANDO, PUEDES RECOGERLA DESPUÉS DE QUE SE DETENGA.",
pl = "BUTELKA SIĘ KRĘCI, MOŻESZ JĄ PODNIEŚĆ PO JEJ ZATRZYMANIU."
}
8. Framework Function
Determines the framework based on the configuration.
function getFramework()
if STG.Framework == "esx" then
return exports['es_extended']:getSharedObject(), "esx"
elseif STG.Framework == "qb" then
return exports["qb-core"]:GetCoreObject(), "qb"
elseif STG.Framework == "auto" then
if GetResourceState('qb-core') == 'started' then
return exports["qb-core"]:GetCoreObject(), "qb"
elseif GetResourceState('es_extended') == 'started' then
return exports['es_extended']:getSharedObject(), "esx"
end
end
end
9. Cooldown Message Function
Gets the appropriate cooldown message based on the selected language.
STG.GetCooldownMessage = function()
return STG.CooldownMessages[STG.Language] or STG.CooldownMessages['en']
end
10. Notify Messages
Defines notify messages for different actions in various languages.
const Config = {
Language: 'en',
NotifyMessages: {
'en': {
BottleAlreadySpun: "THE BOTTLE HAS ALREADY BEEN SPUN. PLEASE WAIT 10 SECONDS.",
PickUpBottle: "PRESS 'G' TO PICK UP THE BOTTLE",
SpinBottle: "PRESS 'E' TO SPIN THE BOTTLE"
},
'de': {
BottleAlreadySpun: "DIE FLASCHE WURDE BEREITS GEDREHT. BITTE WARTE 10 SEKUNDEN.",
PickUpBottle: "DRÜCKEN SIE 'G' UM DIE FLASCHE AUFZUHEBEN",
SpinBottle: "DRÜCKEN SIE 'E' UM DIE FLASCHE ZU DREHEN"
},
'fr': {
BottleAlreadySpun: "LA BOUTEILLE A DÉJÀ ÉTÉ TOURNÉE. VEUILLEZ ATTENDRE 10 SECONDES.",
PickUpBottle: "APPUYEZ SUR 'G' POUR RAMASSER LA BOUTEILLE",
SpinBottle: "APPUYEZ SUR 'E' POUR TOURNER LA BOUTEILLE"
},
'sp': {
BottleAlreadySpun: "LA BOTELLA YA HA SIDO GIRADA. POR FAVOR, ESPERE 10 SEGUNDOS.",
PickUpBottle: "PRESIONE 'G' PARA RECOGER LA BOTELLA",
SpinBottle: "PRESIONE 'E' PARA GIRAR LA BOTELLA"
},
'pl': {
BottleAlreadySpun: "BUTELKA JUŻ SIĘ KRĘCI. PROSZĘ POCZEKAĆ 10 SEKUND.",
PickUpBottle: "NACIŚNIJ 'G', ABY PODNIEŚĆ BUTELKĘ",
SpinBottle: "NACIŚNIJ 'E', ABY ZAKRĘCIĆ BUTELKĄ"
}
}
};