This is my basic countdown script for any BeamMP server.
Features are as follows:
-
Will not start a countdown if a countdown is currently active
-
No permissions need to start the countdown, any player can access this command
-
/countdown to trigger countdown
-
Display in the server log when it is loaded
-
Configurable countdown length
Download: Release BTNCountdown · BTSmoke/BeamMP · GitHub
Install:
- Simply download the plugin
- Unzip BTDCountown.zip
- Place the BTDCountdown folder into your Server folder located in Resources
- Restart your server
2 Likes
Thanks for your contribution (:
I would like to point out two things.
-
This function doesnt exists https://github.com/BTSmoke/BeamMP/blob/main/BTNCountdown.lua#L19 therefore yielding a lua error if a player sends the /coords command
-
startCountdown() is blocking the state for the duration of the countdown. If a player sends /countdown this state will block the onChatMessage event for the whole time the countdown is running. If multiple scripts listen to that event and one is blocking it then no other can execute it until its unblocked. This possibly also means that a player could spam the /countdown command and this way trigger the countdown over and over again even far after they have left the server already.
Heres a different approach https://github.com/OfficialLambdax/BeamMP-ServerScripts/blob/main/SimpleCountdown/Server/SimpleCountdown/main.lua
It returns with every left time call, so that neither this or any by it registered events is blocked for the duration of the countdown.
Sorry for the late reply, life kinda pulled me away from everything. I will look into your suggestion