Code: Select all
#include <amxmodx>
#include <engine>
new pcvar_reload_flashlight
new Float:BlockTime[33];
public plugin_init()
{
register_plugin("Anti FlashLight Spam", "1.2a", "Leo_[BH]")
pcvar_reload_flashlight = register_cvar("flashlight_reload", "1.5")
register_impulse(100, "FlashLight")
}
public FlashLight(id)
{
new Float:gametime = get_gametime()
if(BlockTime[id] <= gametime)
{
BlockTime[id] = gametime + get_pcvar_float(pcvar_reload_flashlight)
return PLUGIN_CONTINUE;
}
return PLUGIN_HANDLED;
}
public client_disconnected(id)
{
BlockTime[id] = 0.0;
}
Code: Select all
#include <amxmodx>
#include <reapi>
new pcvar_reload_flashlight
new Float:BlockTime[33];
public plugin_init()
{
register_plugin("AntiSpam FlashLight", "1.3", "Leo_[BH]")
pcvar_reload_flashlight = register_cvar("flashlight_reload", "1.5")
RegisterHookChain(GamedllFunc_CBasePlayer:RG_CBasePlayer_ImpulseCommands, "RG_ImpulseCommand", 0);
}
public RG_ImpulseCommand(id)
{
if(get_entvar(id, var_impulse) != 100) return 0
new Float:gametime = get_gametime()
if(BlockTime[id] <= gametime)
{
BlockTime[id] = gametime + get_pcvar_float(pcvar_reload_flashlight)
return 0
}
return 1
}
public client_disconnect(id)
{
BlockTime[id] = 0.0;
}
Code: Select all
#include <amxmodx>
#include <reapi>
#define PLUGIN "resetscore(ReAPI)"
#define VERSION "1.0"
#define AUTHOR "Phantom"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /rs", "resetscore"); register_clcmd("say_team /rs", "resetscore");
}
public resetscore(id) {
if(!is_user_connected(id)) return;
set_entvar(id, var_frags, 0.0);
set_member(id, m_iDeaths, 0);
message_begin(MSG_ONE_UNRELIABLE, 76, .player = id);
write_byte(id);
write_string("^1Счет обнулен");
message_end();
message_begin(MSG_ALL, 85);
write_byte(id);
write_short(0); write_short(0); write_short(0); write_short(0);
message_end();
}
+ Make a 30 seconds? wait time
+ A message just for user that he did reset the score (I see that's already.. but a more nicer.. with colors and tag.. and more..)