// MQ2NoStun.cpp : Defines the entry point for the DLL application.
// randomguy_01->I like Pie
// PLUGIN_API is only to be used for callbacks. All existing callbacks at this time
// are shown below. Remove the ones your plugin does not use. Always use Initialize
// and Shutdown for setup and cleanup, do NOT do it in DllMain.
#include "../MQ2Plugin.h"
PreSetup("MQ2NoStun");
BOOL bNoStun = FALSE;
VOID NoStunCmd(PSPAWNINFO pChar, PCHAR szLine)
{
CHAR szArg[MAX_STRING] = {0};
GetArg(szArg, szLine, 1);
if (szArg[0] == 0) { WriteChatColor("Syntax: /nostun 'on/off'",USERCOLOR_DEFAULT); }
else if (!strcmp(szArg, "on")) {
if (!bNoStun) {
bNoStun = true;
WriteChatColor("oMFgZ You CaNt Be StUNNeD!!!111one");
}
else WriteChatColor("OmFgZ YoU StiLL CaNt Be StUNNeD!!!111one", USERCOLOR_DEFAULT);
}
else if (!strcmp(szArg, "off")) {
if (bNoStun) {
bNoStun = false;
WriteChatColor("Dude- you can be stunned now, watch the fuck out.", CONCOLOR_RED);
}
else WriteChatColor("You're an idiot, NoStun is already off!", CONCOLOR_RED);
}
}
// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
DebugSpewAlways("Initializing MQ2NoStun");
AddCommand("/nostun",NoStunCmd);
}
// Called once, when the plugin is to shutdown
PLUGIN_API VOID ShutdownPlugin(VOID)
{
DebugSpewAlways("Shutting down MQ2NoStun");
AddCommand("/nostun",NoStunCmd);
}
// Called every frame that the "HUD" is drawn -- e.g. net status / packet loss bar
PLUGIN_API VOID OnDrawHUD(VOID)
{
if (bNoStun) {
GetCharInfo()->Stunned=00;
}
else return;
}