搜索
查看: 2420|回复: 0

[AMXX 带源码] 最新版的 任务失败全挂 运行好象有点问题 大家看看

[复制链接]
发表于 2009-10-8 13:54:16 | 显示全部楼层 |阅读模式 来自 中国–湖北–武汉–武昌区
本帖最后由 visa567 于 2009-10-8 14:17 编辑

直接源码

  1. /* AMX MOD X script.
  2. * This file is provided as is with no warranty.
  3. *
  4. * Presenting: Slay Losers
  5. *
  6. * Effect: Losing the objective results in a random orgy of GFX destruction
  7. *           for the losing team (everyone on the losing team DIES).
  8. *  
  9. * NOTE: The slaying will NOT remove frags.
  10. *
  11. * CVAR: Set mp_slaylosers to 0 if you want to turn it off.
  12. *
  13. * Written by: Denkkar Seffyd, now in a seperate WC3 independent package (no XP removal though)
  14. *
  15. * Install: compile then add slaylosers.amx to addons/amx/plugin.ini
  16. * Changelog
  17. *1.0 First Release by DoubleTap
  18. *1.1 Fixed some bugs. Added Multilingual Support by No0n3*   
  19. */
  20. #include <amxmodx>
  21. #include <amxmisc>
  22. #include <fun>
  23. #include <csx>
  24.        

  25. new white
  26. new lightning
  27. new g_sModelIndexSmoke

  28. new g_SlayMsg[4][] =
  29. {
  30.         "KILL_MSG_1",
  31.         "SLAY_MSG_2",
  32.         "SLAY_MSG_3",
  33.         "SLAY_MSG_4"
  34. }

  35. public plugin_init(){
  36.                      
  37.     register_plugin("AMX Slay Losers","1.1","d3n14@yahoo.com")
  38.     register_event("SendAudio","end_round","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
  39.     register_dictionary("slaylosers.txt")
  40.    
  41.     register_cvar("mp_slaylosers","1",FCVAR_SERVER)
  42.    
  43.     return PLUGIN_CONTINUE
  44. }


  45. public end_round(){
  46.         
  47.     // Only active if CVAR is not equal to 0
  48.     if( get_cvar_num("mp_slaylosers") ){
  49.         new parm[32]
  50.         new len = read_data(2,parm,31)
  51.         set_task(1.0,"slay_those_losers",0,parm, len + 1)
  52.     }
  53.         
  54.     return PLUGIN_CONTINUE
  55. }

  56. // Slays each player who failed to stop the other team from completing the objective.
  57. // A random slay method is chosen for each player.
  58. public slay_those_losers(parm[]) {
  59.         new origin[3], srco[3]
  60.         new player[32], playersnum
  61.         new id
  62.                        
  63.         get_players(player,playersnum,"ea",(parm[7] == 't') ? "CT" : "TERRORIST" )
  64.        
  65.         for(new i = 0; i < playersnum; ++i){       
  66.                 id = player[i]       
  67.                 get_user_origin(id,origin)                       
  68.                 origin[2] -= 26
  69.                 srco[0]=origin[0]+150
  70.                 srco[1]=origin[1]+150
  71.                 srco[2]=origin[2]+800
  72.                 switch(random_num(1,3)){       
  73.                         case 1:{
  74.                                 slay_lightning(srco,origin)
  75.                                 emit_sound(id,CHAN_ITEM, "ambience/thunder_clap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  76.                         }
  77.                         case 2:{
  78.                                 slay_blood(origin)
  79.                                 emit_sound(id,CHAN_ITEM, "weapons/headshot2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  80.                         }
  81.                         case 3:        {
  82.                                 slay_explode(origin)
  83.                                 emit_sound(id,CHAN_ITEM, "weapons/explode3.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  84.                         }
  85.                 }
  86.                 set_hudmessage(178, 14, 41, -1.0, -0.4, 1, 0.5, 1.7, 0.2, 0.2,5);
  87.                 show_hudmessage(LANG_PLAYER, g_SlayMsg[random_num(0, 3)]);
  88.                 user_kill(id,1)       
  89.                 set_user_frags(id, get_user_frags(id)+1)
  90.         }       
  91. }
  92.        

  93. slay_explode(vec1[3]) {
  94.         // blast circles
  95.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
  96.         write_byte( 21 )
  97.         write_coord(vec1[0])
  98.         write_coord(vec1[1])
  99.         write_coord(vec1[2] + 16)
  100.         write_coord(vec1[0])
  101.         write_coord(vec1[1])
  102.         write_coord(vec1[2] + 1936)
  103.         write_short( white )
  104.         write_byte( 0 ) // startframe
  105.         write_byte( 0 ) // framerate
  106.         write_byte( 2 ) // life
  107.         write_byte( 16 ) // width
  108.         write_byte( 0 ) // noise
  109.         write_byte( 188 ) // r
  110.         write_byte( 220 ) // g
  111.         write_byte( 255 ) // b
  112.         write_byte( 255 ) //brightness
  113.         write_byte( 0 ) // speed
  114.         message_end()
  115.         //Explosion2
  116.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
  117.         write_byte( 12 )
  118.         write_coord(vec1[0])
  119.         write_coord(vec1[1])
  120.         write_coord(vec1[2])
  121.         write_byte( 188 ) // byte (scale in 0.1's)
  122.         write_byte( 10 ) // byte (framerate)
  123.         message_end()
  124.         //Smoke
  125.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
  126.         write_byte( 5 )
  127.         write_coord(vec1[0])
  128.         write_coord(vec1[1])
  129.         write_coord(vec1[2])
  130.         write_short( g_sModelIndexSmoke )
  131.         write_byte( 2 )  
  132.         write_byte( 10 )  
  133.         message_end()
  134. }

  135. slay_blood(vec1[3]) {
  136.         //LAVASPLASH
  137.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
  138.         write_byte( 10 )
  139.         write_coord(vec1[0])
  140.         write_coord(vec1[1])
  141.         write_coord(vec1[2])
  142.         message_end()
  143. }

  144. slay_lightning(vec1[3],vec2[3]) {
  145.         //Lightning
  146.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
  147.         write_byte( 0 )
  148.         write_coord(vec1[0])
  149.         write_coord(vec1[1])
  150.         write_coord(vec1[2])
  151.         write_coord(vec2[0])
  152.         write_coord(vec2[1])
  153.         write_coord(vec2[2])
  154.         write_short( lightning )
  155.         write_byte( 1 ) // framestart
  156.         write_byte( 5 ) // framerate
  157.         write_byte( 2 ) // life
  158.         write_byte( 20 ) // width
  159.         write_byte( 30 ) // noise
  160.         write_byte( 200 ) // r, g, b
  161.         write_byte( 200 ) // r, g, b
  162.         write_byte( 200 ) // r, g, b
  163.         write_byte( 200 ) // brightness
  164.         write_byte( 200 ) // speed
  165.         message_end()
  166.         //Sparks
  167.         message_begin( MSG_PVS, SVC_TEMPENTITY,vec2)
  168.         write_byte( 9 )
  169.         write_coord( vec2[0] )
  170.         write_coord( vec2[1] )
  171.         write_coord( vec2[2] )
  172.         message_end()
  173.         //Smoke     
  174.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec2)
  175.         write_byte( 5 )
  176.         write_coord(vec2[0])
  177.         write_coord(vec2[1])
  178.         write_coord(vec2[2])
  179.         write_short( g_sModelIndexSmoke )
  180.         write_byte( 10 )  
  181.         write_byte( 10 )  
  182.         message_end()
  183. }

  184.        
  185. public plugin_precache() {
  186.        
  187.         g_sModelIndexSmoke = precache_model("sprites/steam1.spr")
  188.         lightning = precache_model("sprites/lgtning.spr")
  189.         white = precache_model("sprites/white.spr")
  190.         precache_sound( "ambience/thunder_clap.wav")
  191.         precache_sound( "weapons/headshot2.wav")
  192.         precache_sound( "weapons/explode3.wav")

  193.        
  194.         return PLUGIN_CONTINUE
  195. }
复制代码
另附带语言文件
英语好的可以顺便翻译下

[en]
KILL_MSG_1 = Objective Failed^nFailure Is Not An Option^nYou Die Now
SLAY_MSG_2 = Die L0s3rs!!!
SLAY_MSG_3 = Try to complete the mission....
SLAY_MSG_4 = Die Die Die Die!!!^nLos3rs!


麻烦英语好的帮看下
游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

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