Recent posts

#51
General Discussion / VCMP UPDATER URL DOWNLOADER
Last post by MEGAMIND - Oct 19, 2025, 09:09 AM
VCMP UPDATER URL DOWNLOADER a tool that downloads and installs the build version of vcmp, this tool was made due to an unexpected behaviour going on with vcmp official browser / or networks


Its virus free 0 viruses marked by Virustotal



#include <iostream>
#include <string>
#include <vector>
#include <windows.h>
#include <urlmon.h>
#include <shlobj.h>
#include <fstream>
#include <sstream>
#include <direct.h>

#pragma comment(lib, "urlmon.lib")
#pragma comment(lib, "shell32.lib")

struct VersionInfo {
    std::string version;
    std::string filename;
    std::string build;
};

class VCMPDownloader {
private:
    std::string baseUrl = "https://u04.thijn.ovh";
    std::string baseTargetPath;

public:
    VCMPDownloader() {
        // Get the base target path
        char appDataPath[MAX_PATH];
        if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, appDataPath))) {
            baseTargetPath = std::string(appDataPath) + "\\Vice City Multiplayer\\";
        }
        else {
            baseTargetPath = "C:\\Users\\%username%\\AppData\\Local\\Vice City Multiplayer\\";
        }
    }

    bool directoryExists(const std::string& path) {
        DWORD attrib = GetFileAttributesA(path.c_str());
        return (attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_DIRECTORY));
    }

    bool createDirectory(const std::string& path) {
        // Create all directories in the path
        std::string current;
        for (size_t i = 0; i < path.length(); i++) {
            current += path[i];
            if (path[i] == '\\' || i == path.length() - 1) {
                if (!directoryExists(current) && current != "C:" && current != "C:\\") {
                    if (!CreateDirectoryA(current.c_str(), NULL)) {
                        if (GetLastError() != ERROR_ALREADY_EXISTS) {
                            return false;
                        }
                    }
                }
            }
        }
        return true;
    }

    std::string downloadPage(const std::string& url) {
        std::string tempFile = "temp_page.html";

        // Download the HTML page
        std::cout << "Downloading version information..." << std::endl;
        if (URLDownloadToFileA(NULL, url.c_str(), tempFile.c_str(), 0, NULL) != S_OK) {
            std::cout << "Failed to download page from: " << url << std::endl;
            return "";
        }

        // Read the downloaded file
        std::ifstream file(tempFile);
        if (!file.is_open()) {
            std::cout << "Failed to open temporary file" << std::endl;
            return "";
        }

        std::stringstream buffer;
        buffer << file.rdbuf();
        file.close();

        // Delete temporary file
        DeleteFileA(tempFile.c_str());

        return buffer.str();
    }

    std::vector<VersionInfo> parseVersions(const std::string& html) {
        std::vector<VersionInfo> versions;
        size_t pos = 0;

        while ((pos = html.find("Version <a href=\"/files/", pos)) != std::string::npos) {
            // Extract filename
            size_t href_start = html.find("href=\"", pos) + 6;
            size_t href_end = html.find("\"", href_start);
            if (href_end == std::string::npos) break;

            std::string filepath = html.substr(href_start, href_end - href_start);

            // Extract version
            size_t version_start = html.find(">", href_end) + 1;
            size_t version_end = html.find("<", version_start);
            if (version_end == std::string::npos) break;

            std::string version = html.substr(version_start, version_end - version_start);

            // Extract build from filename
            std::string filename = filepath.substr(filepath.find_last_of("/") + 1);
            std::string build = filename.substr(6, 8); // Extract build ID

            versions.push_back({ version, filename, build });

            pos = version_end;
        }

        return versions;
    }

    bool downloadFile(const std::string& filename) {
        std::string url = baseUrl + "/files/" + filename;
        std::string localPath = filename;

        std::cout << "Downloading: " << filename << std::endl;

        if (URLDownloadToFileA(NULL, url.c_str(), localPath.c_str(), 0, NULL) == S_OK) {
            std::cout << "Download completed: " << filename << std::endl;
            return true;
        }
        else {
            std::cout << "Download failed: " << filename << std::endl;
            return false;
        }
    }

    std::string cleanVersionName(const std::string& version) {
        std::string clean = version;
        // Replace characters that are not valid in folder names
        for (size_t i = 0; i < clean.length(); i++) {
            if (clean[i] == ':' || clean[i] == '\\' || clean[i] == '/' ||
                clean[i] == '*' || clean[i] == '?' || clean[i] == '"' ||
                clean[i] == '<' || clean[i] == '>' || clean[i] == '|') {
                clean[i] = '_';
            }
        }
        return clean;
    }

    bool extractWithWinRAR(const std::string& archivePath, const std::string& version) {
        // Common WinRAR installation paths
        const char* winRARPaths[] = {
            "C:\\Program Files\\WinRAR\\WinRAR.exe",
            "C:\\Program Files (x86)\\WinRAR\\WinRAR.exe",
            "C:\\Program Files\\WinRAR\\Rar.exe",
            "C:\\Program Files (x86)\\WinRAR\\Rar.exe"
        };

        std::string winRARExe;
        bool foundWinRAR = false;

        // Find WinRAR installation
        for (int i = 0; i < 4; i++) {
            if (GetFileAttributesA(winRARPaths[i]) != INVALID_FILE_ATTRIBUTES) {
                winRARExe = winRARPaths[i];
                foundWinRAR = true;
                std::cout << "Found WinRAR at: " << winRARExe << std::endl;
                break;
            }
        }

        if (!foundWinRAR) {
            std::cout << "WinRAR not found in standard locations!" << std::endl;
            return false;
        }

        // Create version-specific folder
        std::string cleanVersion = cleanVersionName(version);
        std::string versionTargetPath = baseTargetPath + cleanVersion + "\\";

        // Create the version directory
        if (!directoryExists(versionTargetPath)) {
            std::cout << "Creating version directory: " << versionTargetPath << std::endl;
            if (!createDirectory(versionTargetPath)) {
                std::cout << "Failed to create version directory!" << std::endl;
                return false;
            }
        }

        // Build WinRAR command
        std::string command = "\"" + winRARExe + "\" x -y -s -ibck \"" + archivePath + "\" \"" + versionTargetPath + "\"";

        std::cout << "Extracting to version folder: " << versionTargetPath << std::endl;
        std::cout << "Command: " << command << std::endl;

        STARTUPINFOA si = { sizeof(si) };
        PROCESS_INFORMATION pi;
        si.dwFlags = STARTF_USESHOWWINDOW;
        si.wShowWindow = SW_HIDE;

        if (CreateProcessA(NULL, (LPSTR)command.c_str(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
            WaitForSingleObject(pi.hProcess, INFINITE);

            DWORD exitCode;
            GetExitCodeProcess(pi.hProcess, &exitCode);

            CloseHandle(pi.hProcess);
            CloseHandle(pi.hThread);

            if (exitCode == 0) {
                std::cout << "WinRAR extraction successful to version folder!" << std::endl;
                return true;
            }
            else {
                std::cout << "WinRAR extraction failed with exit code: " << exitCode << std::endl;
            }
        }
        else {
            std::cout << "Failed to start WinRAR process!" << std::endl;
        }

        return false;
    }

    bool extract7z(const std::string& archivePath, const std::string& version) {
        // Create version-specific folder
        std::string cleanVersion = cleanVersionName(version);
        std::string versionTargetPath = baseTargetPath + cleanVersion + "\\";

        // Create the version directory
        if (!directoryExists(versionTargetPath)) {
            std::cout << "Creating version directory: " << versionTargetPath << std::endl;
            if (!createDirectory(versionTargetPath)) {
                std::cout << "Failed to create version directory!" << std::endl;
                return false;
            }
        }

        // Use 7z.exe to extract
        std::string command = "7z x \"" + archivePath + "\" -o\"" + versionTargetPath + "\" -y";

        std::cout << "Extracting with 7-Zip to version folder: " << versionTargetPath << std::endl;

        STARTUPINFOA si = { sizeof(si) };
        PROCESS_INFORMATION pi;
        si.dwFlags = STARTF_USESHOWWINDOW;
        si.wShowWindow = SW_HIDE;

        if (CreateProcessA(NULL, (LPSTR)command.c_str(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
            WaitForSingleObject(pi.hProcess, INFINITE);

            DWORD exitCode;
            GetExitCodeProcess(pi.hProcess, &exitCode);

            CloseHandle(pi.hProcess);
            CloseHandle(pi.hThread);

            if (exitCode == 0) {
                std::cout << "7-Zip extraction successful to version folder!" << std::endl;
                return true;
            }
        }

        std::cout << "7-Zip extraction failed!" << std::endl;
        return false;
    }

    void showVersions(const std::vector<VersionInfo>& versions) {
        std::cout << "\nAvailable VC:MP Versions:\n";
        std::cout << "==========================\n";

        for (size_t i = 0; i < versions.size(); i++) {
            std::cout << i + 1 << ". " << versions[i].version << " (Build: " << versions[i].build << ")\n";
        }
    }

    void run() {
        std::cout << "VC:MP Downloader and Installer\n";
        std::cout << "==============================\n\n";

        // Create base target directory if it doesn't exist
        if (!directoryExists(baseTargetPath)) {
            std::cout << "Creating base directory: " << baseTargetPath << std::endl;
            if (!createDirectory(baseTargetPath)) {
                std::cout << "Failed to create base directory: " << baseTargetPath << std::endl;
                return;
            }
        }

        // Download and parse the page
        std::string html = downloadPage(baseUrl);

        if (html.empty()) {
            std::cout << "Failed to fetch version information!" << std::endl;
            std::cout << "Press Enter to exit...";
            std::cin.ignore();
            std::cin.get();
            return;
        }

        std::vector<VersionInfo> versions = parseVersions(html);

        if (versions.empty()) {
            std::cout << "No versions found!" << std::endl;
            std::cout << "Press Enter to exit...";
            std::cin.ignore();
            std::cin.get();
            return;
        }

        // Show available versions
        showVersions(versions);

        // Let user choose version
        int choice;
        std::cout << "\nEnter the number of the version to download (1-" << versions.size() << "): ";
        std::cin >> choice;

        if (choice < 1 || choice > versions.size()) {
            std::cout << "Invalid choice!" << std::endl;
            std::cout << "Press Enter to exit...";
            std::cin.ignore();
            std::cin.get();
            return;
        }

        VersionInfo selected = versions[choice - 1];

        std::cout << "\nSelected: " << selected.version << std::endl;
        std::cout << "File: " << selected.filename << std::endl;
        std::cout << "Base Path: " << baseTargetPath << std::endl;

        // Download the file
        if (!downloadFile(selected.filename)) {
            std::cout << "Press Enter to exit...";
            std::cin.ignore();
            std::cin.get();
            return;
        }

        // Extract the file to version-specific folder
        std::cout << "\nExtracting files to version folder..." << std::endl;

        bool extracted = false;

        // Try WinRAR first
        extracted = extractWithWinRAR(selected.filename, selected.version);

        // If WinRAR fails, try 7-Zip
        if (!extracted) {
            std::cout << "Trying 7-Zip extraction..." << std::endl;
            extracted = extract7z(selected.filename, selected.version);
        }

        // Clean up downloaded archive
        if (extracted) {
            std::cout << "Cleaning up..." << std::endl;
            if (DeleteFileA(selected.filename.c_str())) {
                std::cout << "Temporary file removed." << std::endl;
            }
            std::cout << "Installation completed successfully!" << std::endl;
            std::cout << "Version installed to: " << baseTargetPath << cleanVersionName(selected.version) << "\\" << std::endl;
        }
        else {
            std::cout << "Installation failed! Make sure WinRAR or 7-Zip is installed." << std::endl;
            std::cout << "Downloaded file kept as: " << selected.filename << std::endl;
        }

        std::cout << "Press Enter to exit...";
        std::cin.ignore();
        std::cin.get();
    }
};

int main() {
    VCMPDownloader downloader;
    downloader.run();
    return 0;
}

Github repo


How to use it?

Note:
Requires winrar or 7z
#52
Script Showroom / Re: Next-Level Anti-Death Evas...
Last post by (vG)DesTroYeR^ - Oct 18, 2025, 09:48 PM
Code modified(Updated): Replaced stats AFK/Knocked with player.Action directly
#53
General Discussion / Re: MEGAMIND'S VCMP BROWSER
Last post by MEGAMIND - Oct 18, 2025, 02:11 PM
Update:
VCMP Browser for win 7 updated due to a bug that caused the theme switcher to remain at user custom theme option, its now resolved and all other themes can be applied normaly

The issue was noticed by Khattak$ response...! on discord

Users on win 7 build of the browser are required to Re-Download from Website
#54
Servers / Re: [0.4] Vice City Cops & Rob...
Last post by UncleRus - Oct 18, 2025, 11:36 AM
try reregister but discord link on server  is not work
#55
Snippet Showroom / When class condition judgment
Last post by PSL - Oct 16, 2025, 03:17 PM
This Squirrel code defines the `When` class and `when` function, enabling conditional logic functionality. The `When` class includes methods like `is` (equal to) and `isNot` (not equal to). If conditions are met, corresponding actions are executed and results are recorded, with only the first matching action triggered. Otherwise, all non-matching cases are handled, and the final result is returned.

class When {
    value = null;
    found = false;
    result = null;

    constructor(value) {
        this.value = value;
    }

    function is(expected, action) {
        if (!found && value == expected) {
            found = true;
            result = action();
        }
        return this;
    }

    function isNot(expected, action) {
        if (!found && value != expected) {
            found = true;
            result = action();
        }
        return this;
    }

    function isType(typeName, action) {
        if (!found && typeof value == typeName) {
            found = true;
            result = action();
        }
        return this;
    }

    function isNull(action) {
        if (!found && value == null) {
            found = true;
            result = action();
        }
        return this;
    }

    function inRange(min, max, action) {
        if (!found && value >= min && value <= max) {
            found = true;
            result = action();
        }
        return this;
    }

    function match(condition, action) {
        if (!found && condition(value)) {
            found = true;
            result = action();
        }
        return this;
    }

    function otherwise(action) {
        if (!found) {
            result = action();
        }
        return result;
    }
}

function when(value) {
    return When(value);
}

Here is an example
local x = 65;
local result = when(x)
    .isNull(@()"is Null")
    .isType("float", @()"Not Float")
    .is(100, @()"Max")
    .inRange(0, 35, @()"0~35")
    .inRange(35, 70, @()"35~70")
    .match(@(v) v * 2 > 150 && v < 80, @()"75~80")
    .otherwise(@()">80");

print(result); // out 0~35
#56
General Discussion / Re: MEGAMIND'S VCMP BROWSER
Last post by MEGAMIND - Oct 15, 2025, 10:27 AM

🎉 Big News! 🎉

🚀 MEGAMIND's VCMP Browser is now officially available on the Microsoft Store!

Experience the fastest, smoothest way to browse, connect, and play VC:MP — now easier than ever to install and update through the Microsoft Store.

🟦 Download now and enjoy seamless access, automatic updates, and a modern interface built for the community!

👉 Get it on Microsoft Store


Thank you to everyone who supported the project
#57
General Discussion / Re: MEGAMIND'S VCMP BROWSER
Last post by MEGAMIND - Oct 09, 2025, 11:15 AM
Update:
VCMP Browser for win 7 updater url bug fixed, The updater url was dead due to host transfer issue.. its now resolved

Note:
It is to be re-cleared again that browser doesnt rely on official vcmp browser at all..!

The issue was noticed due to Kyber7 response...! on discord

Users on win 7 build of the browser are required to Re-Download from Website
#58
General Discussion / Re: MEGAMIND'S VCMP BROWSER
Last post by MEGAMIND - Oct 07, 2025, 04:04 PM




Features
  • Added custom UI css (users can desing there own ui now)

Note:
Requires css coding knowledge to make your own ui...
Devs can do it easily ofc  ;)
To modify the custom css ui file, you have to navigate to thisC:\Users\hp\AppData\Local\VCMP_Browser\app-1.7.2\resources\extraResources\file\style.css path and edit it..!

where app-1.7.2 is app version....

In future updates ill try to make it happen in browser automatically instead of manualy modifying the file, though you can make ur master piece and share
with your freinds too..!

The best one who shows the master piece can get a chance to get added to browser officialy... with the default themes

Update your browsers to stable release (Recomended)

Note: Windows 7 users can download it from website manually

Those who have the browser already installed will get a update automatically, those who are new to this browser can download and install the latest update
#59
General Discussion / Re: MEGAMIND'S VCMP BROWSER
Last post by MEGAMIND - Oct 07, 2025, 07:31 AM


Features
  • Uninstaller bug fixed (due to previous update)

Update your browsers to stable release (Recomended)

Note: Windows 7 users can download it from website manually

Those who have the browser already installed will get a update automatically, those who are new to this browser can download and install the latest update
#60
General Discussion / Re: MEGAMIND'S VCMP BROWSER
Last post by MEGAMIND - Oct 06, 2025, 02:51 PM




Features
  • Added Favourites / Bookmark system

Note
Each hostname or row will contain a star (by default white -> Transparent in terms) when clicked, it turns yellow, means its in your favourities list.. When ever you open the browser your favourite servers will show pined at first before everyother server..!

Update your browsers to stable release (Recomended)

Note: Windows 7 users can download it from website manually

Those who have the browser already installed will get a update automatically, those who are new to this browser can download and install the latest update