Perhaps you’re thinking now:
WTF is this guy talking about?! There’s no doctype declaration in Sourcepawn!
But in my opinion there’s some stuff that always has to be in a new script. It might be different from coder to coder but it’s like in HTML and CSS. Some things have to be declarated in every new project.
In CSS always the margin and padding is set to zero and the basic structure of every HTML file is nearly the same. The same is working with my Sourepawn, too.
Let’s see how all of my files for Sourcepawn look like!
Here is the basic “Starting File” for all my projects:
// Just for my coding style :O)
#pragma semicolon 1
// Important includes
#include <sourcemod>
// Useful definitions
#define VERSION "Alpha 1"
// Handles
// Strings
// Variables
// Errrrm ... Just informations stuff
public Plugin:myinfo =
{
name = "Your script",
author = "Daniel 'Keyschpert' Kuespert",
description = "A short description of what your script does",
version = VERSION,
url = "http://www.odelturmspringen.de"
};
public OnPluginStart()
{
CreateConVar("version", SCJ_VERSION, "Current version of your script", FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY | FCVAR_DONTRECORD);
}
In this example all necassary definitions were made and are clear. First I’ll decide how to end an command. Sometimes I am coding in C so command end with an semicolon. Then I include the standard library “sourcemod” and define my script’s version – mostly an alpha at the beginning
Yeah an the needed plugin informations will be set like the author, etc. The version is stored in the definition
The last thing which I do for every of my plugins ist an public CVAR that shows the version and has an significant name. So that the people can search in a serverlist for that CVAR if they whant to play on a server with this plugin running (for example).
This is what I call the Doctype of an Sourcepawn document.
And sry for the long abstinence but I had to do lots of things here at home and school is also no fun at the moment.
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.