谁能给我个武器击退源码????

社区服务
高级搜索
猴岛论坛CSGO反恐精英CS个性化修改专区谁能给我个武器击退源码????
发帖 回复
倒序阅读 最近浏览的帖子最近浏览的版块
2个回复

谁能给我个武器击退源码????

楼层直达
不就是我咯

ZxID:11573094

等级: 中士
举报 只看楼主 使用道具 楼主   发表于: 2010-12-05 0
要武器无后坐力,换子弹加速,击退,这些的源码。。谁有??我先弄个技能升级插件。。。。
结婚进行曲、

ZxID:9810137

等级: 列兵
举报 只看该作者 沙发   发表于: 2010-12-17 0
没有、等待楼下高手指点
挽留我

ZxID:12878056

等级: 元老

举报 只看该作者 板凳   发表于: 2010-12-17 0
  1. /*================================================================================
  2. * Please don't change plugin register information.
  3. #include <amxmodx>
  4. #include <fakemeta>
  5. #include <hamsandwich>
  6. #include <xs>
  7. // plugin's main information
  8. #define PLUGIN_NAME "[CS] Weapon Knockback Set"
  9. #define PLUGIN_VERSION "1.0"
  10. #define PLUGIN_AUTHOR "Jim"
  11. // Weapons calssname
  12. new const weapon_classname[][] = { "", "weapon_p228", "", "weapon_scout", "", "weapon_xm1014", "", "weapon_mac10",
  13. "weapon_aug", "", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550", "weapon_galil", "weapon_famas",
  14. "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249", "weapon_m3", "weapon_m4a1",
  15. "weapon_tmp", "weapon_g3sg1", "", "weapon_deagle", "weapon_sg552", "weapon_ak47", "weapon_knife", "weapon_p90" }
  16. // Knockback set (無擊退效果=-1.0 , 擊退力減半=0.5 , 擊退力雙倍=2.0)
  17. new const weapon_knockback[][] = {
  18. "-1.0", //-----
  19. "-1.0", //p228
  20. "-1.0", //-----
  21. "-1.0", //scout
  22. "-1.0", //-----
  23. "-1.0", //xm1014
  24. "-1.0", //-----
  25. "-1.0", //mac10
  26. "-1.0", //aug
  27. "-1.0", //-----
  28. "-1.0", //elites
  29. "-1.0", //fiveseven
  30. "-1.0", //ump45
  31. "-1.0", //sg550
  32. "-1.0", //galil
  33. "-1.0", //famas
  34. "-1.0", //usp
  35. "-1.0", //glock
  36. "-1.0", //awp
  37. "-1.0", //mp5navy
  38. "-1.0", //m249
  39. "-1.0", //m3
  40. "-1.0", //m4a1
  41. "-1.0", //tmp
  42. "-1.0", //g3sg1
  43. "-1.0", //-----
  44. "-1.0", //deagle
  45. "-1.0", //sg552
  46. "-1.0", //ak47
  47. "-1.0", //knife
  48. "-1.0" //p90
  49. }
  50. new g_weap_knockback[sizeof weapon_classname]
  51. new cvar_check_bitsum
  52. public plugin_init()
  53. {
  54. register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
  55. cvar_check_bitsum = 0
  56. new cvar_string[32]
  57. for (new i = 0; i < sizeof weapon_classname; i++)
  58. {
  59.   if (strlen(weapon_classname[i]) == 0)
  60.   continue;
  61.  
  62.   formatex(cvar_string, charsmax(cvar_string), "weap_%s_knockback", weapon_classname[i][7])
  63.   g_weap_knockback[i] = register_cvar(cvar_string, weapon_knockback[i])
  64.   cvar_check_bitsum |= (1<<i)
  65. }
  66. RegisterHam(Ham_TraceAttack, "player", "fw_TraceAttack")
  67. }
  68. public fw_TraceAttack(victim, attacker, Float:damage, Float:direction[3], tracehandle, damage_type)
  69. {
  70. // Non-player damage or self damage
  71. if (victim == attacker || !is_user_connected(attacker))
  72.   return HAM_IGNORED;
  73. // If not bullet damage
  74. if (!(damage_type & DMG_BULLET))
  75.   return HAM_IGNORED;
  76. static weap_id
  77. weap_id = get_user_weapon(attacker)
  78. if (!((1<<weap_id) & cvar_check_bitsum))
  79.   return HAM_IGNORED;
  80. // Get knockback multiplier
  81. static Float:multiplier
  82. multiplier = get_pcvar_float(g_weap_knockback[weap_id])
  83. // Use weapon power on knockback calculation
  84. if (multiplier < 0.0)
  85.   return HAM_IGNORED;
  86. static Float:hit_direction[3]
  87. hit_direction = direction
  88. // Get victim's velocity
  89. static Float:velocity[3]
  90. pev(victim, pev_velocity, velocity)
  91. // Get knockback direction value
  92. xs_vec_mul_scalar(hit_direction, multiplier, hit_direction)
  93. xs_vec_mul_scalar(hit_direction, damage, hit_direction)
  94. xs_vec_add(velocity, hit_direction, hit_direction)
  95. // If use knife attack, set knockback direction change vertical angle up 15.0
  96. if (weap_id == CSW_KNIFE)
  97.   set_vector_change_angle2(hit_direction, 0.0, 15.0, hit_direction)
  98. // Set the knockback'd victim's velocity
  99. set_pev(victim, pev_velocity, hit_direction)
  100. SetHamParamVector(4, Float:{0.0, 0.0, 0.0});
  101. return HAM_IGNORED;
  102. }
  103. stock set_vector_change_angle2(const Float:velocity[3], Float:angle, Float:vertical_angle, Float:new_velocity[3])
  104. {
  105. new Float:v_angles[3]
  106. vector_to_angle(velocity, v_angles)
  107. v_angles[1] += angle
  108. while (v_angles[1] < 0.0)
  109.   v_angles[1] += 360.0
  110. v_angles[2] += vertical_angle
  111. while (v_angles[2] < 0.0)
  112.   v_angles[2] += 360.0
  113. new Float:v_length
  114. v_length  = vector_length(velocity)
  115. new Float:temp
  116. temp = v_length * floatcos(v_angles[2], degrees)
  117. new_velocity[0] = temp * floatcos(v_angles[1], degrees)
  118. new_velocity[1] = temp * floatsin(v_angles[1], degrees)
  119. new_velocity[2] = v_length * floatsin(v_angles[2], degrees)
  120. }
« 返回列表
发帖 回复