搜索
楼主: 点通粉丝

[AMXX 带源码] 经点通高手重新改过的一些好插件源码

[复制链接]
 楼主| 发表于 2009-1-13 13:11:50 | 显示全部楼层 来自 中国–广东–广州–白云区
  1. #include <amxmod>

  2. //----------------------------------------------------------------------------------------------

  3. public plugin_init()
  4. {
  5. // Plugin Info
  6. register_plugin("H-XueBao","1.0","duper/Rockell & X-man")
  7. register_cvar("amx_medkit", "1")
  8. register_cvar("amx_medkithealth", "5")
  9. register_event("ResetHUD", "newRound","b")
  10. register_event("DeathMsg","deathevent","a")
  11. }

  12. //----------------------------------------------------------------------------------------------

  13. public newRound()
  14. {
  15. new chocolate = find_ent_by_class(-1, "chocolate")
  16. while(chocolate) {
  17. remove_entity(chocolate)
  18. chocolate = find_ent_by_class(chocolate, "chocolate")
  19. }
  20. return PLUGIN_CONTINUE
  21. }
  22. //----------------------------------------------------------------------------------------------

  23. public deathevent()
  24. {
  25. if ( !get_cvar_num("amx_medkit") )
  26.   return PLUGIN_CONTINUE

  27. new killer = read_data(1)
  28. new victim = read_data(2)
  29. if ( killer != victim )
  30. {
  31. createChocolate(victim)
  32. }
  33. if(is_user_connected(victim))
  34.   cs_reset_user_model(victim)
  35. return PLUGIN_CONTINUE
  36. }
  37. //----------------------------------------------------------------------------------------------

  38. public createChocolate(victim)
  39. {
  40. new Float:vAim[3], Float:vOrigin[3]
  41. entity_get_vector(victim, EV_VEC_origin, vOrigin)
  42. VelocityByAim(victim, random_num(2, 4), vAim)

  43. vOrigin[0] += vAim[0]
  44. vOrigin[1] += vAim[1]
  45. vOrigin[2] += 30.0

  46. new chocolate = create_entity("info_target")
  47. entity_set_string(chocolate, EV_SZ_classname, "chocolate")
  48. entity_set_model(chocolate, "models/chick.mdl")
  49. entity_set_size(chocolate, Float:{-2.5, -2.5, -1.5}, Float:{2.5, 2.5, 1.5})
  50. entity_set_int(chocolate, EV_INT_solid, 2)
  51. entity_set_int(chocolate, EV_INT_movetype, 6)
  52. entity_set_vector(chocolate, EV_VEC_origin, vOrigin)
  53. }

  54. //----------------------------------------------------------------------------------------------

  55. public plugin_precache() {
  56. precache_model("models/chick.mdl")
  57. precache_sound( "misc/killChicken.wav")
  58. }

  59. //----------------------------------------------------------------------------------------------

  60. public pfn_touch(ptr, ptd){
  61. if(!is_valid_ent(ptd) || !is_valid_ent(ptr))
  62.   return PLUGIN_CONTINUE

  63. if(!is_user_connected(ptd) || !is_user_alive(ptd))
  64.   return PLUGIN_CONTINUE

  65. new classname[32]
  66. entity_get_string(ptr, EV_SZ_classname, classname, 31)
  67. if(equal(classname, "chocolate"))
  68. {
  69. new gOrigHealth = get_user_health(ptd)
  70. new health = gOrigHealth + get_cvar_num("amx_medkithealth")
  71. set_user_health(ptd, health)
  72. emit_sound(ptd,CHAN_VOICE,"misc/killChicken.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  73. remove_entity(ptr)
  74. }
  75. return PLUGIN_CONTINUE
  76. }   

  77. public client_death(killer, victim, wpnindex, hitplace, TK)
  78. {
  79.         if(wpnindex == CSW_C4  && is_user_connected(victim))
  80.                 cs_reset_user_model(victim)
  81. }
复制代码
20# 点通粉丝

死后变小鸡血包+5HP
回复

使用道具 举报

 楼主| 发表于 2009-1-13 13:14:14 | 显示全部楼层 来自 中国–广东–广州–白云区
  1. /* Nomore Grenade  version 0.1.0        Date:05/30/2003  
  2. *
  3. *
  4. * (c) Copyright 2003, Coolzsb@21cn.com
  5. *
  6. */

  7. #include <amxmod>


  8. new he[33]
  9. new flashg[33]
  10. new smoke[33]

  11. public reset_hud(id) {
  12.     he[id] = 0
  13.     flashg[id] = 0
  14.     smoke[id] = 0
  15.     return PLUGIN_CONTINUE
  16. }

  17. public hebuy(id){
  18.     if (he[id]){
  19.         engclient_cmd(id,"menuselect","10")
  20.         client_print(id,print_center,"Ni Zhi Neng Mai 1 Ke Shou Lei !")
  21.     }
  22.     he[id]++
  23.     return PLUGIN_CONTINUE
  24. }

  25. public flashbuy(id){
  26.     if (flashg[id]>1){
  27.         engclient_cmd(id,"menuselect","10")
  28.         client_print(id,print_center,"Ni Zhi Neng Mai 1 Ke Shan Guang Dan !")
  29.     }

  30.     flashg[id]++

  31.     return PLUGIN_CONTINUE
  32. }

  33. public smokebuy(id){
  34.     if (smoke[id]){
  35.         engclient_cmd(id,"menuselect","10")
  36.         client_print(id,print_center,"Ni Zhi Neng Mai 1 Ke Yan Wu Dan !")
  37.     }
  38.     smoke[id]++
  39.     return PLUGIN_CONTINUE
  40. }


  41. public plugin_init(){
  42.     register_plugin("Nomore Grenade","0.1.0","Coolzsb")
  43.     register_menucmd(register_menuid("BuyItem"),1<<3,"hebuy")
  44.     register_menucmd(register_menuid("BuyItem"),1<<2,"flashbuy")
  45.     register_menucmd(register_menuid("BuyItem"),1<<4,"smokebuy")     
  46.     register_event("ResetHUD", "reset_hud", "b");  
  47.     return PLUGIN_CONTINUE
  48. }
复制代码
21# 点通粉丝

每局自动送o3...o4....o5
回复

使用道具 举报

 楼主| 发表于 2009-1-13 13:17:08 | 显示全部楼层 来自 中国–广东–广州–白云区
  1. */


  2. #include <amxmodx>
  3. #include <csx>


  4. new g_sprite;


  5. public plugin_init()
  6. {
  7.         register_plugin("Death-info beams", "3.0", "BMJ");
  8.         register_event("CS_DeathMsg", "death_msg", "a");

  9.         register_cvar("amx_dib_holdtime", "100");
  10.         register_cvar("amx_dib_width", "2");
  11.         register_cvar("amx_dib_cross", "10");
  12.         register_cvar("amx_dib_color", "255255000");
  13. }


  14. public plugin_precache()
  15. {
  16.         g_sprite = precache_model("sprites/dot.spr");
  17. }


  18. public death_msg()
  19. {
  20.         new killer = read_data(1);
  21.         new victim = read_data(2);
  22.         if (killer == victim)
  23.                 return PLUGIN_HANDLED;

  24.         new vec_killer[3];
  25.         new vec_victim[3];
  26.         get_user_origin(killer, vec_killer, 1);
  27.         get_user_origin(victim, vec_victim);

  28.         new color[12];
  29.         get_cvar_string("amx_dib_color", color, 11);
  30.         new b = str_to_num(color[6]);
  31.         color[6] = 0;
  32.         new g = str_to_num(color[3]);
  33.         color[3] = 0;
  34.         new r = str_to_num(color[0]);

  35.         new size = get_cvar_num("amx_dib_cross");

  36.         message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, victim);
  37.         write_byte(0);
  38.         write_coord(vec_killer[0] + size);
  39.         write_coord(vec_killer[1]);
  40.         write_coord(vec_killer[2]);
  41.         write_coord(vec_killer[0] - size);
  42.         write_coord(vec_killer[1]);
  43.         write_coord(vec_killer[2]);
  44.         write_short(g_sprite);
  45.         write_byte(1);
  46.         write_byte(1);
  47.         write_byte(get_cvar_num("amx_dib_holdtime"));        // x 0.1
  48.         write_byte(get_cvar_num("amx_dib_width"));        // x 0.1
  49.         write_byte(0);
  50.         if (get_user_team(killer) == 1)
  51.         {
  52.                 write_byte(255);
  53.                 write_byte(255);
  54.                 write_byte(0);
  55.         }
  56.         else
  57.         {
  58.                 write_byte(255);
  59.                 write_byte(255);
  60.                 write_byte(0);
  61.         }
  62.         write_byte(100);
  63.         write_byte(0);
  64.         message_end();

  65.         message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, victim);
  66.         write_byte(0);
  67.         write_coord(vec_killer[0]);
  68.         write_coord(vec_killer[1] + size);
  69.         write_coord(vec_killer[2]);
  70.         write_coord(vec_killer[0]);
  71.         write_coord(vec_killer[1] - size);
  72.         write_coord(vec_killer[2]);
  73.         write_short(g_sprite);
  74.         write_byte(1);
  75.         write_byte(1);
  76.         write_byte(get_cvar_num("amx_dib_holdtime"));        // x 0.1
  77.         write_byte(get_cvar_num("amx_dib_width"));        // x 0.1
  78.         write_byte(0);
  79.         if (get_user_team(killer) == 1)
  80.         {
  81.                 write_byte(255);
  82.                 write_byte(255);
  83.                 write_byte(0);
  84.         }
  85.         else
  86.         {
  87.                 write_byte(255);
  88.                 write_byte(255);
  89.                 write_byte(0);
  90.         }
  91.         write_byte(100);
  92.         write_byte(0);
  93.         message_end();

  94.         message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, victim);
  95.         write_byte(0);
  96.         write_coord(vec_killer[0]);
  97.         write_coord(vec_killer[1]);
  98.         write_coord(vec_killer[2] + size);
  99.         write_coord(vec_killer[0]);
  100.         write_coord(vec_killer[1]);
  101.         write_coord(vec_killer[2] - size);
  102.         write_short(g_sprite);
  103.         write_byte(1);
  104.         write_byte(1);
  105.         write_byte(get_cvar_num("amx_dib_holdtime"));        // x 0.1
  106.         write_byte(get_cvar_num("amx_dib_width"));        // x 0.1
  107.         write_byte(0);
  108.         if (get_user_team(killer) == 1)
  109.         {
  110.                 write_byte(255);
  111.                 write_byte(255);
  112.                 write_byte(0);
  113.         }
  114.         else
  115.         {
  116.                 write_byte(255);
  117.                 write_byte(255);
  118.                 write_byte(0);
  119.         }
  120.         write_byte(100);
  121.         write_byte(0);
  122.         message_end();

  123.         message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, victim);
  124.         write_byte(0);
  125.         write_coord(vec_victim[0] + size);
  126.         write_coord(vec_victim[1]);
  127.         write_coord(vec_victim[2]);
  128.         write_coord(vec_victim[0] - size);
  129.         write_coord(vec_victim[1]);
  130.         write_coord(vec_victim[2]);
  131.         write_short(g_sprite);
  132.         write_byte(1);
  133.         write_byte(1);
  134.         write_byte(get_cvar_num("amx_dib_holdtime"));        // x 0.1
  135.         write_byte(get_cvar_num("amx_dib_width"));        // x 0.1
  136.         write_byte(0);
  137.         if (get_user_team(victim) == 1)
  138.         {
  139.                 write_byte(255);
  140.                 write_byte(255);
  141.                 write_byte(0);
  142.         }
  143.         else
  144.         {
  145.                 write_byte(255);
  146.                 write_byte(255);
  147.                 write_byte(0);
  148.         }
  149.         write_byte(100);
  150.         write_byte(0);
  151.         message_end();

  152.         message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, victim);
  153.         write_byte(0);
  154.         write_coord(vec_victim[0]);
  155.         write_coord(vec_victim[1] + size);
  156.         write_coord(vec_victim[2]);
  157.         write_coord(vec_victim[0]);
  158.         write_coord(vec_victim[1] - size);
  159.         write_coord(vec_victim[2]);
  160.         write_short(g_sprite);
  161.         write_byte(1);
  162.         write_byte(1);
  163.         write_byte(get_cvar_num("amx_dib_holdtime"));        // x 0.1
  164.         write_byte(get_cvar_num("amx_dib_width"));        // x 0.1
  165.         write_byte(0);
  166.         if (get_user_team(victim) == 1)
  167.         {
  168.                 write_byte(255);
  169.                 write_byte(255);
  170.                 write_byte(0);
  171.         }
  172.         else
  173.         {
  174.                 write_byte(255);
  175.                 write_byte(255);
  176.                 write_byte(0);
  177.         }
  178.         write_byte(100);
  179.         write_byte(0);
  180.         message_end();

  181.         message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, victim);
  182.         write_byte(0);
  183.         write_coord(vec_victim[0]);
  184.         write_coord(vec_victim[1]);
  185.         write_coord(vec_victim[2] + size);
  186.         write_coord(vec_victim[0]);
  187.         write_coord(vec_victim[1]);
  188.         write_coord(vec_victim[2] - size);
  189.         write_short(g_sprite);
  190.         write_byte(1);
  191.         write_byte(1);
  192.         write_byte(get_cvar_num("amx_dib_holdtime"));        // x 0.1
  193.         write_byte(get_cvar_num("amx_dib_width"));        // x 0.1
  194.         write_byte(0);
  195.         if (get_user_team(victim) == 1)
  196.         {
  197.                 write_byte(255);
  198.                 write_byte(255);
  199.                 write_byte(0);
  200.         }
  201.         else
  202.         {
  203.                 write_byte(255);
  204.                 write_byte(255);
  205.                 write_byte(0);
  206.         }
  207.         write_byte(100);
  208.         write_byte(0);
  209.         message_end();

  210.         message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, victim);
  211.         write_byte(0);
  212.         write_coord(vec_killer[0]);
  213.         write_coord(vec_killer[1]);
  214.         write_coord(vec_killer[2]);
  215.         write_coord(vec_victim[0]);
  216.         write_coord(vec_victim[1]);
  217.         write_coord(vec_victim[2]);
  218.         write_short(g_sprite);
  219.         write_byte(1);
  220.         write_byte(1);
  221.         write_byte(get_cvar_num("amx_dib_holdtime"));        // x 0.1
  222.         write_byte(get_cvar_num("amx_dib_width"));        // x 0.1
  223.         write_byte(0);
  224.         write_byte(r);
  225.         write_byte(g);
  226.         write_byte(b);
  227.         write_byte(100);
  228.         write_byte(0);
  229.         message_end();

  230.         return PLUGIN_HANDLED;
  231. }
