Skip to content

Commit

Permalink
Merge branch 'version-3'
Browse files Browse the repository at this point in the history
Conflicts:
	addons/sourcemod/plugins/infinite-jumping.smx
	addons/sourcemod/scripting/infinite-jumping.sp
  • Loading branch information
chanz committed May 2, 2015
2 parents 207922c + 5d83051 commit 8d92b1c
Show file tree
Hide file tree
Showing 38 changed files with 11,730 additions and 8,702 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
infinite-jumping
================
This is a SourceMod plugin it lets users auto jump and/or double jump in mid air, when holding down the jump button.
AlliedModders Thread: https://forums.alliedmods.net/showthread.php?t=132391

SourceMod plugins: Lets user auto jump and/or double jump in mid air, when holding down space.
Merging smlib updates
================
To update smlib: We will merge the latest smlib/feature-pluginmanager into addons/sourcemod.
Commit messages are squashed, that means the history of feature-pluginmanager is compressed to one commit.
```
git remote add smlib git@github.com:bcserv/smlib.git
// folder addons/sourcemod must exist!
git merge --squash -srecursive -Xsubtree=addons/sourcemod --strategy-option theirs smlib/feature-pluginmanager
```
90 changes: 90 additions & 0 deletions addons/sourcemod/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Contribution guidelines


**Index of contents**
* What chances do I have to add new code to smlib ?
* Through pull requests
* Write/Push access (direct committing)
* General rules
* Checklist before submitting pull requests / committing new code
* Consistent code style
* smlib code style example

## What chances do I have to add new code to smlib ?

### Through pull requests

If you have a Github account, you can make one.
This will require you to fork this project to your own user first, Do/commit the changes there and create a new pull request from the master branch of your smlib repository to here.

