廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 2322 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
shawn2424
個人文章 個人相簿 個人日記 個人地圖
初露鋒芒
級別: 初露鋒芒 該用戶目前不上站
推文 x10 鮮花 x196
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[1.6] 誰能告訴我這個是??
複製程式
#define BUY_BPAMMO "items/9mmclip1.wav"

new cvar_bpcost, cvar_admin
new g_msgAmmoPickup

new const PLUGIN_NAME[] = "BP Ammo"
new const PLUGIN_VERSION[] = "v0.4"
new const AUTHOR[] = "YKH =]"

// Admin
const ACCESS_FLAG = ADMIN_LEVEL_A

// Admin Amount of ammo to give when buying additional clips for weapons
new const MAXBPAMMO[] = { -1, 104, -1, 180, -1, 64, 1, 200, 180, -1, 240, 200, 200, 180, 180, 180, 200, 240,
                 60, 240, 600, 64, 180, 240, 180, -1, 70, 180, 180, -1, 200 }

// Max BP ammo for weapons(player)
new const MAXBPAMMO2[] = { -1, 52, -1, 90, -1, 32, 1, 100, 90, -1, 120, 100, 100, 90, 90, 90, 100, 120,
                 30, 120, 200, 32, 90, 120, 90, -1, 35, 90, 90, -1, 100 }

// Admin Amount of ammo to give when buying additional clips for weapons
new const BUYAMMO[] = { -1, 52, -1, 90, -1, 32, 1, 100, 90, -1, 120, 100, 100, 90, 90, 90, 100, 120,
                 30, 120, 200, 32, 90, 120, 90, -1, 36, 90, 90, -1, 100 }

// Amount of ammo to give when buying additional clips for weapons
new const BUYAMMO2[] = { -1, 13, -1, 30, -1, 8, -1, 12, 30, -1, 30, 50, 12, 30, 30, 30, 12, 30,
                 10, 30, 30, 8, 30, 30, 30, -1, 7, 30, 30, -1, 50 }

// Ammo IDs for weapons
new const AMMOID[] = { -1, 9, -1, 2, 12, 5, 14, 6, 4, 13, 10, 7, 6, 4, 4, 4, 6, 10,
                 1, 10, 3, 5, 4, 10, 2, 11, 8, 4, 2, -1, 7 }


const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)

public plugin_init()
{
     register_plugin(PLUGIN_NAME, PLUGIN_VERSION, AUTHOR)
     register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
     cvar_bpcost = register_cvar("bpammo_cost", "30")
     cvar_admin = register_cvar("bp_admin", "0")
     register_clcmd("buyammo1", "clcmd_buyammo1")
     register_clcmd("buyammo2", "clcmd_buyammo2")
     g_msgAmmoPickup = get_user_msgid("AmmoPickup")

     // Round Start display message
     set_task(1.0, "event_round_start")

}
public plugin_precache()
{
     precache_sound(BUY_BPAMMO);
}

