-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Time-base reset limiter, spawn default vehicle if none selected
also motd disabling and some config changes
- Loading branch information
Showing
4 changed files
with
29 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
# Uncle Joey's Base | ||
Uncle Joey's Base provides some essential client-side addons for your BeamMP server, such as: | ||
- a message of the day (MOTD) | ||
- player restrictions (limiting respawns, resets, menu options etc.) | ||
- realtime time syncing | ||
Uncle Joey's Base provides some essential client-side addons for your BeamMP server, including: | ||
- A message of the day with BBCode support (motd) | ||
- Player restrictions (limiting rewinds, menu options etc.) | ||
- Limiting resets to a certain amount per time | ||
- Day / night time syncing | ||
|
||
## Getting started | ||
1. Download the latest release | ||
2. Place the .zip file in your `Resources/Client` folder of your BeamMP server | ||
3. Configure the addon using the `settings/config.lua` file | ||
4. Optionally add or replace images (supports gifs) in the `ui/uj_base` folder | ||
4. Optionally add or replace images in the `ui/uj_base` folder | ||
|
||
### MOTD BBCodes | ||
You can use BBCodes in your MOTD, `config.lua` contains a sample. | ||
`[url] [forumurl] [ico] [h1] [h2] [h3] [h4] [h5] [img] [action] [list] [olist] [strike] [code] [br] [attach] [MEDIA=youtube] [size] [color] [hr] [spoiler] [font] [left] [center] [right]` -- I think that's all | ||
### Motd BBCodes | ||
You can use BBCodes in your motd, `config.lua` contains a sample. | ||
`[url] [forumurl] [ico] [h1] [h2] [h3] [h4] [h5] [h6] [img] [action] [list] [olist] [strike] [code] [br] [MEDIA=youtube] [size] [color] [hr] [spoiler] [font] [left] [center] [right]` -- I think that's all 😊 | ||
|
||
|
||
## Questions, Feature requests & Bugs | ||
Please create an issue here on GitHub. | ||
|
||
## Impressions | ||
## Some impressions | ||
![](https://i.imgur.com/ZcNJnBb.png) | ||
![](https://i.imgur.com/EOWs6Xu.png) | ||
![](https://i.imgur.com/dUdR08Z.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
local a={}local b=1;local c=0;local d,e;local function f()if e.restrictActions then extensions.core_input_actionFilter.setGroup('uj_base',e.disabledActions)extensions.core_input_actionFilter.addAction(0,'uj_base',true)log("I",d.name,"disabled "..#e.disabledActions.." actions")end end;local function g()guihooks.trigger('ScenarioChange',{name=e.motd.title,description=e.motd.description,introType=e.motd.type})end;local function h(i,j)local k=core_environment.getTimeOfDay()k.time=math.abs(i+j/60-12)/12*0.5;core_environment.setTimeOfDay(k)end;local function l()if e.setTime then local m=os.date("!*t",os.time()+e.timeOffsetHours*60*60)h(m.hour,m.min)end end;local function n(j)if e.syncTime and e.setTime then local m=os.date("!*t",os.time()+(e.timeOffsetHours*60+j)*60)h(m.hour,m.min)end end;local function o()d=jsonReadFile("settings/resource.json")e=require("settings/config")guihooks.trigger("ChangeState",{state="scenario-start"})if e.restrictMenu then extensions.core_gamestate.setGameState("scenario","freeroam","uj_base")end;f()l()log("I",d.name,"version "..d.version.." loaded")end;local function p()extensions.core_input_actionFilter.addAction(0,'uj_base',false)extensions.core_gamestate.setGameState("freeroam","freeroam","freeroam")log("I",d.name,"version "..d.version.." unloaded, goodbye!")end;local function q(r,s,t)c=c+r;if c>=b then n(c/60)end end;local function u(v)g()end;local function w(x)if e.motd.type=="selectableVehicle"then g()if x.model and x.config then local y=createPlayerSpawningData(x.model,x.config,x.color,x.licenseText)local z=be:getPlayerVehicle(0)if z then core_vehicles.replaceVehicle(y.model,y.options)else core_vehicles.spawnNewVehicle(y.model,y.options)end;freezeAll(1)end end end;a.onExtensionLoaded=o;a.onExtensionUnloaded=p;a.onUpdate=q;a.onScenarioUIReady=u;a.onVehicleSelected=w;return a | ||
local a={}local b=1;local c=0;local d=0;local e,f,g,h;local function i()if f.restrictActions then extensions.core_input_actionFilter.setGroup('uj_base',f.disabledActions)extensions.core_input_actionFilter.addAction(0,'uj_base',true)log("I",e.name,"disabled "..#f.disabledActions.." actions")end end;local function j()if f.motd.enabled then guihooks.trigger('ScenarioChange',{name=f.motd.title,description=f.motd.description,introType=f.motd.type})end end;local function k(l,m)local n=core_environment.getTimeOfDay()n.time=math.abs(l+m/60-12)/12*0.5;core_environment.setTimeOfDay(n)end;local function o()if f.timesync.enabled then local p=os.date("!*t",os.time()+f.timesync.offsetHours*60*60)k(p.hour,p.min)end end;local function q(m)if f.timesync.realtime and f.timesync.enabled then local p=os.date("!*t",os.time()+(f.timesync.offsetHours*60+m)*60)k(p.hour,p.min)end end;local function r(s)if not f.reset.enabled then guihooks.trigger('toastrMsg',{type="warning",title=f.reset.title,msg=f.reset.disabledMessage,config={timeOut=f.messageDuration}})return end;if d>=f.reset.timeout or f.reset.timeout==-1 then d=0;be:resetVehicle(s)else local t=f.reset.message;t=t:gsub("{secondsLeft}",math.floor(f.reset.timeout-d))guihooks.trigger('toastrMsg',{type="warning",title=f.reset.title,msg=t,config={timeOut=f.messageDuration}})end end;local function u()g=extensions.freeroam_freeroam.onResetGameplay;extensions.freeroam_freeroam.onResetGameplay=r end;local function v()e=jsonReadFile("settings/resource.json")f=require("settings/config")log("I",e.name,"version "..e.version.." loaded")if f.motd.enabled then guihooks.trigger("ChangeState",{state="scenario-start"})end;if f.restrictMenu then extensions.core_gamestate.setGameState("scenario","freeroam","uj_base")end;i()o()u()end;local function w()extensions.core_input_actionFilter.addAction(0,'uj_base',false)extensions.core_gamestate.setGameState("freeroam","freeroam","freeroam")extensions.freeroam_freeroam.onResetGameplay=g;log("I",e.name,"version "..e.version.." unloaded, goodbye!")end;local function x(y,z,A)c=c+y;d=d+y;if c>=b then q(c/60)end end;local function B(C,D)local E=be:getPlayerVehicle(0)if E then core_vehicles.replaceVehicle(C,D)else core_vehicles.spawnNewVehicle(C,D)end end;local function F(G)if G=="start"then j()elseif G=="play"then if not h then B("pickup",{})end end end;local function H(I)if f.motd.type=="selectableVehicle"then j()if I.model and I.config then local J=createPlayerSpawningData(I.model,I.config,I.color,I.licenseText)B(J.model,J.options)h=true end end end;a.onExtensionLoaded=v;a.onExtensionUnloaded=w;a.onUpdate=x;a.onScenarioUIReady=F;a.onVehicleSelected=H;a.trackVehReset=trackVehReset;return a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"name": "uj_base", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"url": "https://github.com/vJoeyz/uj_base", | ||
"author": "vJoeyz#5115 (Uncle Joey)" | ||
} |