复制代码
dib.sma                        ; 死忘射线
回复

使用道具 举报

 楼主| 发表于 2009-1-13 13:19:03 | 显示全部楼层 来自 中国–广东–广州–白云区
  1. */

  2. #include <amxmod>
  3. new planter
  4. new realplanter=0
  5. new realplanterid
  6. new ifbombed=2
  7. new defuser
  8. new realdefuser
  9. new realdefuserid
  10. new awardshp
  11. new awardsfrags
  12. new awardsmoney

  13. public get_awardmode() {
  14.         new awardmode[10]
  15.         get_cvar_string("amx_bomb_awards",awardmode,10)
  16.         awardshp=get_cvar_num("amx_bombawards_hp")
  17.         if ((awardshp<0 )||(awardshp>155)){
  18.                 awardshp=50
  19.         }
  20.         awardsfrags=get_cvar_num("amx_bombawards_frags")
  21.         if ((awardsfrags<0 )||(awardsfrags>5)){
  22.                 awardsfrags=3
  23.         }
  24.         awardsmoney=get_cvar_num("amx_bombawards_money")
  25.         if ((awardsmoney<0)||(awardsmoney>5000)){
  26.                 awardsmoney=500
  27.         }
  28.         return read_flags(awardmode)
  29. }
  30. public got_bomb(id){
  31.         planter = id
  32.         defuser = 0
  33. }
  34. public bdef_g(id){
  35.         if (!(read_data(1) == 3)){
  36.                 defuser = id
  37.         }
  38. }
  39. public bomb_planted(){
  40.         new awardmode = get_awardmode()
  41.         realplanter=planter
  42.         ifbombed=2
  43.         if (awardmode&1){
  44.                 if (get_user_health(realplanter)<100){
  45.                         set_user_health(realplanter,get_user_health(realplanter)+awardshp)
  46.                 }
  47.                 else{
  48.                         set_user_health(realplanter,100+awardshp)
  49.                 }
  50.                 realplanterid=get_user_userid(realplanter)
  51.         }
  52.         if (awardmode&4){
  53.                 if ((get_user_money(realplanter)+awardsmoney)<16000){
  54.                         set_user_money(realplanter,get_user_money(realplanter)+awardsmoney)
  55.                 }
  56.                 else{
  57.                         set_user_money(realplanter,16000)
  58.                 }
  59.                 new name [32]
  60.                 get_user_name(realplanter,name,31)
  61.                 set_hudmessage(85, 62, 210, 0.03, 0.85, 0, 6.0, 6.0, 0.5, 0.15, 3)
  62.                 show_hudmessage(0,"[%s] Fang Zhi C4+ %d$$$",name,awardsmoney)
  63.                 client_cmd(0,"spk djeyl/c4start")
  64.         }
  65. }
  66. public bomb_defused(){
  67.         new awardmode = get_awardmode()
  68.         realdefuser=defuser
  69.         ifbombed=0
  70.         if (awardmode&1){
  71.                 if (get_user_health(realdefuser)<100){
  72.                         set_user_health(realdefuser,get_user_health(realdefuser)+awardshp)
  73.                 }
  74.                 else{
  75.                         set_user_health(realdefuser,100+awardshp)
  76.                 }
  77.                 realdefuserid=get_user_userid(realdefuser)
  78.         }
  79.         if (awardmode&2){
  80.                 set_user_frags(realdefuser,get_user_frags(realdefuser)+awardsfrags)
  81.                 set_user_frags(realplanter,get_user_frags(realplanter)-awardsfrags)
  82.         }
  83.         if (awardmode&4){
  84.                 // set_user_money(realplanter,get_user_money(realplanter)-awardsmoney)
  85.                 if ((get_user_money(realdefuser)+awardsmoney)<16000){
  86.                         set_user_money(realdefuser,get_user_money(realdefuser)+awardsmoney)
  87.                 }
  88.                 else{
  89.                         set_user_money(realdefuser,16000)
  90.                 }
  91.                 new name [32]
  92.                 get_user_name(realdefuser,name,31)
  93.                 set_hudmessage(85, 62, 210, 0.03, 0.85, 0, 6.0, 6.0, 0.5, 0.15, 3)
  94.                 show_hudmessage(0,"%s [ChaiChuC4]DeDao $ %d $$$$",name,awardsmoney)
  95.                 client_cmd(0,"spk djeyl/goal_1")
  96.         }
  97.        
  98. }
  99. public Target_Bombed(){
  100.         new awardmode = get_awardmode()
  101.         ifbombed=1
  102.         if (awardmode&2){
  103.                 set_user_frags(realplanter,get_user_frags(realplanter)+awardsfrags)
  104.         }
  105.         //if (awardmode&4){
  106.         //if ((get_user_money(realplanter)+awardsmoney)<16000){
  107.         //set_user_money(realplanter,get_user_money(realplanter)+awardsmoney)
  108.         //}
  109.         //else{
  110.         //set_user_money(realplanter,16000)
  111.         //}
  112.         //}
  113. }
  114. public restartround(){
  115.         realplanter=0
  116.         realdefuser=0
  117. }
  118. public round_start(){
  119.         new awardmode = get_awardmode()
  120.         if (awardmode&1){
  121.                 new team_name[2]
  122.                 if (get_user_userid(realplanter)==realplanterid){
  123.                         get_user_team(realplanter,team_name,1)
  124.                         if (team_name[0] == 'T') {
  125.                                 switch (ifbombed){
  126.                                         //case 1: set_user_health(realplanter,100+awardshp) //I think this must be unfair to CT
  127.                                         case 0: set_user_health(realplanter,100-awardshp)
  128.                                 }
  129.                         }
  130.                 }
  131.                 if (get_user_userid(realdefuser)==realdefuserid){
  132.                         get_user_team(realdefuser,team_name,1)
  133.                         if (team_name[0] == 'C') {
  134.                                 set_user_health(realdefuser,100+awardshp)
  135.                         }
  136.                 }
  137.         }
  138. }
  139. public plugin_init(){
  140.         register_plugin("H-FangBao","0.1.3","Coolzsb")
  141.         register_event("StatusIcon", "got_bomb", "be", "1=1", "1=2", "2=c4")
  142.         register_event("SendAudio", "bomb_planted", "a", "2&%!MRAD_BOMBPL")
  143.         register_event("SendAudio", "bomb_defused", "a", "2&%!MRAD_BOMBDEF")
  144.         register_event("TextMsg", "Target_Bombed", "a", "2&#Target_Bombed")
  145.         register_event("TextMsg","restartround","a","2&#Game_will_restart_in")
  146.         register_event("BarTime", "bdef_g", "be", "1=10", "1=5","1=3")
  147.         register_event("ResetHUD", "round_start", "be")
  148.         register_cvar("amx_bomb_awards","c")
  149.         register_cvar("amx_bombawards_hp","50")
  150.         register_cvar("amx_bombawards_frags","3")
  151.         register_cvar("amx_bombawards_money","2888")
  152.         return PLUGIN_CONTINUE
  153. }
