GoldenEye: Source Forums

Editing and Customization => Modding Help => Tutorials => Topic started by: Anthony on February 27, 2010, 06:33:40 am

Title: [TUTORIAL] [BEGINNER] SourceMod
Post by: Anthony on February 27, 2010, 06:33:40 am
Hey guys,

This is my first of tutorials, just an explanation of the language syntax followed by a "Hello World!" :)

Code: [Select]
#include <sourcemod> // This line tells the compiler (spcomp) to include all of the scripting inside of sourcemod.inc in the includes folder
// This line is a comment, as you can see from above this is denoted with a "//" preceding text that should be ignored by the compiler.


public OnPluginStart()
{
// In a string, which is a series of letters, the character '\' is treated as something called an escape character.
// The symbol that precedes the '\' denotes the type of escape sequence. When typing '\n' the compiler will see: Create new line. This is similar to the BR tag in HTML.
// Notice that the PrintToServer function AUTOMATICALLY adds an '\n' at the end of your input string, there is no need for one at the end.
PrintToServer("Hello world! \n Anthony is so nice, he wrote this crazy wicked tutorial for SourceMod plugins!");
}

Was that so hard? See the beginning of this tutorial and compile this bad boy. Drag the output file (helloworld.smx) into the plugins directory, located inside the sourcemod directory.
Restart your server and you will see this wonderful tutorial make you smile :)

Please ask questions or make comments within this thread. If your issue is SourceMod specific, but unrelated to this thread, feel free to create a thread in the correct sub-forum. Personal Messages are typically ignored unless they are just that... "personal."
I'm done. Enjoy.
Title: Re: [TUTORIAL] [BEGINNER] SourceMod
Post by: InvertedShadow on March 02, 2010, 01:01:51 am
That's pretty interesting, I hope people will jump up on this.
Title: Re: [TUTORIAL] [BEGINNER] SourceMod
Post by: faerachnidendro on September 06, 2015, 02:57:24 pm
Excuse the necro, but I am pretty damn keen to get in on this...

Edit:
Sourcemod and metamod installed, time to get some python hours under my belt, lua's gotten boring.