public clcmd_buyammo1(id)
{
     // Not alive or infinite ammo setting enabled
     if (!is_user_alive(id) || !cs_get_user_buyzone(id))
           return PLUGIN_HANDLED;

     new money = cs_get_user_money(id)
     new cost = get_pcvar_num(cvar_bpcost)

     // Get user weapons
     static weapons[32], num, i, currentammo, weaponid
     num = 0 // reset passed weapons count (bugfix)
     get_user_weapons(id, weapons, num)

     // Not enoungh Money ?
     if (money < cost)
           return PLUGIN_HANDLED;
     
     // Loop through them and give the right ammo type
     for (i = 0; i < num; i++)
     {
           // Prevents re-indexing the array
           weaponid = weapons[i]
           
           if ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM) // primary
           {
                 // Get current ammo of the weapon
                 currentammo = cs_get_user_bpammo(id, weaponid)

                 if (get_pcvar_num(cvar_admin) == 1)
                 {
                       if (get_user_flags(id) & ACCESS_FLAG)
                       {
                             // Check if we are close to the BP ammo limit
                             if (currentammo <= MAXBPAMMO[weaponid]-BUYAMMO[weaponid])
                             {
                                   // Flash ammo in hud
                                   message_begin(MSG_ONE_UNRELIABLE, g_msgAmmoPickup, _, id)
                                   write_byte(AMMOID[weaponid]) // ammo id
                                   write_byte(BUYAMMO[weaponid]) // ammo amount
                                   message_end()
                                   
                                   // Increase BP ammo
                                   emit_sound(id, CHAN_VOICE, BUY_BPAMMO, 0.9, ATTN_STATIC, 0, PITCH_NORM)// Play sounds
                                   cs_set_user_bpammo(id, weaponid, currentammo + BUYAMMO[weaponid])
                                   cs_set_user_money(id, money - cost)
                             }
                             else
                             {
                                   // Flash ammo in hud
                                   message_begin(MSG_ONE_UNRELIABLE, g_msgAmmoPickup, _, id)
                                   write_byte(AMMOID[weaponid]) // ammo id
                                   write_byte(MAXBPAMMO[weaponid]-currentammo) // ammo amount
                                   message_end()
                                   
                                   // Reached the limit
                                   cs_set_user_bpammo(id, weaponid, MAXBPAMMO[weaponid])
                             }
                       }      
                       else
                       {
                             // Check if we are close to the BP ammo limit
                             if (currentammo <= MAXBPAMMO2[weaponid]-BUYAMMO2[weaponid])
                             {
                                   // Flash ammo in hud
                                   message_begin(MSG_ONE_UNRELIABLE, g_msgAmmoPickup, _, id)
                                   write_byte(AMMOID[weaponid]) // ammo id
                                   write_byte(BUYAMMO2[weaponid]) // ammo amount
                                   message_end()
                                   
                                   // Increase BP ammo
                                   emit_sound(id, CHAN_VOICE, BUY_BPAMMO, 0.9, ATTN_STATIC, 0, PITCH_NORM)// Play sounds
                                   cs_set_user_bpammo(id, weaponid, currentammo + BUYAMMO[weaponid])
                                   cs_set_user_money(id, money - cost)
                             }
                             else
                             {
                                   // Flash ammo in hud
                                   message_begin(MSG_ONE_UNRELIABLE, g_msgAmmoPickup, _, id)
                                   write_byte(AMMOID[weaponid]) // ammo id
                                   write_byte(MAXBPAMMO2[weaponid]-currentammo) // ammo amount
                                   message_end()
                                   
                                   // Reached the limit
                                   cs_set_user_bpammo(id, weaponid, MAXBPAMMO2[weaponid])
                             }
                       }
                 }
                 else
                 {
                       // Check if we are close to the BP ammo limit
                       if (currentammo <= MAXBPAMMO[weaponid]-BUYAMMO[weaponid])
                       {
                             // Flash ammo in hud
                             message_begin(MSG_ONE_UNRELIABLE, g_msgAmmoPickup, _, id)
                             write_byte(AMMOID[weaponid]) // ammo id
                             write_byte(BUYAMMO[weaponid]) // ammo amount
                             message_end()
                             
                             // Increase BP ammo
                             emit_sound(id, CHAN_VOICE, BUY_BPAMMO, 0.9, ATTN_STATIC, 0, PITCH_NORM)// Play sounds
                             cs_set_user_bpammo(id, weaponid, currentammo + BUYAMMO[weaponid])
                             cs_set_user_money(id, money - cost)
                       }
                       else
                       {
                             // Flash ammo in hud
                             message_begin(MSG_ONE_UNRELIABLE, g_msgAmmoPickup, _, id)
                             write_byte(AMMOID[weaponid]) // ammo id
                             write_byte(MAXBPAMMO[weaponid]-currentammo) // ammo amount
                             message_end()
                             
                             // Reached the limit
                             cs_set_user_bpammo(id, weaponid, MAXBPAMMO[weaponid])
                       }
                 }
           }
     }
     return PLUGIN_HANDLED;      
}
public clcmd_buyammo2(id)
{
     // Not alive or infinite ammo setting enabled
     if (!is_user_alive(id) || !cs_get_user_buyzone(id))
           return PLUGIN_HANDLED;

     new money = cs_get_user_money(id)
     new cost = get_pcvar_num(cvar_bpcost)

     // Get user weapons
     static weapons[32], num, i, currentammo, weaponid
     num = 0 // reset passed weapons count (bugfix)
     get_user_weapons(id, weapons, num)

     // Not enoungh Money ?
     if (money < cost)
           return PLUGIN_HANDLED;
     
     // Loop through them and give the right ammo type
     for (i = 0; i < num; i++)
     {
           // Prevents re-indexing the array
           weaponid = weapons[i]

           if ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM) // secondary
           {
                 // Get current ammo of the weapon
                 currentammo = cs_get_user_bpammo(id, weaponid)

                 if (get_pcvar_num(cvar_admin) == 1)
                 {      
                       if (get_user_flags(id) & ACCESS_FLAG)
                       {
                             // Check if we are close to the BP ammo limit
                             if (currentammo <= MAXBPAMMO[weaponid]-BUYAMMO[weaponid])
                             {
                                   // Flash ammo in hud
                                   message_begin(MSG_ONE_UNRELIABLE, g_msgAmmoPickup, _, id)
                                   write_byte(AMMOID[weaponid]) // ammo id
                                   write_byte(BUYAMMO[weaponid]) // ammo amount
                                   message_end()
                                   
                                   // Increase BP ammo
                                   emit_sound(id, CHAN_VOICE, BUY_BPAMMO, 0.9, ATTN_STATIC, 0, PITCH_NORM)// Play sounds
                                   cs_set_user_bpammo(id, weaponid, currentammo + BUYAMMO[weaponid])
                                   cs_set_user_money(id, money - cost)
                             }
                             else
                             {
                                   // Flash ammo in hud
                                   message_begin(MSG_ONE_UNRELIABLE, g_msgAmmoPickup, _, id)
                                   write_byte(AMMOID[weaponid]) // ammo id
                                   write_byte(MAXBPAMMO[weaponid]-currentammo) // ammo amount
                                   message_end()
                                   
                                   // Reached the limit
                                   cs_set_user_bpammo(id, weaponid, MAXBPAMMO[weaponid])
                             }
                       }
                       else
                       {
                             // Check if we are close to the BP ammo limit
                             if (currentammo <= MAXBPAMMO2[weaponid]-BUYAMMO2[weaponid])
                             {
                                   // Flash ammo in hud
                                   message_begin(MSG_ONE_UNRELIABLE, g_msgAmmoPickup, _, id)
                                   write_byte(AMMOID[weaponid]) // ammo id
                                   write_byte(BUYAMMO2[weaponid]) // ammo amount
                                   message_end()
                                   
                                   // Increase BP ammo
                                   emit_sound(id, CHAN_VOICE, BUY_BPAMMO, 0.9, ATTN_STATIC, 0, PITCH_NORM)// Play sounds
                                   cs_set_user_bpammo(id, weaponid, currentammo + BUYAMMO[weaponid])
                                   cs_set_user_money(id, money - cost)
                             }
                             else
                             {
                                   // Flash ammo in hud
                                   message_begin(MSG_ONE_UNRELIABLE, g_msgAmmoPickup, _, id)
                                   write_byte(AMMOID[weaponid]) // ammo id
                                   write_byte(MAXBPAMMO2[weaponid]-currentammo) // ammo amount
                                   message_end()
                                   
                                   // Reached the limit
                                   cs_set_user_bpammo(id, weaponid, MAXBPAMMO2[weaponid])
                             }
                       }
                 }
                 else
                 {
                       // Check if we are close to the BP ammo limit
                       if (currentammo <= MAXBPAMMO[weaponid]-BUYAMMO[weaponid])
                       {
                             // Flash ammo in hud
                             message_begin(MSG_ONE_UNRELIABLE, g_msgAmmoPickup, _, id)
                             write_byte(AMMOID[weaponid]) // ammo id
                             write_byte(BUYAMMO[weaponid]) // ammo amount
                             message_end()
                             
                             // Increase BP ammo
                             emit_sound(id, CHAN_VOICE, BUY_BPAMMO, 0.9, ATTN_STATIC, 0, PITCH_NORM)// Play sounds
                             cs_set_user_bpammo(id, weaponid, currentammo + BUYAMMO[weaponid])
                             cs_set_user_money(id, money - cost)
                       }
                       else
                       {
                             // Flash ammo in hud
                             message_begin(MSG_ONE_UNRELIABLE, g_msgAmmoPickup, _, id)
                             write_byte(AMMOID[weaponid]) // ammo id
                             write_byte(MAXBPAMMO[weaponid]-currentammo) // ammo amount
                             message_end()
                             
                             // Reached the limit
                             cs_set_user_bpammo(id, weaponid, MAXBPAMMO[weaponid])
                       }
                 }
           }
     }
     return PLUGIN_HANDLED;
}
public event_round_start()
{
     set_task(5.0, "welcome_msg")
}
public welcome_msg()
{
     // Show mod info
     client_print(0, print_chat, "[BP] **** %s %s by %s ****", PLUGIN_NAME, PLUGIN_VERSION, AUTHOR)
}[/pre]
這是我在CS提問區看到的
有個人回的我不知道是什麼
但應該是有關改彈匣(我想應該是)
請問怎麼用這插件??