复制代码
23# 点通粉丝

放包奖励2888$
回复

使用道具 举报

 楼主| 发表于 2009-1-13 13:20:13 | 显示全部楼层 来自 中国–广东–广州–白云区
  1. #include <amxmod>
  2. public headshot(){
  3.         new killer = read_data(1)
  4.         new victim = read_data(2)
  5.         new Killer[33]
  6.         new Victim[33]
  7.         get_user_name(killer, Killer,32)
  8.         get_user_name(victim, Victim,32)
  9.         if(get_user_team(killer) != get_user_team(victim)){
  10.                 new x = random_num(1888, 1888)
  11.                 set_user_money(killer,x+get_user_money(killer))
  12.                 set_hudmessage(85, 62, 210, 0.03, 0.85, 0, 6.0, 6.0, 0.5, 0.15, 3)
  13.                 show_hudmessage(0, "[%s] Bao Tou + %d $$$",Killer,x)
  14.         }
  15.         return PLUGIN_CONTINUE
  16. }
  17. public plugin_init() {  
  18.         register_plugin("H-BaoTou","0.0","default")
  19.         register_event("DeathMsg","headshot","ade","3=1","5=0")
  20.         return PLUGIN_CONTINUE  
  21. }  
复制代码
24# 点通粉丝

爆头奖1888
回复

