Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- //#include <tf2>
- //#include <sdkhooks>
- //#include <sdktools>
- //#include <tf2_stocks>
- //#include <smlib>
- #define PLUGIN_NAME "dicksandbutts"
- #define PLUGIN_VERSION "1.0.0"
- public Plugin:myinfo =
- {
- name = PLUGIN_NAME,
- author = "",
- description = "",
- version = PLUGIN_VERSION,
- url = ""
- }
- new Handle:cvar_enabled = INVALID_HANDLE,
- Handle:cvar_debug = INVALID_HANDLE;
- new bool:gb_enabled,
- bool:gb_debug;
- public OnPluginStart()
- {
- // command default val description
- cvar_enabled = CreateConVar("sm_enabled", "1", "Enables or disables the plugin (1/0).");
- cvar_debug = CreateConVar("sm_debug", "1", "Enables or disables the plugins debug mode (1/0).");
- RegConsoleCmd("version", cmdVersion, "Displays plugin version.");
- HookConVarChange(cvar_enabled, cvarCMDChanged); //Hook the convar so we know when the command gets changed.
- HookConVarChange(cvar_debug, cvarCMDChanged);
- }
- public OnPluginEnd()
- {
- }
- public OnMapStart()
- {
- }
- public OnMapEnd()
- {
- }
- public OnConfigsExecuted()
- {
- gb_enabled = GetConVarBool(cvar_enabled);
- gb_debug = GetConVarBool(cvar_debug);
- }
- public OnClientPostAdminCheck(client)
- {
- }
- public OnGameFrame()
- {
- for(new i=1;i<=MAXPLAYERS+1;i++) // loop through each player
- {
- if(IsClientInGame(GetClientOfUserId(i)) && GetClientHealth(GetClientOfUserId(i)) < 200)
- {
- SetEntityHealth(i, 200);
- }
- }
- }
- public Action:cmdVersion(client, args)
- {
- if (!client) return Plugin_Handled; //if client doesn't exist
- PrintToChat(client, "%s v%s", PLUGIN_NAME, PLUGIN_VERSION);
- return Plugin_Handled;
- }
- public cvarCMDChanged(Handle:cvar, const String:oldValue[], const String:newValue[])
- {
- if (cvar == cvar_enabled)
- StringToInt(newValue) ? (gb_enabled = true) : (gb_enabled = false);
- else if (cvar == cvar_debug)
- StringToInt(newValue) ? (gb_debug = true) : (gb_debug = false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement