VCMPAI Plugin

Started by MEGAMIND, Apr 19, 2026, 05:04 PM

Previous topic - Next topic

MEGAMIND


VCMP AI Plugin (Groq API Integration)

A VCMP (Vice City Multiplayer) plugin written in C++ using the VCMP SDK that allows your server to process player input and generate AI-powered responses using the Groq API.



Overview

This plugin makes it easy to integrate AI into your VCMP server without using Node.js, sockets, or complex external systems.

With a simple function call, you can:
  • Create AI chatbots
  • Control NPC behavior
  • Build interactive systems
  • Customize AI tone and personality

Features

  • Native C++ plugin (VCMP SDK)
  • Groq API integration
  • Simple function usage
  • No external dependencies
  • Custom AI tone support
  • Lightweight and efficient

Installation

  • Place the plugin (vcmpai32.dll or vcmpai64.dll) into your server plugins folder.
  • Start your server once — it will generate:

ai.cfg

  • Open ai.cfg and add your Groq API key.
Getting a Groq API Key

Example:
api_key=your_api_key_here

Restart your server after adding the key.

Usage

getChatGPTResponse(text, player.ID, tone)

Parameters:

  • text (string) 
    Input sent to the AI. Can include anything:

  • player.ID (integer) 
    Unique ID of the player requesting the response.

  • tone (string) 
    Controls how the AI responds (style/personality).

    Examples:
    • "friendly"
    • "sarcastic"
    • "game narrator"
    • "strict admin"
Example

getChatGPTResponse(
    "How can I earn money in this server?",
    player.ID,
    "friendly and helpful"
);

Use Cases

  • AI chatbots
  • NPC dialogue (can be used with habi2 NPC system)
  • Admin tools
  • Roleplay systems
  • Smart commands

Background

Previously, implementing AI required:
  • Node.js servers
  • WebSockets
  • Complex scripting

Now, it's just one function call.

Downloads & Source

Source GitHub

Download Plugin 32-bit 
Download Plugin 64-bit

Notes

  • Make sure your API key is valid
  • Invalid config = no AI response
  • Tone affects output heavily

Feedback

Share your ideas or suggestions below — I'll try to add improvements when I get time.




MEGAMIND

#1
Quick Examples:
function onPlayerJoin( player )
{
local reply = getChatGPTResponse("Welcome this player", player.ID, "Bad");
MessagePlayer(reply.tostring(), player);
}
function onPlayerChat( player, text )
{
print( player.Name + ": " + text );
local tone = "You are Chat GPT-3.5 Turbo. Limit your responses to 3 lines.";
local reply = getChatGPTResponse(text, player.ID, tone);
        MessagePlayer("[#FF3636]"+reply.tostring(), player);
return 1;
}
function onPlayerCommand( player, cmd, text )
{
 if(cmd == "chatgpt")
{
        local tone = "You are Chat GPT-3.5 Turbo. Limit your responses to 3 lines.";
local reply = getChatGPTResponse(text, player.ID, tone);
        MessagePlayer("[#FF3636]"+reply.tostring(), player);
}
}