使用道具 举报

 楼主| 发表于 2009-1-13 13:21:30 | 显示全部楼层 来自 中国–广东–广州–白云区

  1. #include <amxmod>

  2. public plugin_init() {
  3.         register_plugin("H-DaoSha","0.2+","huyongbo")
  4.         register_event("DeathMsg","knife_kill","a","4&kni")
  5.         return PLUGIN_CONTINUE
  6. }

  7. // when someone knived
  8. public knife_kill(){
  9.         new killer_id = read_data(1)
  10.         new victim_id = read_data(2)
  11.         new killer_name[32], victim_name[32]
  12.         get_user_name(killer_id,killer_name,32)
  13.         get_user_name(victim_id,victim_name,32)
  14.         new x = random_num(8888, 8888)
  15.         set_user_money(killer_id,x+get_user_money(killer_id))
  16.         set_hudmessage(255,30,30,-1.2,0.23,0,6.0,6.0,0.5,0.15, 4)
  17.         show_hudmessage(0,"[%s] Yong Dao Sha Ren + %d $$$",killer_name,x)
  18.         //return PLUGIN_HANDLED
  19. }
复制代码
25# 点通粉丝

刀杀奖8888
回复

使用道具 举报

 楼主| 发表于 2009-1-13 13:23:48 | 显示全部楼层 来自 中国–广东–广州–白云区
  1. */

  2. #include <amxmod>
  3. #include <amxmisc>

  4. #define SPEED 0.2

  5. new g_startPos
  6. new g_endPos
  7. new g_scrollMsg[384]
  8. new g_displayMsg[384]
  9. new Float:g_xPos
  10. new g_Length
  11. new g_Frequency

  12. public plugin_init(){
  13.   register_plugin("Scrolling Message","0.9","default")
  14.   register_srvcmd("amx_scrollmsg","setMessage")
  15. }

  16. public showMsg(){
  17.   new a = g_startPos, i = 0
  18.   
  19.   while( a < g_endPos )
  20.     g_displayMsg[i++] = g_scrollMsg[a++]
  21.    
  22.   g_displayMsg[i] = 0
  23.   
  24.   if (g_endPos < g_Length)
  25.     g_endPos++
  26.    
  27.   if (g_xPos > 0.35)
  28.     g_xPos -= 0.0063
  29.   else
  30.   {
  31.     g_startPos++
  32.     g_xPos = 0.35
  33.   }
  34.   
  35.   set_hudmessage(250, 0, 0, g_xPos, 0.90, 2, SPEED, SPEED, 0.05, 0.05, 2)
  36.   show_hudmessage(0,g_displayMsg)
  37. }

  38. public msgInit(){
  39.   g_endPos = 1
  40.   g_startPos = 0
  41.   g_xPos = 0.65
  42.   set_task( SPEED , "showMsg",123,"",0,"a", g_Length + 48)
  43.   client_print(0,print_console,g_scrollMsg)
  44. }

  45. public setMessage(id,level,cid) {
  46.   if (!cmd_access(id,level,cid,3))
  47.     return PLUGIN_HANDLED
  48.   remove_task(123) /* remove current messaging */
  49.   read_argv(1,g_scrollMsg,380)
  50.   new hostname[64]
  51.   get_cvar_string("hostname",hostname,63)
  52.   replace(g_scrollMsg,380,"%hostname%",hostname)
  53.   g_Length = strlen(g_scrollMsg)
  54.   new mytime[32]
  55.   read_argv(2,mytime,31)
  56.   g_Frequency = strtonum(mytime)
  57.   if (g_Frequency > 0) {   
  58.     new minimal = floatround((g_Length + 48) * (SPEED + 0.1))
  59.     if (g_Frequency < minimal)  {
  60.       console_print(id,"Minimal frequency for this message is %d seconds",minimal)
  61.       g_Frequency = minimal
  62.     }
  63.     console_print(id,"Scrolling message displaying frequency: %d:%02d minutes",
  64.       g_Frequency/60,g_Frequency%60)
  65.     set_task(float(g_Frequency),"msgInit",123,"",0,"b")
  66.   }
  67.   else
  68.     console_print(id,"Scrolling message disabled")
  69.   return PLUGIN_HANDLED
  70. }
