引用 | 编辑
crazy4ever
2011-08-27 13:02 |
楼主
▼ |
||
x0
小弟第一次写...完全不懂 做插件 ...但又想做个 "血量少 减速插件"不知有无大大可以帮助我 ??#include <amxmodx>#include <amxmisc> #define PLUGIN "血量少 减速插件" #define low_speed#define VERSION "0.1"#define AUTHOR "ccs" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_cvar (zp_human_speed)} public speed(id) {if (hp<5000 , zp_human_speed=180)} if (hp<3000 , zp_human_speed=150)} #the end x0
|
引用 | 编辑
ChaosX
2011-08-27 14:14 |
1楼
▲ ▼ |
#include <amxmodx>
#include <amxmisc> #define PLUGIN "血量少 减速插件" #define low_speed <---这干嘛的? #define VERSION "0.1" #define AUTHOR "ccs" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_cvar (zp_human_speed) <---这= = } public speed(id) { if (hp<5000 , zp_human_speed=180) <---看就知道错了 } if (hp<3000 , zp_human_speed=150) <---这也是错了 } <---和它相对的"{"跑哪去了? #the end <--意义不明 帮你指出问题点了... 自己慢慢改 x0 |
引用 | 编辑
crazy4ever
2011-08-27 15:03 |
2楼
▲ ▼ |
哈 .. 本人写插件真烂 ...
我再找找教学吧 那 正确吗 ? #include <amxmodx> #include <zombieplague> #define PLUGIN "血量少 减速插件" #define VERSION "0.1" #define AUTHOR "ccs" public plugin_init(){ register_plugin(PLUGIN, VERSION, AUTHOR) } public speed(id) { new zhp = get_user_health(id) if ( zhp < 5000 ) fm_set_user_maxspeed = 180 if ( zhp < 3000 ) fm_set_user_maxspeed = 150 } x0 |
引用 | 编辑
文♂
2011-08-27 15:42 |
3楼
▲ ▼ |
复制程式
#include <amxmodx> //主要的 #include <fakemeta> //读取fakemeta语法 #include <zombieplague> //读取zombieplague语法 #define PLUGIN "血量少 减速插件" #define VERSION "0.1" #define AUTHOR "ccs" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_forward(FM_PlayerPreThink, "speed") //不断重复该动作"speed" } public speed(id) { if (zp_get_user_zombie(id)) //如果目标是僵尸 { new zhp = pev(id, pev_health) // 获得僵尸的hp(小数) if (zhp < 5000) //如果小于5000血 set_pev(id, pev_maxspeed, 180.0) //设定速度上限为180.0 else if (zhp < 3000) //否则 如果小于3000血 set_pev(id, pev_maxspeed, 150.0) //设定速度上限为180.0 } } 你懂的 x1 |
引用 | 编辑
Abcdzxc555
2011-08-27 15:45 |
4楼
▲ ▼ |
下面是引用 crazy4ever 于 2011-08-27 15:03 发表的 : 复制程式 #include <amxmodx> #include <fakemeta_util> public plugin_init() { register_forward(FM_PlayerPreThink, "fw_playerprethink") } public fw_playerprethink(id) { if (get_user_health(id) < 10000) fm_set_user_speed(id, 150.0) } x1 |
引用 | 编辑
crazy4ever
2011-08-27 15:48 |
5楼
▲ ▼ |
谢谢你们的帮助 ^^ 我还是不太懂 -0-
你所打的已经是完成作品? -0- x0 |