搜索
楼主: 点通粉丝

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

[复制链接]
 楼主| 发表于 2009-1-16 05:31:04 | 显示全部楼层 来自 中国–广东–广州–白云区

  1.                 // restore speed and remove glow
  2.                 new speed = floatround(get_user_maxspeed(id) / (get_cvar_float("fn_chill_speed") / 100.0));
  3.                 set_user_maxspeed(id,float(speed));
  4.                 set_user_rendering(id);

  5.                 // kill their trail
  6.                 message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  7.                 write_byte(99); // TE_KILLBEAM
  8.                 write_short(id);
  9.                 message_end();
  10.         }
  11. }

  12. // a player's freeze runs out
  13. public remove_freeze(taskid)
  14. {
  15.         remove_task(taskid);
  16.         new id = taskid - TASK_REMOVE_FREEZE;

  17.         // no longer frozen
  18.         if(!isFrozen[id])
  19.                 return;

  20.         // if nothing happened to the model
  21.         if(is_valid_ent(novaDisplay[id]))
  22.         {
  23.                 // get origin of their frost nova
  24.                 new origin[3], Float:originF[3];
  25.                 entity_get_vector(novaDisplay[id],EV_VEC_origin,originF);
  26.                 FVecIVec(originF,origin);

  27.                 // add some tracers
  28.                 message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  29.                 write_byte(14); // TE_IMPLOSION
  30.                 write_coord(origin[0]); // x
  31.                 write_coord(origin[1]); // y
  32.                 write_coord(origin[2] + 8); // z
  33.                 write_byte(34); // radius
  34.                 write_byte(10); // count
  35.                 write_byte(3); // duration
  36.                 message_end();

  37.                 // add some sparks
  38.                 message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  39.                 write_byte(9); // TE_SPARKS
  40.                 write_coord(origin[0]); // x
  41.                 write_coord(origin[1]); // y
  42.                 write_coord(origin[2]); // z
  43.                 message_end();

  44.                 // add the shatter
  45.                 message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  46.                 write_byte(108); // TE_BREAKMODEL
  47.                 write_coord(origin[0]); // x
  48.                 write_coord(origin[1]); // y
  49.                 write_coord(origin[2] + 24); // z
  50.                 write_coord(16); // size x
  51.                 write_coord(16); // size y
  52.                 write_coord(16); // size z
  53.                 write_coord(random_num(-50,50)); // velocity x
  54.                 write_coord(random_num(-50,50)); // velocity y
  55.                 write_coord(25); // velocity z
  56.                 write_byte(10); // random velocity
  57.                 write_short(glassGibs); // model
  58.                 write_byte(10); // count
  59.                 write_byte(25); // life
  60.                 write_byte(0x01); // flags: BREAK_GLASS
  61.                 message_end();

  62.                 // play a sound and remove the model
  63.                 emit_sound(novaDisplay[id],CHAN_BODY,"warcraft3/impalelaunch1.wav",1.0,ATTN_NORM,0,PITCH_LOW);
  64.                 remove_entity(novaDisplay[id]);
  65.         }

  66.         isFrozen[id] = 0;
  67.         novaDisplay[id] = 0;

  68.         // only apply effects to this player if they are still connected
  69.         if(is_user_connected(id))
  70.         {
  71.                 // restore gravity
  72.                 entity_set_float(id,EV_FL_gravity,1.0);

  73.                 // if they are still chilled, set the speed rightly so. otherwise, restore it to complete regular.
  74.                 if(isChilled[id])
  75.                 {
  76.                         set_beamfollow(id,30,8,FROST_R,FROST_G,FROST_B,100); // bug fix

  77.                         new speed = floatround(oldSpeed[id] * (get_cvar_float("fn_chill_speed") / 100.0));
  78.                         set_user_maxspeed(id,float(speed));
  79.                 }
  80.                 else
  81.                         set_user_maxspeed(id,oldSpeed[id]);
  82.         }

  83.         oldSpeed[id] = 0.0;
  84. }

  85. /*----------------
  86.   UTILITY FUNCTIONS
  87. -----------------*/

  88. // my own radius calculations...
  89. //
  90. // 1. figure out how far a player is from a center point
  91. // 2. figure the percentage this distance is of the overall radius
  92. // 3. find a value between maxVal and minVal based on this percentage
  93. //
  94. // example: origin1 is 96 units away from origin2, and radius is 240.
  95. // this player is then 60% towards the center from the edge of the sphere.
  96. // let us say maxVal is 100.0 and minVal is 25.0. 60% progression from minimum
  97. // to maximum becomes 70.0. tada!
  98. public Float:radius_calucation(Float:origin1[3],Float:origin2[3],Float:radius,Float:maxVal,Float:minVal)
  99. {
  100.         if(maxVal <= 0.0)
  101.                 return 0.0;

  102.         if(minVal >= maxVal)
  103.                 return minVal;

  104.         new Float:percent;

  105.         // figure out how far away the points are
  106.         new Float:distance = vector_distance(origin1,origin2);

  107.         // if we are close enough, assume we are at the center
  108.         if(distance < 40.0)
  109.                 return maxVal;

  110.         // otherwise, calculate the distance range
  111.         else
  112.                 percent = 1.0 - (distance / radius);

  113.         // we have the technology...
  114.         return minVal + (percent * (maxVal - minVal));
  115. }

  116. // displays x y z axis
  117. public show_xyz(origin[3],radius)
  118. {
  119.         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  120.         write_byte(0); // TE_BEAMPOINTS
  121.         write_coord(origin[0]); // start x
  122.         write_coord(origin[1]); // starty
  123.         write_coord(origin[2] + 1); // start z
  124.         write_coord(origin[0] + radius); // end x
  125.         write_coord(origin[1]); // end y
  126.         write_coord(origin[2] + 1); // end z
  127.         write_short(trailSpr); // sprite
  128.         write_byte(0); // starting frame
  129.         write_byte(0); // framerate
  130.         write_byte(50); // life
  131.         write_byte(10); // line width
  132.         write_byte(0); // noise
  133.         write_byte(255); // r
  134.         write_byte(0); // g
  135.         write_byte(0); // b
  136.         write_byte(200); // brightness
  137.         write_byte(0); // scroll speed
  138.         message_end();

  139.         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  140.         write_byte(0); // TE_BEAMPOINTS
  141.         write_coord(origin[0]); // start x
  142.         write_coord(origin[1]); // starty
  143.         write_coord(origin[2] + 1); // start z
  144.         write_coord(origin[0]); // end x
  145.         write_coord(origin[1] + radius); // end y
  146.         write_coord(origin[2] + 1); // end z
  147.         write_short(trailSpr); // sprite
  148.         write_byte(0); // starting frame
  149.         write_byte(0); // framerate
  150.         write_byte(50); // life
  151.         write_byte(10); // line width
  152.         write_byte(0); // noise
  153.         write_byte(0); // r
  154.         write_byte(255); // g
  155.         write_byte(0); // b
  156.         write_byte(200); // brightness
  157.         write_byte(0); // scroll speed
  158.         message_end();

  159.         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  160.         write_byte(0); // TE_BEAMPOINTS
  161.         write_coord(origin[0]); // start x
  162.         write_coord(origin[1]); // starty
  163.         write_coord(origin[2]); // start z
  164.         write_coord(origin[0]); // end x
  165.         write_coord(origin[1]); // end y
  166.         write_coord(origin[2] + radius); // end z
  167.         write_short(trailSpr); // sprite
  168.         write_byte(0); // starting frame
  169.         write_byte(0); // framerate
  170.         write_byte(50); // life
  171.         write_byte(10); // line width
  172.         write_byte(0); // noise
  173.         write_byte(0); // r
  174.         write_byte(0); // g
  175.         write_byte(255); // b
  176.         write_byte(200); // brightness
  177.         write_byte(0); // scroll speed
  178.         message_end();
  179. }

  180. // give an entity a trail
  181. public set_beamfollow(ent,life,width,r,g,b,brightness)
  182. {
  183.         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  184.         write_byte(22); // TE_BEAMFOLLOW
  185.         write_short(ent); // ball
  186.         write_short(trailSpr); // sprite
  187.         write_byte(life); // life
  188.         write_byte(width); // width
  189.         write_byte(r); // r
  190.         write_byte(g); // g
  191.         write_byte(b); // b
  192.         write_byte(brightness); // brightness
  193.         message_end();
  194. }

  195. // blue blast
  196. public create_blast(origin[3])
  197. {
  198.         // smallest ring
  199.         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  200.         write_byte(21); // TE_BEAMCYLINDER
  201.         write_coord(origin[0]); // start X
  202.         write_coord(origin[1]); // start Y
  203.         write_coord(origin[2]); // start Z
  204.         write_coord(origin[0]); // something X
  205.         write_coord(origin[1]); // something Y
  206.         write_coord(origin[2] + 385); // something Z
  207.         write_short(exploSpr); // sprite
  208.         write_byte(0); // startframe
  209.         write_byte(0); // framerate
  210.         write_byte(12); // life
  211.         write_byte(50); // width
  212.         write_byte(0); // noise
  213.         write_byte(FROST_R); // red
  214.         write_byte(FROST_G); // green
  215.         write_byte(FROST_B); // blue
  216.         write_byte(50); // brightness
  217.         write_byte(0); // speed
  218.         message_end();

  219.         // medium ring
  220.         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  221.         write_byte(21); // TE_BEAMCYLINDER
  222.         write_coord(origin[0]); // start X
  223.         write_coord(origin[1]); // start Y
  224.         write_coord(origin[2]); // start Z
  225.         write_coord(origin[0]); // something X
  226.         write_coord(origin[1]); // something Y
  227.         write_coord(origin[2] + 470); // something Z
  228.         write_short(exploSpr); // sprite
  229.         write_byte(0); // startframe
  230.         write_byte(0); // framerate
  231.         write_byte(12); // life
  232.         write_byte(50); // width
  233.         write_byte(0); // noise
  234.         write_byte(FROST_R); // red
  235.         write_byte(FROST_G); // green
  236.         write_byte(FROST_B); // blue
  237.         write_byte(50); // brightness
  238.         write_byte(0); // speed
  239.         message_end();

  240.         // largest ring
  241.         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  242.         write_byte(21); // TE_BEAMCYLINDER
  243.         write_coord(origin[0]); // start X
  244.         write_coord(origin[1]); // start Y
  245.         write_coord(origin[2]); // start Z
  246.         write_coord(origin[0]); // something X
  247.         write_coord(origin[1]); // something Y
  248.         write_coord(origin[2] + 555); // something Z
  249.         write_short(exploSpr); // sprite
  250.         write_byte(0); // startframe
  251.         write_byte(0); // framerate
  252.         write_byte(12); // life
  253.         write_byte(50); // width
  254.         write_byte(0); // noise
  255.         write_byte(FROST_R); // red
  256.         write_byte(FROST_G); // green
  257.         write_byte(FROST_B); // blue
  258.         write_byte(50); // brightness
  259.         write_byte(0); // speed
  260.         message_end();

  261.         // light effect
  262.         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
  263.         write_byte(27); // TE_DLIGHT
  264.         write_coord(origin[0]); // x
  265.         write_coord(origin[1]); // y
  266.         write_coord(origin[2]); // z
  267.         write_byte(floatround(FROST_RADIUS/5.0)); // radius
  268.         write_byte(FROST_R); // r
  269.         write_byte(FROST_G); // g
  270.         write_byte(FROST_B); // b
  271.         write_byte(20); // life
  272.         write_byte(30); // decay rate
  273.         message_end();
  274. }