复制代码
26# 点通粉丝

下方显示一条发光滚动信息
回复

使用道具 举报

 楼主| 发表于 2009-1-13 13:51:05 | 显示全部楼层 来自 中国–广东–广州–白云区
  1. #include <amxmodx>
  2. #include <fakemeta>

  3. #define PLUGIN "Solar Flash"
  4. #define VERSION "1.0"
  5. #define AUTHOR "anakin_cstrike"

  6. new
  7. toggle_plugin, toggle_type, toggle_color,
  8. toggle_duration, toggle_trail, toggle_light, toggle_vel;
  9. new g_trail;

  10. new p_color[16], color[3][4];
  11. new p_duration, p_type;

  12. /* Initialization */
  13. public plugin_init()
  14. {
  15.         register_plugin(PLUGIN, VERSION, AUTHOR);
  16.        
  17.         register_event("HLTV","nround","a","1=0","2=0");
  18.         register_message(get_user_msgid("ScreenFade"), "screenfade_message");
  19.        
  20.         // Fakemeta Forwards
  21.         register_forward(FM_Touch,"fw_touch");
  22.         register_forward(FM_SetModel,"fw_setmodel",1);
  23.         register_forward(FM_EmitSound,"fw_emitsound");
  24.        
  25.         // Cvars
  26.         toggle_plugin = register_cvar("solarflash","1");
  27.         toggle_type = register_cvar("solarflash_colortype","1");
  28.         toggle_color = register_cvar("solarflash_rgb","255 170 45");
  29.         toggle_duration = register_cvar("solarflash_duration","7");
  30.         toggle_trail = register_cvar("solarflash_trail","1");
  31.         toggle_light = register_cvar("solarflash_light","1");
  32.         toggle_vel = register_cvar("solarflash_velocity","0");
  33.        
  34. }
  35. /* Precache */
  36. public plugin_precache()
  37.         g_trail = precache_model("sprites/laserbeam.spr");

  38. /* New Round - get cvar value */
  39. public nround()
  40. {
  41.         get_pcvar_string(toggle_color, p_color, 15);
  42.         parse(p_color,color[0],3,color[1],3,color[2],3);
  43.         p_duration = get_pcvar_num(toggle_duration);
  44.         p_type = get_pcvar_num(toggle_type);
  45.        
  46. }

  47. /* Screenfade - change color */
  48. public screenfade_message(msgid,msgtype,id)
  49. {
  50.         if(get_pcvar_num(toggle_plugin) != 1)
  51.                 return PLUGIN_CONTINUE;
  52.        
  53.         if(get_msg_arg_int(4) == 255 && get_msg_arg_int (5) == 255 && get_msg_arg_int(6) == 255 && get_msg_arg_int(7) > 199)
  54.         {
  55.                 set_msg_arg_int( 1, ARG_SHORT , convert(p_duration) );
  56.                 set_msg_arg_int( 2, ARG_SHORT , convert(p_duration) );
  57.                 set_msg_arg_int( 4, ARG_BYTE , p_type == 1 ? str_to_num(color[0]) : random(255) );
  58.                 set_msg_arg_int( 5, ARG_BYTE , p_type == 1 ? str_to_num(color[1]) : random(255) );
  59.                 set_msg_arg_int( 6, ARG_BYTE , p_type == 1 ? str_to_num(color[2]) : random(255) );
  60.         }
  61.        
  62.         return PLUGIN_CONTINUE;
  63. }

  64. /* Setmodel forward - glow, trail & change velocity */
  65. public fw_setmodel(ent,model[])
  66. {
  67.         if(get_pcvar_num(toggle_plugin) != 1)
  68.                 return FMRES_IGNORED;               
  69.         if(!equali(model,"models/w_flashbang.mdl"))
  70.                 return FMRES_IGNORED;
  71.         set_pev(ent,pev_bInDuck,1);
  72.        
  73.         Render(ent,kRenderFxGlowShell,p_type == 1 ? str_to_num(color[0]) : random(255),p_type == 1 ? str_to_num(color[1]) : random(255),p_type == 1 ? str_to_num(color[2]) : random(255),kRenderNormal,15);
  74.        
  75.         if(get_pcvar_num(toggle_vel) == 1)
  76.         {
  77.                 new Float:vel[3];
  78.                
  79.                 vel[0] = float(random(300));
  80.                 vel[1] = float(random(300));
  81.                 vel[2] = float(random(300));
  82.                
  83.                 set_pev(ent,pev_velocity,vel);
  84.         }
  85.         if(get_pcvar_num(toggle_trail) == 1)
  86.                 Follow(ent,g_trail,10,5,p_type == 1 ? str_to_num(color[0]) : random(255),p_type == 1 ? str_to_num(color[1]) : random(255),p_type == 1 ? str_to_num(color[2]) : random(255),175);
  87.                
  88.         return FMRES_IGNORED;
  89. }

  90. /* Touch forward - light effects */
  91. public fw_touch(touched, toucher)
  92. {
  93.         if(get_pcvar_num(toggle_plugin) != 1)
  94.                 return FMRES_IGNORED;               
  95.         if(get_pcvar_num(toggle_light) != 1)
  96.                 return FMRES_IGNORED;
  97.                
  98.         if(!pev(toucher,pev_bInDuck))
  99.                 return FMRES_IGNORED;
  100.                
  101.         if(!touched)
  102.         {
  103.                 new Float:origin[3];
  104.                 pev(toucher, pev_origin, origin);
  105.                 Light(origin);
  106.                
  107.         }
  108.        
  109.         return FMRES_IGNORED;
  110. }

  111. /* Emit sound Forward - set glow back to normal */
  112. public fw_emitsound(Ent)
  113. {
  114.         if(pev(Ent,pev_bInDuck))
  115.                 Render(Ent,kRenderFxNone,255,255,255,15);
  116. }

  117. /* Usefull stocks */

  118. // fakemeta rendering
  119. Render(index, fx=kRenderFxNone, r=255, g=255, b=255,render=kRenderNormal,amount=16)
  120. {
  121.         set_pev(index, pev_renderfx, fx);
  122.         new Float:RenderColor[3];
  123.         RenderColor[0] = float(r);  
  124.         RenderColor[1] = float(g);  
  125.         RenderColor[2] = float(b);
  126.         set_pev(index, pev_rendercolor, RenderColor);
  127.         set_pev(index, pev_rendermode, render);  
  128.         set_pev(index, pev_renderamt, float(amount));
  129.         return 1;
  130. }

  131. // set beam follow
  132. Follow(entity,index,life,width,red,green,blue,alpha)
  133. {
  134.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  135.         write_byte(TE_BEAMFOLLOW);
  136.         write_short(entity);
  137.         write_short(index);
  138.         write_byte(life);
  139.         write_byte(width);
  140.         write_byte(red);
  141.         write_byte(green);
  142.         write_byte(blue);
  143.         write_byte(alpha);
  144.         message_end();
  145. }

  146. // dyanamic light
  147. Light(Float:origin[3])
  148. {
  149.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  150.         write_byte(TE_DLIGHT);
  151.         write_coord(floatround(origin[0]));
  152.         write_coord(floatround(origin[1]));
  153.         write_coord(floatround(origin[2]));
  154.         write_byte(10);
  155.         write_byte(p_type == 1 ? str_to_num(color[0]) : random(255));
  156.         write_byte(p_type == 1 ? str_to_num(color[1]) : random(255));
  157.         write_byte(p_type == 1 ? str_to_num(color[2]) : random(255));
  158.         write_byte(5);
  159.         write_byte(20);
  160.         message_end();
  161. }

  162. // convert seconds to units
  163. convert(num) return ((1<<12) * (num));
  164. o3可以控制闪光的时间源码
复制代码
27# 点通粉丝

评分

参与人数 1经验 +10 收起 理由
8874323 + 10 欢迎继续发布源码

查看全部评分

回复

使用道具 举报

 楼主| 发表于 2009-1-13 14:07:01 | 显示全部楼层 来自 中国–广东–广州–白云区
版主五帮手加返..五六百.点通币来用用啊..甘样才有动力的啊
回复

使用道具 举报

发表于 2009-1-13 14:28:36 | 显示全部楼层 来自 中国–广东–韶关
奖励金钱、血腥方面的还有不?
回复

使用道具 举报

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

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