Hello! I've (very) recently gotten into writing plugins, largely thanks to a friend of mine who generously agreed to teach me some of the basics, and even showed me to some incredibly useful resources such as the API reference. My end goal is to be able to write FF2 sub-plugins, though that's a story for another time.
The problem I'm currently having is as such: for some odd reason, this plugin, and this plugin alone, won't load on my test server, and it doesn't appear in the sm plugins menu. Just to make sure it wasn't an issue on the server's end, I wrote up a quick test program, which worked perfectly fine, so I wound up concluding that the issue is somewhere in my code. I've tried sm plugins load, I've restarted my server several times, and I've re-written my code in various ways, all to no avail, so I eventually wound up coming here for support. If somebody could point out what I did wrong, I would greatly appreciate it! Thanks in advance.
public Plugin myinfo =
name = "TF2 Chaos Mod",
description = "Applies a random perk to players when they call for medic. Future plans include applying a random perk whenever a player inputs anything, with no cooldown whatsoever.",
author = "Lord ''Spookmaster'' Homicide",
version = "0.5",
public Action Event_InitiateChaos(Event chaos, const char sEvName, bool bDontBroadcast)
AddCommandListener(playerCalledForMedic, "voicemenu 0 0");
bool cooldownCheck = false; //Global variable. From what I know, these should typically be avoided, but my limited SourcePawn knowledge makes it hard to find a work-around for the time being.
public Action playerCalledForMedic(int client, const char voicemenu, int argc)
if (!IsClientConnected(client) || !IsPlayerAlive(client))
int perkSelector = GetRandomInt(0, 128);
TF2_AddCondition(client, perkSelector, 5.0, 0);
PrintToChatAll("%N just got a perk!", GetClientOfUserId(client));
cooldownCheck = true;
PrintToChat(client, "Oops! You've gained a perk too recently. Try again in a few seconds.");
public Action cooldownReset(Handle timer)
cooldownCheck = false;