With new advanced scripting functionality it’s about time we have a forum to have some structured information that is otherwise not easily searchable on Discord.
There it is. A brand new forum!
NEW FEATURE: SCRIPTING
Current game mode is very crude and it’s basically a constant team deathmatch where both sides shoot each other. There are many more interesting things that are possible in BC engine and it’s time to give players an opportunity to harness them.
That’s why we implemented scripting language that is using the same events, hooks and functions like massively popular SA-MP. It’s just the beginning and there is partial coverage of basic functionalities. At the bottom there will be a checklist of which callbacks are already available.
How to use scripting?
It would be extremely impractical to explain such complex and advanced topic as scripting in just one post. So there it is:
- Open the editor https://editor.bad.city
- Open a map or save your map - it must MUST be saved for scripting to work
- Click on Scripting button at the top and an editor will open
- Click on Open game in dev mode that will open the game in a new tab/window
- Now you can position the editor on the left and game on the right like on the screenshot
- Start writing scripts! Press Ctrl+Enter to instantly see the changes happening in-game on the right
Here are the callbacks explained on OpenMP website:
Here’s a checklist of all SA-MP events, what is implemented and what isn’t.
Initially only basic functions are available but still we have almost half of SA-MP events spec! (V Yes and - Not yet)
OnScriptCash do not add