|
发表于 2006-11-4 18:07:27
|
显示全部楼层
来自 中国–广东–深圳–罗湖区
回复: 求禁止喷图插件
[php]
/* USAGE: amx_blocksprays <1/0> -- Enables or Disables Plugin */
// http://forums.alliedmods.net/showthread.php?t=45567
#include <amxmodx>
#include <engine>
#include <amxmisc>
#define PLUGIN "Block Sprays"
#define VERSION "1.0"
#define AUTHOR "teame06"
#define SPRAY 201
new g_pCvarEnabled
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
g_pCvarEnabled = register_cvar("amx_blocksprays", "1")
}
// Fakemeta way would be Hooking the forward FM_CmdStart.
// An example of how to block certain command using FM_CmdStart
// <a href="http://forums.alliedmods.net/showthread.php?p=351823#post351823" target="_blank">http://forums.alliedmods.net/showthr...823#post351823</a>
public client_impulse(id, impulse)
{
if(get_pcvar_num(g_pCvarEnabled) && impulse == SPRAY)
{
//client_print(id, print_chat, "[AMXX] You are not allowed to spray.");
client_print(id, print_chat, "* 本服务器禁止喷图");
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
[/php] |
|