mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-09 04:23:20 +00:00
Merge branch 'master' of github.com:Jackzmc/sourcemod-plugins
This commit is contained in:
commit
5cf5b91603
2 changed files with 15 additions and 10 deletions
|
@ -1,8 +1,11 @@
|
||||||
|
|
||||||
#define MAX_TROLL_NAME_LENGTH 32
|
#define MAX_TROLL_NAME_LENGTH 32
|
||||||
#define MAX_TROLL_FLAG_LENGTH 32
|
#define MAX_TROLL_FLAG_LENGTH 32
|
||||||
|
//Allow MAX_TROLLS to be defined elsewhere
|
||||||
|
#if defined MAX_TROLLS
|
||||||
|
#else
|
||||||
#define MAX_TROLLS 29
|
#define MAX_TROLLS 29
|
||||||
//#define DEBUG 1
|
#endif
|
||||||
|
|
||||||
enum trollModifier {
|
enum trollModifier {
|
||||||
TrollMod_Invalid = 0,
|
TrollMod_Invalid = 0,
|
||||||
|
@ -28,15 +31,14 @@ char trollIds[MAX_TROLLS+1][MAX_TROLL_NAME_LENGTH];
|
||||||
|
|
||||||
enum struct Troll {
|
enum struct Troll {
|
||||||
int id;
|
int id;
|
||||||
|
int categoryID;
|
||||||
|
|
||||||
char name[MAX_TROLL_NAME_LENGTH];
|
char name[MAX_TROLL_NAME_LENGTH];
|
||||||
char description[128];
|
char description[128];
|
||||||
|
|
||||||
int mods;
|
int mods;
|
||||||
int categoryID;
|
|
||||||
|
|
||||||
int activeFlagClients[MAXPLAYERS+1];
|
int activeFlagClients[MAXPLAYERS+1];
|
||||||
|
|
||||||
ArrayList flagNames;
|
ArrayList flagNames;
|
||||||
int defaultFlags;
|
int defaultFlags;
|
||||||
bool flagsMultiselectable;
|
bool flagsMultiselectable;
|
||||||
|
@ -101,6 +103,7 @@ enum struct Troll {
|
||||||
}
|
}
|
||||||
|
|
||||||
/////// TROLL ACTIVATION
|
/////// TROLL ACTIVATION
|
||||||
|
|
||||||
void Activate(int client, int activator, trollModifier modifier = TrollMod_Invalid, int flags = 0) {
|
void Activate(int client, int activator, trollModifier modifier = TrollMod_Invalid, int flags = 0) {
|
||||||
if(modifier == TrollMod_Invalid) modifier = this.GetDefaultMod();
|
if(modifier == TrollMod_Invalid) modifier = this.GetDefaultMod();
|
||||||
ApplyTroll(client, this.name, activator, modifier, false, flags);
|
ApplyTroll(client, this.name, activator, modifier, false, flags);
|
||||||
|
@ -183,12 +186,6 @@ int GetTrollByKeyIndex(int index, Troll troll) {
|
||||||
// return GetTroll(name, troll);
|
// return GetTroll(name, troll);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GetTrollID(int index, char name[MAX_TROLL_NAME_LENGTH]) {
|
|
||||||
if(index > MAX_TROLLS) return false;
|
|
||||||
strcopy(name, sizeof(name), trollIds[index]);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ToggleTroll(int client, const char[] name, int flags = 0) {
|
void ToggleTroll(int client, const char[] name, int flags = 0) {
|
||||||
static Troll troll;
|
static Troll troll;
|
||||||
int index = GetTroll(name, troll);
|
int index = GetTroll(name, troll);
|
||||||
|
|
|
@ -55,6 +55,14 @@ void SetupTrolls() {
|
||||||
SetupTroll("Inverted Controls", "Well, aint it obvious", TrollMod_Constant);
|
SetupTroll("Inverted Controls", "Well, aint it obvious", TrollMod_Constant);
|
||||||
SetupTroll("Stagger", "Like a slap, but different", TrollMod_Instant);
|
SetupTroll("Stagger", "Like a slap, but different", TrollMod_Instant);
|
||||||
//INFO: UP MAX_TROLLS when adding new trolls!
|
//INFO: UP MAX_TROLLS when adding new trolls!
|
||||||
|
|
||||||
|
|
||||||
|
// Initialize the default flag values to -1
|
||||||
|
for(int i = 0; i <= MAX_TROLLS; i++) {
|
||||||
|
for(int j = 1; j <= MAXPLAYERS+1; j++) {
|
||||||
|
Trolls[i].activeFlagClients[j] = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddMagnetFlags(int index) {
|
void AddMagnetFlags(int index) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue