Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111. 112. 113. 114. 115. 116. 117. 118. 119. 120. 121. 122. 123. 124. 125. 126. 127. 128. 129. 130. 131. 132. 133. 134. 135. 136. 137. 138. 139. 140. 141. 142. 143. 144. 145. 146. 147. 148. 149. 150. 151. 152. 153. 154. 155. 156. 157. 158. 159. 160. 161. 162. 163. 164. 165. 166. 167. 168. 169. 170. 171. 172. 173. 174. 175. 176. 177. 178. 179. 180. 181. 182. 183. 184. 185. 186. 187. 188. 189. 190. 191. 192. 193. 194. 195. 196. 197. 198. 199. 200. 201. 202. 203. 204. 205. 206. 207. 208. 209. 210. 211. 212. 213. 214. 215. 216. 217. 218. 219. 220. 221. 222. 223. 224. 225. 226. 227. 228. 229. 230. 231. 232. 233. 234. 235. 236. 237. 238. 239. 240. 241. 242. 243. 244. 245. 246. 247. 248. 249. 250. 251. 252. 253. 254. 255. 256. 257. 258. 259. 260. 261. 262. 263. 264. 265. 266. 267. 268. 269. 270. 271. 272. 273. 274. 275. 276. 277. 278. 279. 280. 281. 282. 283. 284. 285.
public pfn_touch(ptr, ptd){ new ClassName[32] new ClassNameptd[32] //here i grab the classname of each item for debugging and advanced collisions later if ((ptr > 0) && is_valid_ent(ptr)) { entity_get_string(ptr, EV_SZ_classname, ClassName, 31) } if ((ptd > 0) && is_valid_ent(ptd)) { entity_get_string(ptd, EV_SZ_classname, ClassNameptd, 31) } if (equal(ClassName, "rpgrocket")) { remove_task(ptr) new Float:EndOrigin[3]//x,y,z entity_get_vector(ptr, EV_VEC_origin, EndOrigin) message_begin( MSG_BROADCAST, SVC_TEMPENTITY) // Explosion write_byte(TE_EXPLOSION) write_coord(floatround(EndOrigin[0])) write_coord(floatround(EndOrigin[1])) write_coord(floatround(EndOrigin[2])+5) write_short(g_sModelIndexFireball) write_byte(random_num(0,20) + 20) write_byte(12) // framerate write_byte(TE_EXPLFLAG_NONE) message_end() message_begin(MSG_BROADCAST, SVC_TEMPENTITY) // Smoke write_byte(TE_SMOKE) write_coord(floatround(EndOrigin[0])) write_coord(floatround(EndOrigin[1])) write_coord(floatround(EndOrigin[2])+15) write_short(g_sModelIndexSmoke) write_byte(60) write_byte(10) message_end() /*message_begin(MSG_BROADCAST,SVC_TEMPENTITY) // Explosion Decal write_byte(28) //grenade explotion mark write_coord(floatround(EndOrigin[0])) write_coord(floatround(EndOrigin[1])) write_coord(floatround(EndOrigin[2])) write_short(spr_blood_spray) write_short(spr_blood_drop) write_byte(229) // color index write_byte(15) // size message_end()*/ new maxdamage = BA_MAXDMG new damageradius = BA_DMGRAD if (equal(ClassNameptd, "func_breakable")) { //new Float:ptrhealth = entity_get_float(ptr,EV_FL_health); //new Float:ptdhealth = entity_get_float(ptd,EV_FL_health); //DEBUG INFO //client_print(0, print_console, "Entity ptr health is: %i",ptrhealth) //client_print(0, print_console, "Entity ptd health is: %i",ptdhealth) //entity_set_float(ptr,EV_FL_health,100.0); //i don't remember why this is here //the functions below break ANY breakables and kill the rocket //and when i say ANY breakables i mean ANY breakables //it will destroy even trigger only breakables, bad for mapmakers force_use(ptr,ptd) remove_task(ptr) } /*Notes: Here i tried to make it so that if a breakable entity was within the damage radius it would recieve it's share of damage this is very experimental as I couldn't get it to work after two or three days of tinkering */ /*if (equal(ClassNameptd, "func_breakable")) { client_print(0, print_console, "got classname %s",ClassNameptd) new Float:orig1[3], origin1[3],NonFloatEndOrigin[3] entity_get_vector(ptd, EV_VEC_origin, orig1) for(new a = 0; a < 3; a++) { origin1[a] = floatround(orig1[a]) } for(new a = 0; a < 3; a++) { NonFloatEndOrigin[a] = floatround(EndOrigin[a]) } new ptddistance = get_distance(origin1, NonFloatEndOrigin) client_print(0, print_console, "got distance %i",ptddistance) if (ptddistance <= damageradius) { client_print(0, print_console, "is in damage radius") new damage = maxdamage - floatround(floatmul(float(maxdamage), floatdiv(float(ptddistance), float(damageradius)))) if (damage > 25) { client_print(0, print_console, "damage > 25") force_use(ptr,ptd) remove_task(ptr) } else { client_print(0, print_console, "damage < 25") remove_task(ptr) } } return PLUGIN_CONTINUE }*/ new PlayerPos[3], distance, damage for (new i = 1; i < 32; i++) { if (is_user_alive(i) == 1) { get_user_origin(i, PlayerPos) new NonFloatEndOrigin[3] for(new a = 0; a < 3; a++) { NonFloatEndOrigin[a] = floatround(EndOrigin[a]) } distance = get_distance(PlayerPos, NonFloatEndOrigin) if (distance <= damageradius) { // Screenshake Radius message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenShake"), {0,0,0}, i) // Shake Screen write_short(1<<14) write_short(1<<14) write_short(1<<14) message_end() damage = maxdamage - floatround(floatmul(float(maxdamage), floatdiv(float(distance), float(damageradius)))) new attacker = entity_get_edict(ptr, EV_ENT_owner) if (!get_user_godmode(i)) { if (get_user_team(attacker) != get_user_team(i)) { if (damage < get_user_health(i)) { set_user_health(i, get_user_health(i) - damage) } else { set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET) user_kill(i, 1) set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT) message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg")) // Kill-Log oben rechts write_byte(attacker) // Attacker write_byte(i) // Victim write_byte(0) // Headshot write_string("bazooka") message_end() if (damage > 100) { //begin gibs and effects (made by mike_cao) new iOrigin[3] get_user_origin(i,iOrigin) // Effects fx_trans(i,0) fx_gib_explode(iOrigin,3) fx_blood_large(iOrigin,5) fx_blood_small(iOrigin,15) iOrigin[2] = iOrigin[2]-20 // Hide body set_user_origin(i,iOrigin) } //end gibs and effects set_user_frags(attacker, get_user_frags(attacker) + 1) } } if (get_user_team(attacker) == get_user_team(i)) { if (attacker == i) { if (damage < get_user_health(i)) { set_user_health(i, get_user_health(i) - damage) } else { set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET) user_kill(i, 1) set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT) message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg")) // Kill-Log oben rechts write_byte(attacker) // Attacker write_byte(i) // Victim write_byte(0) // Headshot write_string("bazooka") message_end() if ((damage > 100)) { //begin gibs and effects (made by mike_cao) new iOrigin[3] get_user_origin(i,iOrigin)// Effects fx_trans(i,0) fx_gib_explode(iOrigin,3) fx_blood_large(iOrigin,5) fx_blood_small(iOrigin,15) iOrigin[2] = iOrigin[2]-20 // Hide body set_user_origin(i,iOrigin) } //end gibs and effects set_user_frags(attacker, get_user_frags(attacker) - 1) } } else { if (get_cvar_num("mp_friendlyfire")) { if (damage < get_user_health(i)) { set_user_health(i, get_user_health(i) - damage) } else { set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET) user_kill(i, 1) set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT) message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg")) // Kill-Log oben rechts write_byte(attacker) // Attacker write_byte(i) // Victim write_byte(0) // Headshot write_string("bazooka") message_end() if (damage > 100) { //begin gibs and effects (made by mike_cao) new iOrigin[3] get_user_origin(i,iOrigin)// Effects fx_trans(i,0) fx_gib_explode(iOrigin,3) fx_blood_large(iOrigin,5) fx_blood_small(iOrigin,15) iOrigin[2] = iOrigin[2]-20 // Hide body set_user_origin(i,iOrigin) } //end gibs and effects set_user_frags(attacker, get_user_frags(attacker) - 1) } } } } } } } } attach_view(entity_get_edict(ptr, EV_ENT_owner), entity_get_edict(ptr, EV_ENT_owner)) user_controll[entity_get_edict(ptr, EV_ENT_owner)] = 0 remove_entity(ptr) } if (equal(ClassName, "rpg") || equal(ClassName, "rpg_temp")) { new Picker[32] if ((ptd > 0) && is_valid_ent(ptd)) { entity_get_string(ptd, EV_SZ_classname, Picker, 31) } if (equal(Picker, "player")) { give_item_bazooka(ptd,(Munni[ptd] + entity_get_int(ptr, EV_INT_iuser1)),1) remove_entity(ptr) } } return PLUGIN_CONTINUE } /*Notes: DON'T SCREW WITH THE MODES. PERIOD! It took me hours to figure out the logic for each action and make it work. the modes as they are allow only one player at a time to access the c4 and will also force a player to move to the next mode if the one they are on is restricted which can happen if the admin changes restrictions during gameplay */ /*Notes in version 1.3c this function spawned both an rpg and a bomb upon dropping the bazooka, in version 1.3d i cleaned it up and hopefully fixed this error ...i think i only cleaned it up, will test later... */ public drop_rpg_temp(id){ new Float:PlayerOrigin[3], Float:End[3], Float:Return[3], Float:TraceDirection[3], Float:Angles[3] entity_get_vector(id, EV_VEC_origin, PlayerOrigin) entity_get_vector(id, EV_VEC_angles, Angles) VelocityByAim(id, 200, TraceDirection) End[0] = TraceDirection[0] + PlayerOrigin[0] End[1] = TraceDirection[1] + PlayerOrigin[1] End[2] = TraceDirection[2] + PlayerOrigin[2] trace_line(id, PlayerOrigin, End, Return) Return[2] = PlayerOrigin[2] new RPG = create_entity("info_target") entity_set_string(RPG, EV_SZ_classname, "rpg_temp") entity_set_model(RPG, "models/w_rpg.mdl") entity_set_origin(RPG, Return) Angles[0] = 0.0 Angles[2] = 0.0 entity_set_vector(RPG, EV_VEC_angles, Angles) new Float:MinBox[3] = {-16.0, -16.0, 0.0} new Float:MaxBox[3] = {16.0, 16.0, 16.0} entity_set_vector(RPG, EV_VEC_mins, MinBox) entity_set_vector(RPG, EV_VEC_maxs, MaxBox) entity_set_int(RPG, EV_INT_solid, 1) entity_set_int(RPG, EV_INT_movetype, 6) entity_set_int(RPG, EV_INT_iuser1, Munni[id]) Munni[id] = 0 hasBazooka[id] = false return PLUGIN_HANDLED }
Dodanych wklejek: 12215
Powered By (Pav32) Pastebin © 2011