搜索
查看: 2571|回复: 4

[AMXX 带源码] 匪徒不同地图杀敌不同奖金的奖励插件

[复制链接]
发表于 2010-11-10 23:32:18 | 显示全部楼层 |阅读模式 来自 中国–福建–厦门
当地图dust2时,匪徒第一个杀警奖励500,第二个杀警300,第三个杀警100;
别的地图时,匪徒第一个杀警2000,第二个杀警1000,第三个杀警500。
(源码可以自己修改金额,添加第四、第五...)
集成了“任务失败处死”插件,精简了代码!小巧实用,让悍匪们疯狂冲锋吧!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
发表于 2010-11-11 10:07:56 | 显示全部楼层 来自 中国–福建–福州
不错不凑..冲锋吧.
回复

使用道具 举报

发表于 2010-11-11 14:45:45 | 显示全部楼层 来自 中国–广东–广州–番禺区
本帖最后由 kk阿朗 于 2010-11-11 14:49 编辑

没看过楼主的源码,
希望楼主把源码贴出来!
我个人想法用load file去读取数据!
比如文件内容是这样的:
  1. "de_dust" "400" "500"
复制代码
第一个是地图,第二个是T杀人,第三个是CT杀人!
这样可能会更人性化一点!不用去改源码!

edit:具体的可以看看这个贴子哈!http://www.dt-club.net/forum/thread-49678-1-1.html
在8楼有关于如何读取文件的方法!
回复

使用道具 举报

发表于 2010-11-11 15:16:18 | 显示全部楼层 来自 中国–上海–上海–松江区
支持,我顶.....
回复

使用道具 举报

发表于 2010-11-11 15:27:50 | 显示全部楼层 来自 中国–广东–广州–番禺区
我在把Connor的这个代码给你贴出来!
你这个插件应该可以弄得更好,更人性化!
  1. /*        Formatright ?2010, ConnorMcLeod

  2.         Kill Money is free software;
  3.         you can redistribute it and/or modify it under the terms of the
  4.         GNU General Public License as published by the Free Software Foundation.

  5.         This program is distributed in the hope that it will be useful,
  6.         but WITHOUT ANY WARRANTY; without even the implied warranty of
  7.         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  8.         GNU General Public License for more details.

  9.         You should have received a copy of the GNU General Public License
  10.         along with Kill Money; if not, write to the
  11.         Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  12.         Boston, MA 02111-1307, USA.
  13. */

  14. #include <amxmodx>
  15. #include <cstrike>
  16. #include <fakemeta>

  17. #define VERSION "0.1.1"

  18. enum
  19. {       
  20.         DeathMsg_KillerID = 1, // byte
  21.         DeathMsg_VictimID, // byte
  22.         DeathMsg_IsHeadshot, // byte
  23.         DeathMsg_TruncatedWeaponName // string
  24. }

  25. #define Money_Amount 1

  26. new g_iMaxPlayers
  27. #define IsPlayer(%1)        ( 1 <= %1 <= g_iMaxPlayers )

  28. #define XTRA_OFS_PLAYER 5
  29. #define m_iAccount 115
  30. #define cs_set_money_value(%1,%2)        set_pdata_int(%1, m_iAccount, %2, XTRA_OFS_PLAYER)

  31. new g_pCvarKillMoney, g_pCvarTkMoney, g_pCvarMaxMoney, g_pCvarKillMoneyHs

  32. new g_iNewMoney
  33. new g_iMsgHookMoney
  34. new gmsgMoney

  35. public plugin_init()
  36. {
  37.         register_plugin("Kill Money", VERSION, "ConnorMcLeod")

  38.         g_pCvarKillMoney = register_cvar("amx_kill_money", "300")
  39.         g_pCvarKillMoneyHs = register_cvar("amx_kill_money_hs", "1337")
  40.         g_pCvarTkMoney = register_cvar("amx_teamkill_money", "-1337")
  41.         g_pCvarMaxMoney = register_cvar("amx_killmoney_maxmoney", "16000")

  42.         register_event("DeathMsg", "Event_DeathMsg", "a")

  43.         g_iMaxPlayers = get_maxplayers()
  44.         gmsgMoney = get_user_msgid("Money")
  45.        
  46. }

  47. public Event_DeathMsg()
  48. {
  49.         new iKiller = read_data(DeathMsg_KillerID)
  50.         if( IsPlayer(iKiller) && is_user_connected(iKiller) )
  51.         {
  52.                 new iVictim = read_data(DeathMsg_VictimID)
  53.                 if( iVictim != iKiller )
  54.                 {
  55.                         g_iNewMoney = clamp
  56.                                                 (
  57.                                                         cs_get_user_money(iKiller) + get_pcvar_num( cs_get_user_team(iVictim) == cs_get_user_team(iKiller) ? g_pCvarTkMoney : (read_data(DeathMsg_IsHeadshot) ? g_pCvarKillMoneyHs : g_pCvarKillMoney) ),
  58.                                                         0,
  59.                                                         get_pcvar_num(g_pCvarMaxMoney)
  60.                                                 )
  61.                         g_iMsgHookMoney = register_message(gmsgMoney, "Message_Money")
  62.                 }
  63.         }
  64. }

  65. public Message_Money(iMsgId, iMsgDest, id)
  66. {
  67.         unregister_message(gmsgMoney, g_iMsgHookMoney)
  68.         cs_set_money_value(id, g_iNewMoney)
  69.         set_msg_arg_int(Money_Amount, ARG_LONG, g_iNewMoney)
  70. }
复制代码
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表