Skip to content

Creating a new plugin in plugin sdk

Alolu edited this page Oct 22, 2023 · 7 revisions

To create a new plugin, create a new Plugin-SDK project in your IDE.

Creating a Plugin-SDK Project

This page assumes that you have fully set up your development environment, environment variables, and built the needed plugins, if not, please check out:

Visual Studio

Currently there are two ways to create your plugin, the old way might still work for older versions of Visual Studio, but does not work for the 2022 version and probably future versions.
The new way should support all versions of Visual Studio.

New way

In your plugin-sdk root folder, launch the script ./tools/myplugin-gen/Generate MyPlugin.bat A command prompt will be spawned, asking you for the game you want to create a plugin for, as of the time of writing, here are the supported inputs:

  • GTA2
  • GTA3
  • GTAVC
  • GTASA
  • GTA4

You can also type HELP for the list of allowed inputs.
Once a game has been chosen, you will be asked for a project name, the name cannot be empty.
Finally, you will need to enter your Visual Studio version for the project.

Img1New

Your project will be generated in the directory ./tools/myplugin-gen/generated/ as a directory with the project name you entered as identifier, this directory will contain the sln file inside the project_files directory.

You can now open this file with Visual Studio to start working on your plugin.

Old way

Select File>New>Project... in the menu.

In the project creation window, select category Visual C++>Plugin-SDK, and select Plugin-SDK Project template.

Img1

Then, in the Plugin-SDK Project Wizard window, configure the project and complete the creation.

! You can use Special variables for Project Wizard

Img2

Code::Blocks

Select File>New>Project... in the menu. In the project creation window, select Plugin-SDK category and Plugin-SDK Project template.

Img4

! Try not to use space characters in project paths in Code::Blocks

Then, in the Plugin-SDK Project Wizard window, configure the project and complete the creation.

! You can use Special variables for Project Wizard

Img5

Building

The project is ready for building right after the creation.

When building a final version of your plugin, use Release mode.

See also

Installing development environment (IDE)

Set up plugin-sdk