PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "r0ma'"
// Comment next line if you want only for the current round
#define ALL_ROUNDS
#if defined ALL_ROUNDS
new g_iActive;
#endif
new g_iMaxPlayers;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
#if defined ALL_ROUNDS
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1);
#endif
register_clcmd("say /hp", "clcmd_hp");
g_iMaxPlayers = get_maxplayers();
}
#if defined ALL_ROUNDS
public fw_PlayerSpawn_Post(id) {
if(g_iActive && is_user_alive(id))
set_user_health(id, 1);
}
#endif
public clcmd_hp(id) {
if(!(get_user_flags(id) & ADMIN_CVAR))
return PLUGIN_HANDLED;
#if defined ALL_ROUNDS
g_iActive =! g_iActive;
client_print(id, print_chat, "[AMXX] 1 Hp %s", g_iActive ? "ON" : "OFF");
if(g_iActive) {
#else
client_print(id, print_chat, "[AMXX] 1 Hp ON");
#endif
for(new i = 1; i <= g_iMaxPlayers; i++) {
if(is_user_alive(i))
set_user_health(i, 1);
}
#if defined ALL_ROUNDS
}
#endif
return PLUGIN_HANDLED;
}
__________________