Helper de config apply
@bs_config/shared/apply.lua es lo que hace que los cambios de F1 lleguen a tu recurso.
Incluirlo
Sección titulada «Incluirlo»Último shared script, después de tus archivos de config:
shared_scripts { 'config/config.lua' }-- ...shared_script '@bs_config/shared/apply.lua'Qué hace
Sección titulada «Qué hace»- Al arrancar y en cada cambio, el servidor envía un payload
{ _global = {...}, <resource> = { ['Path.To.key'] = value } }mediantebs_config:apply. - El helper toma la parte de tu recurso y modifica tus tablas globales en el sitio:
MyRes.Settings.reward = 75. - Solo toca claves que ya existen con el mismo tipo. Nunca inventa config.
- Cuando se quita un override, repone el valor original.
- Dispara
bs_config:changed:<resource>tras cada aplicación, para que puedas reaccionar:
AddEventHandler('bs_config:changed:' .. GetCurrentResourceName(), function() rebuildSomething()end)Leer valores
Sección titulada «Leer valores»local mult = BSConfigGet('Global.xpMultiplier', 1.0) -- globals or your own paths, no export call-- or from anywhere:local size = exports.bs_config:Get('bs_factions:Factions.Squad.maxSize')Exports: Get(key, default), GetPayload(), GetActiveProfile(), en ambos lados.
En vivo o con reinicio
Sección titulada «En vivo o con reinicio»Modificar la tabla basta cuando tu código lee la tabla cada vez:
-- live: sees the new value next calllocal function reward() return RadioTower.Settings.reward endNo basta cuando la copias a un local al cargar:
-- cached: F1 changes do nothing until restartlocal REWARD = RadioTower.Settings.rewardbs_config detecta ese patrón (local x = Cfg.key en el nivel superior) y marca el ajuste como “reinicio”. Prefiere leer la tabla.
Añadir tus ajustes a F1
Sección titulada «Añadir tus ajustes a F1»Añade filas a bs_config/shared/schema.lua. El id es <resource>:<path>, con tipo, min/max/step, categoría, descripción y el flag live. El valor por defecto se lee de tu archivo en runtime; el valor fb del schema es solo un fallback. Añade solo claves que existan de verdad en tu config.
bs19.org · Privacy · Terms · Cookie settings
Cookies and outside content
The site only needs two essential cookies to keep you logged in and protect forms. Videos and streams from YouTube and Twitch load from their servers, which can set their own cookies, so they stay off until you say yes. Nothing is pre-ticked and you can change your mind any time with "Cookie settings" at the bottom of every page. Details.
Questions about the server, the framework or the site? A real person reads this, usually within a day.