|
发表于 2007-1-14 13:57:18
|
显示全部楼层
来自 中国–陕西–西安
回复: 我是搞软件开发的 由于爱好CS 想自己写插件 请问该从何下手
[PHP]
#include <amxmodx>
#include <amxmisc>
#include <engine>
new g_button_press[33]
public plugin_init()
{
register_plugin("Check Attack Button", "1.0", "Rulzy")
}
public client_PreThink(id)
{
if (!is_user_connected(id)) return PLUGIN_CONTINUE
new button=get_user_button(id)
if (button & IN_ATTACK){
g_button_press[id] = 1
}else{
g_button_press[id] = 0
}
return PLUGIN_CONTINUE
}
public client_command(id)
{
new cmd[32]
read_argv(0, cmd, 31)
if(equali(cmd, "lastinv") && g_button_press[id])
client_cmd(id, "-attack")
}
[/PHP] |
|