[Here is a more detailled description on how to do it.](https://help.github.com/articles/using-pull-requests)

Also: read the rest of this document first.

### Write/Push access (direct committing)

We give people push access who have already done some successful pull requests.

[Create an issue](https://github.com/bcserv/smlib/issues/new), if you feel you would be a good team member/contributor.

## General rules

* Only add game-independent code (try to find the lowest common denominator between games), if a feature is only supported by one game, create a new file/namespace for this specific game
* Use a (to this project) consistent code style
* Don't add code that uses virtual offsets/function signatures/symbols (we don't want to maintain them)
* Write long, self-explaining function/variable names.
* If you add code from other people, don't forget to mention that in a function annotation or comment
* Document all functions with annotations (have a look at other functions)
* Comment your code (That's also useful for yourself, you will forget about things after some time)
* Add used function `#include` dependencies at top to ensure single smlib include files can be included in plugins without having to include the whole `<smlib>`
* If you are working on a bigger feature in smlib, that will require multiple commits to be made, consider creating a new feature branch ("feature-yourfeaturename") and make a pull request when you are done to merge it with the master
* Write re-usable, capsulated, readable, clean code
* Don't use the function "ServerCommand", unless you have a really really really good reason to do so.
* Don't add code that messes with the client's settings (ie. console command hacks)


## Checklist before submitting pull requests / committing new code

* Rules: read?
* Consistent code style
* Documentation written (function annotations, comments)
* Add new functions to test_compile-all.sp to make sure the even compile without warnings.
* Write a summary of what you did into the first commit message line, and more detailed information into the next lines.
* Avoid pushing merge commits (within the same branch), they pollute the histoy. Use "git rebase" to stack commits. [Here](http://randyfay.com/content/simpler-rebasing-avoiding-unintentional-merge-commits) is a good tutorial.

## Consistent code style

* We use tabs for intendation
* We use whitespace for aligning code in-line
* Use long, self-explaining variable/function names
* ALWAYS use `{` `}` brackets
* Don't use abbrevations anywhere in function/variable names etc., except they are well-known (like "HTTP")
* Use newlines to group your code into logical parts
* Write names in [camelCase](https://www.google.at/?q=camelCase)
* Make a line break if the line is already too long (we don't have a specific width)

### smlib code style example
```php
/**
* Returns the index for the first occurance of the given value.
* If the value cannot be found, -1 will be returned.
*
* @param hard Set this to true to slap the players hard.
* @return True if the slapping was successful, false otherwise
*/
function SlapAllPlayers(bool:hard=true)
{ // Function opening bracket on next line
var var1 = 1; // Variables start with a lower case letter
var anotherVar2 = 2;

for (new client=1; client <= MaxClients; client++) { // for, while, do, switch etc. brackets on same line

if () { // if, else brackets on same line
// Some code
}
else {
// Some code
}
}
}
```
9 changes: 9 additions & 0 deletions addons/sourcemod/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# smlib

Function Stock Library for Sourcemod with over 350 functions.

**URL:** http://www.sourcemodplugins.org/smlib/

**Discussion:** https://forums.alliedmods.net/showthread.php?t=148387

**Contribution guidelines:** [CONTRIBUTING.md](CONTRIBUTING.md)
122 changes: 122 additions & 0 deletions addons/sourcemod/gamedata/smlib_colors.games.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/**
* SMLib Colors Definitions (used by smlib/colors.inc)
* http://www.sourcemodplugins.org/pages/smlib/
*
* Note: This file is only needed if you need to have to override the default color settings
* and doesn't need to be distributed
* The settings below are already hardcoded into smlib.
*
* Valid colors are:
*
* "normal", // Normal
* "orange", // Orange
* "red", // Red
* "redblue", // Red, Blue
* "blue", // Blue
* "bluered", // Blue, Red
* "team", // Team
* "lightgreen", // Light green
* "gray", // GRAy
* "green", // Green
* "olivegreen", // Olive green
* "black" // BLAck
*
* Valid keyvalues are:
*
* color_code Color Code (1 - 8)
* color_alternative Defines the index of alternative color (see the chatColorInfo array in colors.inc)
* color_supported Set to "true" if the color is supported, "false" otherwise.
* color_subjecttype (see ChatColorSubjectType enum in colors.inc, any value higher than 0 defines a team color)
*/

"Games"
{
/* Default */
"#default"
{
"Keys"
{
"lightgreen_supported" "false"
"gray_supported" "false"
"black_supported" "false"
}
}

/* Counter-Strike: Source */
"cstrike"
{
"Keys"
{
"lightgreen_supported" "true"
"gray_supported" "true"
}
}

/* Team Fortress 2 */
"tf"
{
"Keys"
{
"lightgreen_supported" "true"
"gray_supported" "true"
"black_supported" "true"

"gray_code" "1"
"gray_subjecttype" "-3"
}
}

/* Half Life 2: Deathmatch */
"hl2dm"
{
"Keys"
{
"lightgreen_supported" "true"
"gray_supported" "true"
"black_supported" "true"

"red_subjecttype" "3"
"redblue_subjecttype" "3"
"blue_subjecttype" "2"
"bluered_subjecttype" "2"
}
}

/* Day of Defeat: Source */
"dod"
{
"Keys"
{
"lightgreen_supported" "true"
"gray_supported" "true"
"black_supported" "true"
// Team colors are automatically recognized as unsupported if there is no SayText2
}
}

/* Left 4 Dead */
"left4dead"
{
"Keys"
{
"lightgreen_supported" "true"
"gray_supported" "false"

"orange_code" "4"
"green_code" "5"
}
}

/* Left 4 Dead 2 */
"left4dead2"
{
"Keys"
{
"lightgreen_supported" "true"
"gray_supported" "true"

"orange_code" "4"
"green_code" "5"
}
}
}
Binary file modified addons/sourcemod/plugins/infinite-jumping.smx
Binary file not shown.
61 changes: 31 additions & 30 deletions addons/sourcemod/scripting/include/smlib.inc
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
#if defined _smlib_included
#endinput
#endif
#define _smlib_included

#define SMLIB_VERSION "0.9.7"

#include <smlib/general>

#include <smlib/arrays>
#include <smlib/clients>
#include <smlib/colors>
#include <smlib/concommands>
#include <smlib/convars>
#include <smlib/crypt>
#include <smlib/debug>
#include <smlib/dynarrays>
#include <smlib/edicts>
#include <smlib/effects>
#include <smlib/entities>
#include <smlib/files>
#include <smlib/game>
#include <smlib/math>
#include <smlib/server>
#include <smlib/strings>
#include <smlib/sql>
#include <smlib/teams>
#include <smlib/vehicles>
#include <smlib/weapons>
#include <smlib/world>
#if defined _smlib_included
#endinput
#endif
#define _smlib_included

#define SMLIB_VERSION "0.9.7"

#include <smlib/general>

#include <smlib/arrays>
#include <smlib/clients>
#include <smlib/colors>
#include <smlib/concommands>
#include <smlib/convars>
#include <smlib/crypt>
#include <smlib/debug>
#include <smlib/dynarrays>
#include <smlib/edicts>
#include <smlib/effects>
#include <smlib/entities>
#include <smlib/files>
#include <smlib/game>
#include <smlib/math>
//#include <smlib/pluginmanager>
#include <smlib/server>
#include <smlib/strings>
#include <smlib/sql>
#include <smlib/teams>
#include <smlib/vehicles>
#include <smlib/weapons>
#include <smlib/world>

0 comments on commit 8d92b1c

Please sign in to comment.