廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 1724 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為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.028910 second(s),query:15 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言