引用 | 編輯
xjwlcs.cn
2014-06-26 18:27 |
樓主
▼ |
||||||||||||
x0
企鹅【Amxmodx插件天书】实例1Hello world! [backcolor=rgb(254,]向全世界宣布:我要做插件~~~~囧,自己做几个简单插件与大家分享啊呵呵 废话不说了,直接上代码。 本节的目标 在游戏中按Y后输入“/test”后,游戏中显示 hello world! 字样 如图: 相关代码如下 ---------------------------------------分割线------------------------------- #include <amxmodx> #include <amxmisc> #include <fun> #define PLUGIN "HP to AP" #define VERSION "1.0" #define AUTHOR "呆笨企鹅" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) //注册插件 register_clcmd("say /test", "cmd_showtext") //设置插件激活命令,"cmd_showtext"是执行"say /test"之后的动作 } public cmd_showtext(id) { client_print(id, print_chat, "[TEST] hello world") //显示文字提示 } ---------------------------------------分割线-------------------------------
x1
|