- 听众
- 收听
- 积分
- 118
- 主题
- 回帖
- 0
- 精华
注册时间2010-4-10
最后登录1970-1-1
该用户从未签到
|
这是一个biohazard的拓展插件,本插件在游戏中可以添加一个生物危害标志的HUD图标,在你要变僵尸的时候,图标可以2种颜色来回闪,可是原作者做好后,发现无法这样做,就留下了这个BUG。求高手解决!还有,HUD图标除了红绿蓝,还能换其他颜色吗??
- #include <amxmodx>
- #include <fakemeta>
- #include <hamsandwich>
- #include <biohazard>
- new iconstatus;
- public plugin_precache()
- iconstatus = get_user_msgid("StatusIcon");
- public plugin_init() {
- register_plugin("bio_eyecandy","1.0","Virtual-Vybz")
- is_biomod_active() ? plugin_init2() : pause("ad")
- }
- public plugin_init2() {
- RegisterHam(Ham_Killed, "player", "cheese_killed_player")
- RegisterHam(Ham_Spawn, "player", "cheese_player_spawn_post", 1)
- }
- public cheese_player_spawn_post(id) {
- if (is_user_alive(id)) {
- set_icon_status(id, 0, 0, 0 ,0)
- set_task(0.5,"delay_spawned", id + 221)
- }
- return HAM_IGNORED
- }
- public delay_spawned(tid) {
- new id = tid - 221
- if (is_user_alive(id)) {
- if (is_user_infected(id) && !is_user_infected(id))
- set_icon_status(id, 2, 255, 255, 0)
- else if (is_user_zombie(id))
- set_icon_status(id, 1, 255, 0, 0)
- else
- set_icon_status(id, 1, 0, 255, 0)
- }
- else
- set_icon_status(id, 0, 0, 0 ,0)
- }
- public cheese_killed_player(id) {
- set_icon_status(id, 0, 0, 0 ,0)
- return HAM_IGNORED
- }
-
- public event_infect(victim, attacker) {
- set_icon_status(victim, 1, 255, 0, 0)
- }
- stock set_icon_status(id, mode, red, green, blue) {
- message_begin(MSG_ONE,iconstatus,{0,0,0},id);
- write_byte(mode); // status (0=hide, 1=show, 2=flash)
- write_string("dmg_bio"); // sprite name
- write_byte(red); // red
- write_byte(green); // green
- write_byte(blue); // blue
- message_end();
- }
-
复制代码
主插件http://forums.alliedmods.net/showthread.php?t=68523点击进入下载-bio_eyecandy.sma
bio_eyecandy.sma
|
|