广告广告
  加入我的最爱 设为首页 风格修改
首页 首尾
 手机版   订阅   地图  繁体 
您是第 1972 个阅读者
 
发表文章 发表投票 回覆文章
  可列印版   加为IE收藏   收藏主题   上一主题 | 下一主题   
timmy3a
数位造型
个人文章 个人相簿 个人日记 个人地图
小人物
级别: 小人物 该用户目前不上站
推文 x1 鲜花 x11
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片
推文 x0
[1.6][插件] SMA 音效编写<这次简单点...不过还是不懂>
这是1个杀人吸血的插件呀~ 部份修改了~
SMA码如下
------------------------------------------------------------------------------------------------
#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN_VERSION "1.0c"

new health_add
new health_hs_add
new health_max

new nKiller
new nKiller_hp
new nHp_add1
new nHp_add2
new nHp_max


new const HeadShothSound[] = "vm/HEADSHOT.wav";
new const NormalKillSound[] = "vm/NORMALKILL.wav";

public plugin_init()
{
   register_plugin("Vampire", PLUGIN_VERSION, "Shalfey")

   health_add = register_cvar("amx_vampire_hp", "5")
   health_hs_add = register_cvar("amx_vampire_hp_hs", "10")
   health_max = register_cvar("amx_vampire_max_hp", "110")

   register_event("DeathMsg", "hook_death", "a", "1>0")     
}


public plugin_precache()
{
precache_sound(HeadShothSound);
precache_sound(NormalKillSound);
}

public hook_death(id)
{
   // Killer id
   nKiller = read_data(1)
   nKiller_hp = get_user_health(nKiller)
   nHp_max = get_pcvar_num (health_max)

   if ( (read_data(3) == 1) && (read_data(5) == 0) )
   {
        nHp_add1 = get_pcvar_num (health_hs_add)
if ( nKiller_hp < nHp_max )
{
set_user_health(nKiller, nKiller_hp + nHp_add1)
{
      emit_sound(id, CHAN_AUTO, HeadShothSound, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
  set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
    show_hudmessage(nKiller, "Healed +%d hp", nHp_add1)
}
   }
   else
   {
        nHp_add2 = get_pcvar_num (health_add)
if ( nKiller_hp < nHp_max )
{
set_user_health(nKiller, nKiller_hp + nHp_add2)
{
emit_sound(id, CHAN_AUTO, NormalKillSound, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
  set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
    show_hudmessage(nKiller, "Healed +%d hp", nHp_add2)
}


   }


   // Maximum HP check
   if (nKiller_hp > nHp_max) nKiller_hp = nHp_max


}  
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2067\\ f0\\ fs16 \n\\ par }
*/
------------------------------------------------------------------------------------------------
emit_sound 里有一些设定码 <能说明一下有什么用途吗??>

/* Constants for emit_sound() */
/* Channels */
#define CHAN_AUTO 0
#define CHAN_WEAPON 1
#define CHAN_VOICE 2
#define CHAN_ITEM 3
#define CHAN_BODY 4
#define CHAN_STREAM 5 /* allocate stream channel from the static or dynamic area */
#define CHAN_STATIC 6 /* allocate channel from the static area  */
#define CHAN_NETWORKVOICE_BASE 7 /* voice data coming across the network */
#define CHAN_NETWORKVOICE_END 500 /* network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END). */


/* Attenuation values */
#define ATTN_NONE 0.00
#define ATTN_NORM 0.80
#define ATTN_IDLE 2.00
#define ATTN_STATIC 1.25


/* Pitch values */
#define PITCH_NORM 100 /* non-pitch shifted */
#define PITCH_LOW 95 /* other values are possible - 0-255, where 255 is very high */
#define PITCH_HIGH 120
------------------------------------------------------------------------------------------------
实质插件问题:
1.如何在这插件里 设定爆头击杀时的音效

2.如何在这插件里 设定普通击杀时的音效


~ 以上设定TEST 之后都没有效果的表情



献花 x0 回到顶端 [楼 主] From:香港特别行政区 | Posted:2014-07-20 12:41 |

首页  发表文章 发表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.055238 second(s),query:15 Gzip disabled
本站由 瀛睿律师事务所 担任常年法律顾问 | 免责声明 | 本网站已依台湾网站内容分级规定处理 | 连络我们 | 访客留言