搜索
查看: 1866|回复: 2

[AMXX 带源码] 任务失败插件编译错误 麻烦大家修复下

[复制链接]
发表于 2009-10-8 14:21:18 | 显示全部楼层 |阅读模式 来自 中国–湖北–武汉–武昌区

  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. *         
  17. */

  18. #include <amxmodx>
  19. #include <amxmisc>
  20.        

  21. new white
  22. new lightning
  23. new g_sModelIndexSmoke


  24. public plugin_init(){
  25.                      
  26.     register_plugin("AMX Slay Losers","1.0","d3n14@yahoo.com")
  27.     register_event("SendAudio","end_round","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
  28.    
  29.     register_cvar("mp_slaylosers","1",FCVAR_SERVER)
  30.    
  31.     return PLUGIN_CONTINUE
  32. }


  33. public end_round(){
  34.         
  35.     // Only active if CVAR is not equal to 0
  36.     if( get_cvar_num("mp_slaylosers") ){
  37.         new parm[32]
  38.         new len = read_data(2,parm,31)
  39.         set_task(1.0,"slay_those_losers",0,parm, len + 1)
  40.     }
  41.         
  42.     return PLUGIN_CONTINUE
  43. }

  44. // Slays each player who failed to stop the other team from completing the objective.
  45. // A random slay method is chosen for each player.
  46. public slay_those_losers(parm[]) {
  47.         new origin[3], srco[3]
  48.         new player[32], playersnum
  49.         new id
  50.                        
  51.         get_players(player,playersnum,"ea",(parm[7] == 't') ? "CT" : "TERRORIST" )
  52.        
  53.         for(new i = 0; i < playersnum; ++i){       
  54.                 id = player[i]       
  55.                 get_user_origin(id,origin)                       
  56.                 origin[2] -= 26
  57.                 srco[0]=origin[0]+150
  58.                 srco[1]=origin[1]+150
  59.                 srco[2]=origin[2]+800
  60.                 switch(random_num(1,3)){       
  61.                         case 1:{
  62.                                 slay_lightning(srco,origin)
  63.                                 emit_sound(id,CHAN_ITEM, "ambience/thunder_clap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  64.                         }
  65.                         case 2:{
  66.                                 slay_blood(origin)
  67.                                 emit_sound(id,CHAN_ITEM, "weapons/headshot2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  68.                         }
  69.                         case 3:        {
  70.                                 slay_explode(origin)
  71.                                 emit_sound(id,CHAN_ITEM, "weapons/explode3.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  72.                         }
  73.                 }
  74.                 set_hudmessage(178, 14, 41, -1.0, -0.4, 1, 0.5, 1.7, 0.2, 0.2,5);
  75.                 show_hudmessage(id, "任务失败 & 不 赢 全 挂" );
  76.                 user_kill(id,1)       
  77.                 set_user_frags(id, get_user_frags(id)+1)
  78.         }       
  79. }
  80.        

  81. slay_explode(vec1[3]) {
  82.         // blast circles
  83.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
  84.         write_byte( 21 )
  85.         write_coord(vec1[0])
  86.         write_coord(vec1[1])
  87.         write_coord(vec1[2] + 16)
  88.         write_coord(vec1[0])
  89.         write_coord(vec1[1])
  90.         write_coord(vec1[2] + 1936)
  91.         write_short( white )
  92.         write_byte( 0 ) // startframe
  93.         write_byte( 0 ) // framerate
  94.         write_byte( 2 ) // life
  95.         write_byte( 16 ) // width
  96.         write_byte( 0 ) // noise
  97.         write_byte( 188 ) // r
  98.         write_byte( 220 ) // g
  99.         write_byte( 255 ) // b
  100.         write_byte( 255 ) //brightness
  101.         write_byte( 0 ) // speed
  102.         message_end()
  103.         //Explosion2
  104.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
  105.         write_byte( 12 )
  106.         write_coord(vec1[0])
  107.         write_coord(vec1[1])
  108.         write_coord(vec1[2])
  109.         write_byte( 188 ) // byte (scale in 0.1's)
  110.         write_byte( 10 ) // byte (framerate)
  111.         message_end()
  112.         //Smoke
  113.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
  114.         write_byte( 5 )
  115.         write_coord(vec1[0])
  116.         write_coord(vec1[1])
  117.         write_coord(vec1[2])
  118.         write_short( g_sModelIndexSmoke )
  119.         write_byte( 2 )  
  120.         write_byte( 10 )  
  121.         message_end()
  122. }

  123. slay_blood(vec1[3]) {
  124.         //LAVASPLASH
  125.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
  126.         write_byte( 10 )
  127.         write_coord(vec1[0])
  128.         write_coord(vec1[1])
  129.         write_coord(vec1[2])
  130.         message_end()
  131. }

  132. slay_lightning(vec1[3],vec2[3]) {
  133.         //Lightning
  134.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
  135.         write_byte( 0 )
  136.         write_coord(vec1[0])
  137.         write_coord(vec1[1])
  138.         write_coord(vec1[2])
  139.         write_coord(vec2[0])
  140.         write_coord(vec2[1])
  141.         write_coord(vec2[2])
  142.         write_short( lightning )
  143.         write_byte( 1 ) // framestart
  144.         write_byte( 5 ) // framerate
  145.         write_byte( 2 ) // life
  146.         write_byte( 20 ) // width
  147.         write_byte( 30 ) // noise
  148.         write_byte( 200 ) // r, g, b
  149.         write_byte( 200 ) // r, g, b
  150.         write_byte( 200 ) // r, g, b
  151.         write_byte( 200 ) // brightness
  152.         write_byte( 200 ) // speed
  153.         message_end()
  154.         //Sparks
  155.         message_begin( MSG_PVS, SVC_TEMPENTITY,vec2)
  156.         write_byte( 9 )
  157.         write_coord( vec2[0] )
  158.         write_coord( vec2[1] )
  159.         write_coord( vec2[2] )
  160.         message_end()
  161.         //Smoke     
  162.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec2)
  163.         write_byte( 5 )
  164.         write_coord(vec2[0])
  165.         write_coord(vec2[1])
  166.         write_coord(vec2[2])
  167.         write_short( g_sModelIndexSmoke )
  168.         write_byte( 10 )  
  169.         write_byte( 10 )  
  170.         message_end()
  171. }

  172.        
  173. public plugin_precache() {
  174.        
  175.         g_sModelIndexSmoke = precache_model("sprites/steam1.spr")
  176.         lightning = precache_model("sprites/lgtning.spr")
  177.         white = precache_model("sprites/white.spr")
  178.         precache_sound( "ambience/thunder_clap.wav")
  179.         precache_sound( "weapons/headshot2.wav")
  180.         precache_sound( "weapons/explode3.wav")

  181.        
  182.         return PLUGIN_CONTINUE
  183. }
复制代码
amxx 1.76C 环境下编译错误

本帖子中包含更多资源

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

×
发表于 2009-10-12 02:49:29 | 显示全部楼层 来自 中国–广东–深圳
  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. *         
  17. */

  18. #include <amxmodx>
  19. #include <amxmisc>
  20.         

  21. new white
  22. new lightning
  23. new g_sModelIndexSmoke


  24. public plugin_init(){
  25.                      
  26.     register_plugin("AMX Slay Losers","1.0","d3n14@yahoo.com")
  27.     register_event("SendAudio","end_round","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
  28.    
  29.     register_cvar("mp_slaylosers","1",FCVAR_SERVER)
  30.    
  31.     return PLUGIN_CONTINUE
  32. }


  33. public end_round(){
  34.         
  35.     // Only active if CVAR is not equal to 0
  36.     if( get_cvar_num("mp_slaylosers") ){
  37.         new parm[32]
  38.         new len = read_data(2,parm,31)
  39.         set_task(1.0,"slay_those_losers",0,parm, len + 1)
  40.     }
  41.         
  42.     return PLUGIN_CONTINUE
  43. }

  44. // Slays each player who failed to stop the other team from completing the objective.
  45. // A random slay method is chosen for each player.
  46. public slay_those_losers(parm[]) {
  47.         new origin[3], srco[3]
  48.         new player[32], playersnum
  49.         new id
  50.                         
  51.         get_players(player,playersnum,"ea",(parm[7] == 't') ? "CT" : "TERRORIST" )
  52.         
  53.         for(new i = 0; i < playersnum; ++i){        
  54.                 id = player[i]        
  55.                 get_user_origin(id,origin)                        
  56.                 origin[2] -= 26
  57.                 srco[0]=origin[0]+150
  58.                 srco[1]=origin[1]+150
  59.                 srco[2]=origin[2]+800
  60.                 switch(random_num(1,3)){        
  61.                         case 1:{
  62.                                 slay_lightning(srco,origin)
  63.                                 emit_sound(id,CHAN_ITEM, "ambience/thunder_clap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  64.                         }
  65.                         case 2:{
  66.                                 slay_blood(origin)
  67.                                 emit_sound(id,CHAN_ITEM, "weapons/headshot2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  68.                         }
  69.                         case 3:        {
  70.                                 slay_explode(origin)
  71.                                 emit_sound(id,CHAN_ITEM, "weapons/explode3.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  72.                         }
  73.                 }
  74.                 set_hudmessage(178, 14, 41, -1.0, -0.4, 1, 0.5, 1.7, 0.2, 0.2,5);
  75.                 show_hudmessage(id, "任务失败 & 不 赢 全 挂" );
  76.                 user_kill(id,1)        
  77.                 //set_user_frags(id, get_user_frags(id)+1)
  78.         }        
  79. }
  80.         

  81. slay_explode(vec1[3]) {
  82.         // blast circles
  83.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
  84.         write_byte( 21 )
  85.         write_coord(vec1[0])
  86.         write_coord(vec1[1])
  87.         write_coord(vec1[2] + 16)
  88.         write_coord(vec1[0])
  89.         write_coord(vec1[1])
  90.         write_coord(vec1[2] + 1936)
  91.         write_short( white )
  92.         write_byte( 0 ) // startframe
  93.         write_byte( 0 ) // framerate
  94.         write_byte( 2 ) // life
  95.         write_byte( 16 ) // width
  96.         write_byte( 0 ) // noise
  97.         write_byte( 188 ) // r
  98.         write_byte( 220 ) // g
  99.         write_byte( 255 ) // b
  100.         write_byte( 255 ) //brightness
  101.         write_byte( 0 ) // speed
  102.         message_end()
  103.         //Explosion2
  104.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
  105.         write_byte( 12 )
  106.         write_coord(vec1[0])
  107.         write_coord(vec1[1])
  108.         write_coord(vec1[2])
  109.         write_byte( 188 ) // byte (scale in 0.1's)
  110.         write_byte( 10 ) // byte (framerate)
  111.         message_end()
  112.         //Smoke
  113.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
  114.         write_byte( 5 )
  115.         write_coord(vec1[0])
  116.         write_coord(vec1[1])
  117.         write_coord(vec1[2])
  118.         write_short( g_sModelIndexSmoke )
  119.         write_byte( 2 )  
  120.         write_byte( 10 )  
  121.         message_end()
  122. }

  123. slay_blood(vec1[3]) {
  124.         //LAVASPLASH
  125.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
  126.         write_byte( 10 )
  127.         write_coord(vec1[0])
  128.         write_coord(vec1[1])
  129.         write_coord(vec1[2])
  130.         message_end()
  131. }

  132. slay_lightning(vec1[3],vec2[3]) {
  133.         //Lightning
  134.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
  135.         write_byte( 0 )
  136.         write_coord(vec1[0])
  137.         write_coord(vec1[1])
  138.         write_coord(vec1[2])
  139.         write_coord(vec2[0])
  140.         write_coord(vec2[1])
  141.         write_coord(vec2[2])
  142.         write_short( lightning )
  143.         write_byte( 1 ) // framestart
  144.         write_byte( 5 ) // framerate
  145.         write_byte( 2 ) // life
  146.         write_byte( 20 ) // width
  147.         write_byte( 30 ) // noise
  148.         write_byte( 200 ) // r, g, b
  149.         write_byte( 200 ) // r, g, b
  150.         write_byte( 200 ) // r, g, b
  151.         write_byte( 200 ) // brightness
  152.         write_byte( 200 ) // speed
  153.         message_end()
  154.         //Sparks
  155.         message_begin( MSG_PVS, SVC_TEMPENTITY,vec2)
  156.         write_byte( 9 )
  157.         write_coord( vec2[0] )
  158.         write_coord( vec2[1] )
  159.         write_coord( vec2[2] )
  160.         message_end()
  161.         //Smoke     
  162.         message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec2)
  163.         write_byte( 5 )
  164.         write_coord(vec2[0])
  165.         write_coord(vec2[1])
  166.         write_coord(vec2[2])
  167.         write_short( g_sModelIndexSmoke )
  168.         write_byte( 10 )  
  169.         write_byte( 10 )  
  170.         message_end()
  171. }

  172.         
  173. public plugin_precache() {
  174.         
  175.         g_sModelIndexSmoke = precache_model("sprites/steam1.spr")
  176.         lightning = precache_model("sprites/lgtning.spr")
  177.         white = precache_model("sprites/white.spr")
  178.         precache_sound( "ambience/thunder_clap.wav")
  179.         precache_sound( "weapons/headshot2.wav")
  180.         precache_sound( "weapons/explode3.wav")

  181.         
  182.         return PLUGIN_CONTINUE
  183. }
复制代码
回复

使用道具 举报

 楼主| 发表于 2009-10-12 10:15:37 | 显示全部楼层 来自 中国–湖北–武汉
谢谢高手
回复

使用道具 举报

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

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