磨練CSS...
獻花 x0 回到頂端 [樓 主] From:台灣亞太線上 | Posted:2009-11-28 16:35 |
lch199743
個人文章 個人相簿 個人日記 個人地圖
初露鋒芒
級別: 初露鋒芒 該用戶目前不上站
推文 x53 鮮花 x43
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

這應該是zombieplauge40的一部份 表情
必須用在殭屍模式。
// Admin Amount of ammo to give when buying additional clips for weapons 
new const MAXBPAMMO[] = { -1, 104, -1, 180, -1, 64, 1, 200, 180, -1, 240, 200, 200, 180, 180, 180, 200, 240, 
                 60, 240, 600, 64, 180, 240, 180, -1, 70, 180, 180, -1, 200 }
這些數字是備用彈匣的彈數,槍械按照如下:
// Primary and Secondary Weapon Names
new const WEAPONNAMES[][] = { "", "P228 Compact", "", "Schmidt Scout", "", "XM1014 M4", "", "Ingram MAC-10", "Steyr AUG A1",
   "", "Dual Elite Berettas", "FiveseveN", "UMP 45", "SG-550 Auto-Sniper", "IMI Galil", "Famas",
   "USP .45 ACP Tactical", "Glock 18C", "AWP Magnum Sniper", "MP5 Navy", "M249 Para Machinegun",
   "M3 Super 90", "M4A1 Carbine", "Schmidt TMP", "G3SG1 Auto-Sniper", "", "Desert Eagle .50 AE",
   "SG-552 Commando", "AK-47 Kalashnikov", "", "ES P90" }
