Skip to content
Charles edited this page Jul 4, 2022 · 8 revisions

Getting started

The quick method

This method works, but it is not encouraged, as you will have to do it again on the next extension's update.

  1. After you installed the extension, press CTRL+SHIFT+P (Windows and Linux) or CMD+SHIFT+P (MacOS) to bring up the command palette.
  2. Type SM Install Sourcemod.
  3. Wait for the process to complete and you are ready to go.

The manual method

  1. Download the latest stable release of SourceMod for the AlliedModders' website.
  2. Unzip the folder somewhere on your computer.
  3. Go to VSCode's settings, and navigate to sourcepawn.SourcemodHome.
  4. Copy the path to the include folder in the folder you've just unzipped. It should look like: C:\Users\Sarrus\Dev\sourcemod\scripting\include.
  5. Navigate to the sourcepawn.SpcompPath setting.
  6. Copy the path to spcomp in the folder you've just unzipped. It should look like: C:\Users\Sarrus\Dev\sourcemod\scripting\spcomp.exe.

Setting up your project

You might come across the following prompt:

No main path prompt screenshot

There are 2 use case when working on a project:

Single file

You are working on a project with a single .sp file. Your project architecture looks like this:

📦MyFolder
 ┣ 📂plugins
 ┃ ┣ 📜foo.smx
 ┃ ┗ 📜bar.smx
 ┣ 📂scripting
 ┃ ┣ 📂include
 ┃ ┃ ┗ 📜baz.inc
 ┃ ┣ 📜foo.sp
 ┃ ┗ 📜bar.sp

Notice that foo.sp and bar.sp are two separate plugins, that are compiled independently. In this case, you do not need to set the main path, although it is recommended. You can safely click on Do not show again, when prompted for a main path.

Multiple file project

You are working on a larger project with multiple related .sp file. Your project architecture looks like this:

📦MyFolder
 ┣ 📂plugins
 ┃ ┗ 📜foo.smx
 ┣ 📂scripting
 ┃ ┣ 📂include
 ┃ ┃ ┣ 📜bar.sp
 ┃ ┃ ┗ 📜baz.inc
 ┃ ┗ 📜foo.sp

Notice that, here, bar is included inside of foo, they are part of the same plugin. In order to compile the plugin, you have to compile foo.sp. This is the entry point to your plugin. To set the main path, use the Set main path command as shown below:

Set main path screenshot

Clone this wiki locally