复制代码
40# 点通粉丝
回复

使用道具 举报

 楼主| 发表于 2009-1-16 05:32:21 | 显示全部楼层 来自 中国–广东–广州–白云区
不用下截的 地球冰炸弹-即O5
过测试cs1.5
源码分成三段.....效果很好..很卡张.呵呵
回复

使用道具 举报

 楼主| 发表于 2009-1-16 06:54:23 | 显示全部楼层 来自 中国–广东–广州–白云区
42# 点通粉丝


发现两个不错的插件

下面是下截地址
http://forums.alliedmods.net/showthread.php?t=80143

http://forums.alliedmods.net/showthread.php?p=707496

以上两个用在cs1.6上效果很好

本帖子中包含更多资源

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

×
回复

使用道具 举报

发表于 2009-1-16 10:10:03 | 显示全部楼层 来自 中国–广东–东莞
不错哦
支持LZ
回复

使用道具 举报

发表于 2009-1-16 11:01:56 | 显示全部楼层 来自 中国–山东–淄博
这些插件很有意思,谢谢你了,楼主。
回复

使用道具 举报

发表于 2009-3-11 21:07:10 | 显示全部楼层 来自 中国–湖南–衡阳
实在感谢啊·1··
回复

使用道具 举报

发表于 2009-3-11 21:08:33 | 显示全部楼层 来自 中国–湖南–衡阳
问下  战术手电筒 改白光 怎么改····

还有那个我auto weather  我以前用过··

没什么效果··

只能变亮度··
回复

使用道具 举报

发表于 2009-3-12 22:35:42 | 显示全部楼层 来自 中国–湖南–衡阳
那个变小鸡的插件尸体不消失··  从尸体跳出只鸡  怪怪的··能否消失尸体?

那个手电筒源码· 我改了··
回复

使用道具 举报

发表于 2009-3-15 14:35:07 | 显示全部楼层 来自 中国–广东–珠海
。。。。。。。。
回复

使用道具 举报

发表于 2009-3-25 14:05:07 | 显示全部楼层 来自 中国–广东–茂名–信宜市
乱七八糟的。。
回复

使用道具 举报

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

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