Vice City: Multiplayer

Server Development => Scripting and Server Management => Script Showroom => Topic started by: PSL on Apr 14, 2026, 11:07 AM

Title: Modular Support
Post by: PSL on Apr 14, 2026, 11:07 AM
This is a lightweight, modular management framework designed specifically for the Squirrel language. With zero dependencies and ready to use right out of the box, it comprehensively resolves the issues inherent in traditional single-script architectures—such as disorganization, difficulty in maintenance, lack of hot-updating capabilities, and event conflicts.

Through a unified module manager, the framework facilitates module loading, unloading, dependency management, lifecycle control, automatic global event dispatch, and secure timer isolation—thereby enabling your server scripts to truly achieve an engineered, modular, and extensible architecture.


Here is a simple example.

function onPlayerJoin(player) {
MessagePlayer("[#FFFF00]Hello " + player.Name, player);
}

function onScriptLoad() {
print("onScriptLoad: " + moduleName);
}

function onScriptUnload() {
print("onScriptUnload: " + moduleName);

a.Delete();
}

function hello(value) {
print("hello " + value);
}

a <- newTimer("hello", 1000, 0);

Place the script file into the "module" folder, then load the filename to add the script's functionality to the server.

ModuleManager.load("testModule");