希望你看的懂表情


[ 此文章被lch199743在2009-12-11 22:03重新編輯 ]


獻花 x0 回到頂端 [1 樓] From:香港城市電訊 | Posted:2009-12-11 21:58 |
a7811311622 手機
個人頭像
個人文章 個人相簿 個人日記 個人地圖
特殊貢獻獎 優秀管理員勳章 社區建設獎
頭銜:我…在工作了…我…在工作了…
版主
級別: 版主 該用戶目前不上站
版區: CS提問區
推文 x771 鮮花 x2152
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

這不是ZP的一部分啦…我記得這是某插件用來改備份彈藥的最大值,
不過用在ZP效果會有點奇怪…


尚無簽名,歡迎 [新增個性化簽名]
獻花 x0 回到頂端 [2 樓] From:台灣教育部 | Posted:2009-12-12 00:17 |
lch199743
個人文章 個人相簿 個人日記 個人地圖
初露鋒芒
級別: 初露鋒芒 該用戶目前不上站
推文 x53 鮮花 x43
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

我找到了,是bpammo_features.amxx吧?


獻花 x0 回到頂端 [3 樓] From:香港城市電訊 | Posted:2009-12-12 13:17 |
a7811311622 手機
個人頭像
個人文章 個人相簿 個人日記 個人地圖
特殊貢獻獎 優秀管理員勳章 社區建設獎
頭銜:我…在工作了…我…在工作了…
版主
級別: 版主 該用戶目前不上站
版區: CS提問區
推文 x771 鮮花 x2152
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

下面是引用 shawn2424 於 2009-11-28 16:35 發表的 誰能告訴我這個是??: 到引言文
這是我在CS提問區看到的
有個人回的我不知道是什麼
但應該是有關改彈匣(我想應該是)
請問怎麼用這插件??

new const MAXBPAMMO[]→你想調整的後備彈藥量
new const MAXBPAMMO2[]→原始的後備彈藥量
new const BUYAMMO[]→當你購買的後備彈藥量大於原始的後備彈藥量(MAXBPAMMO2[])時所增加的後備彈藥量
new const BUYAMMO2[]→不用調整,這是用來判斷後備彈藥量的參數。

指令:
bp_admin 0 (1=是/0=否) 是否只有管理員有效
bpammo_cost 30 購買時花的錢(是錢,不是子彈包喔)


尚無簽名,歡迎 [新增個性化簽名]
獻花 x0 回到頂端 [4 樓] From:台灣教育部 | Posted:2009-12-13 08:24 |

首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.020222 second(s),query:16 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言