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. 286. 287. 288. 289. 290. 291. 292. 293. 294. 295. 296. 297. 298. 299. 300. 301. 302. 303. 304. 305. 306. 307. 308. 309. 310. 311. 312. 313. 314. 315. 316. 317. 318. 319. 320. 321. 322. 323. 324. 325. 326. 327. 328. 329. 330. 331. 332. 333. 334. 335. 336. 337. 338. 339. 340. 341. 342. 343. 344. 345. 346. 347. 348. 349. 350. 351. 352. 353. 354. 355. 356. 357. 358. 359. 360. 361. 362. 363. 364. 365. 366. 367. 368. 369. 370. 371. 372. 373. 374. 375. 376. 377. 378. 379. 380. 381. 382. 383. 384. 385. 386. 387. 388. 389. 390. 391.
#include <amxmodx> #include <engine> #include <fakemeta_util> #include <cstrike> #include <hamsandwich> #include <amxmisc> #include <fun> #define MAX_PLAYERS 32 #define MAX_BLOOD_DISTANCE 64 #define LOADUP_TIME 0.75 #define SHUTDOWN_TIME 1.7 #define SHAKE_FORCE -5.0 new const GUNSHOT_DECALS[] = {41, 42, 43, 44, 45} new const PLUGIN[] = "WPN Minigun" new const VERSION[] = "1.65" new const AUTHOR[] = "CLLlAgOB" new bool:has_minigun[33], m249, bool:atk2[33], bool:atk1[33], bool:delay[33], clipp[33],clipstart,g_fwid,bool:delayhud[33],bool:beackup[33], mcost,msg[128],bool:frstCLIP[33],g_MaxPlayers,g_guns_eventids_bitsum,bool:haswhpnnmg[33], Float:g_lastShot[33], Float:g_nextSound[33], g_plAction[33],bool:g_fix_punchangle[33], bool:canfire[33],oneround,only_adminCB,MsgSayText,g_normal_trace[33],DMGMG,bool:user_bot[33], bool:is_alive[33],bool:is_connected[33] new g_blood new g_bloodspray const OFFSET_CSTEAMS = 114 const OFFSET_LINUX = 5 new P_MODEL[] = "models/wpnmod/m134/p_minigun.mdl" new V_MODEL[] = "models/wpnmod/m134/v_minigun.mdl" new W_MODEL[] = "models/wpnmod/m134/w_minigun.mdl" new m_SOUND[][] = {"wpnmod/minigun/hw_shoot1.wav", "wpnmod/minigun/hw_spin.wav", "wpnmod/minigun/hw_spinup.wav", "wpnmod/minigun/hw_spindown.wav"} new g_noammo_sounds[][] = {"weapons/dryfire_rifle.wav"} new const g_guns_events[][] = {"events/m249.sc"} #define is_user_valid_connected(%1) (1 <= %1 <= g_MaxPlayers && is_connected[%1]) enum { anim_idle, anim_idle2, anim_gentleidle, anim_stillidle, anim_draw, anim_holster, anim_spinup, anim_spindown, anim_spinidle, anim_spinfire, anim_spinidledown } enum { act_none, act_load_up, act_run } public plugin_precache() { precache_model(P_MODEL) precache_model(V_MODEL) precache_model(W_MODEL) precache_sound(m_SOUND[0]) precache_sound(m_SOUND[1]) precache_sound(m_SOUND[2]) precache_sound(m_SOUND[3]) g_blood = precache_model("sprites/blood.spr") g_bloodspray = precache_model("sprites/bloodspray.spr") g_fwid = register_forward(FM_PrecacheEvent, "fwPrecacheEvent", 1) } public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_dictionary("minigun.txt") MsgSayText = get_user_msgid("SayText") clipstart = register_cvar("amx_ammo_mini","600") m249 = register_cvar("amx_speed_mini","0.9") DMGMG = register_cvar("amx_minigun_damage","1.2") oneround = register_cvar("amx_oneround","0") mcost = register_cvar("amx_cost_mini","10000") only_adminCB = register_cvar("amx_only_adm_buy","0") register_event("CurWeapon","event_curweapon","be", "1=1") register_event("DeathMsg","unminigun","a") register_forward(FM_ClientDisconnect, "fw_ClientDisconnect") register_forward(FM_CmdStart, "fwd_CmdStart") register_forward(FM_EmitSound,"fwd_emitsound") register_forward(FM_PlaybackEvent, "fwPlaybackEvent") register_forward(FM_PlayerPostThink, "fwPlayerPostThink", 1) register_forward(FM_StartFrame, "fwd_StartFrame") register_forward(FM_UpdateClientData, "UpdateClientData_Post", 1) RegisterHam(Ham_Killed, "player", "fw_PlayerKilled") RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1) RegisterHam(Ham_TakeDamage, "player", "player_TakeDamage") register_clcmd("say /minigun","buymini") register_clcmd("say /mg","buymini") register_concmd("amx_minigun_daj", "cmdMinigun_give", ADMIN_LEVEL_A, "<@all or name/id> <ammo>") register_concmd("amx_mg_daj", "cmdMinigun_give", ADMIN_LEVEL_A, "<@all or name/id> <ammo>") register_clcmd("drop","dropcmd") g_MaxPlayers = global_get(glb_maxClients) register_logevent("event_start", 2, "1=Round_Start") register_event("TextMsg", "fwEvGameWillRestartIn", "a", "2=#Game_will_restart_in") register_event("HLTV", "event_start_freezetime", "a", "1=0", "2=0") unregister_forward(FM_PrecacheEvent, g_fwid, 1) } public client_putinserver(id) { is_connected[id] = true } public fw_ClientDisconnect(id) { is_connected[id] = false is_alive[id] = false } public fw_PlayerSpawn_Post(id) { if (!is_user_alive(id) || !fm_cs_get_user_team(id)) return; is_alive[id] = true } public fw_PlayerKilled(victim, attacker, shouldgib) { is_alive[victim] = false } public unminigun(){ new id = read_data(2) if(has_minigun[id] && !is_alive[id]) { new Float:Aim[3],Float:origin[3] VelocityByAim(id, 64, Aim) entity_get_vector(id,EV_VEC_origin,origin) origin[0] += Aim[0] origin[1] += Aim[1] new minigun = create_entity("info_target") entity_set_string(minigun,EV_SZ_classname,"minigun") entity_set_model(minigun,W_MODEL) entity_set_size(minigun,Float:{-2.0,-2.0,-2.0},Float:{5.0,5.0,5.0}) entity_set_int(minigun,EV_INT_solid,1) entity_set_int(minigun,EV_INT_movetype,6) entity_set_int(minigun, EV_INT_iuser1, clipp[id]) entity_set_vector(minigun,EV_VEC_origin,origin) has_minigun[id] = false remowegun(id) return PLUGIN_HANDLED } return PLUGIN_CONTINUE } public player_TakeDamage(victim, inflictor, attacker, Float:damage, damagetype) { if(damagetype & DMG_BULLET && haswhpnnmg[attacker] && has_minigun[attacker] == true && attacker!=victim) { damage = damage*get_pcvar_float(DMGMG) SetHamParamFloat(4, damage) return HAM_IGNORED } return HAM_IGNORED } public cmdMinigun_give(id, level, cid) { if (!cmd_access(id, level, cid, 3)) { return PLUGIN_HANDLED } new arg[32], arg2[8], name2[32], argument2 read_argv(1,arg,31) read_argv(2,arg2,7) argument2 = str_to_num(arg2) if ( equali(arg,"@all") ){ new plist[32],pnum get_players(plist,pnum,"a") if (pnum==0) { console_print(id,"[Minigun] Ten gracz jest niewazny.") return PLUGIN_HANDLED } for (new i=0; i<pnum; i++) { give_weapon(plist[i], argument2, 1) client_print(plist[i], print_chat, "[MiniGun] Admin dal ci Minigun z %d ammo!",argument2) } } else { get_user_name(id,name2,31) new player = cmd_target(id,arg,7) if (!player) { console_print(id,"[MiniGun] Dawanie MiniGuna nie powiodlo sie.") return PLUGIN_HANDLED } new name[32] get_user_name(player,name,31) give_weapon(player, argument2, 1) client_print(0, print_chat, "[Minigun] Admin dal %s %d Minigunow",name,argument2) return PLUGIN_HANDLED } return PLUGIN_HANDLED } public buymini(id) { if ((!(get_user_flags(id) & ADMIN_IMMUNITY) || !(get_user_flags(id) & ADMIN_RESERVATION)) && get_pcvar_num(only_adminCB)) { format(msg,256,"[MiniGun] Tylko admin moze to kupic!") message_begin(MSG_ONE,MsgSayText,{0,0,0},id) write_byte(id) write_string(msg) message_end() return PLUGIN_HANDLED } new money = cs_get_user_money(id) new price = get_pcvar_num(mcost) if(!is_alive[id]) client_print(id, print_chat, "[MiniGun] Mozesz kupic Minigun tylko, kiedy zyjesz.") else if(has_minigun[id]) client_print(id, print_chat, "[MiniGun] Juz masz Miniguna.") else if(money < price) client_print(id, print_chat, "[MiniGun] Za malo masz kasy!") else if(get_user_team(id)!=2){ client_print(id, print_chat, "[MiniGun] Tylko CT moze kupowac miniguna!") else if(!(get_user_flags(id) & ADMIN_LEVEL_C)){ client_print(id, print_chat, "[MiniGun] Tylko CT z flaga O moze kupowac miniguna!") } else{ cs_set_user_money(id, money - price) give_weapon(id, 0, 1) client_print(id, print_chat, "[MiniGun] Kupiles minigun za $%i.",price) } return PLUGIN_HANDLED } public dropcmd(id) { if(has_minigun[id] && haswhpnnmg[id] && is_alive[id]) { new Float:Aim[3],Float:origin[3] VelocityByAim(id, 64, Aim) entity_get_vector(id,EV_VEC_origin,origin) origin[0] += Aim[0] origin[1] += Aim[1] new minigun = create_entity("info_target") entity_set_string(minigun,EV_SZ_classname,"minigun") entity_set_model(minigun,W_MODEL) entity_set_size(minigun,Float:{-2.0,-2.0,-2.0},Float:{5.0,5.0,5.0}) entity_set_int(minigun,EV_INT_solid,1) entity_set_int(minigun,EV_INT_movetype,6) entity_set_int(minigun, EV_INT_iuser1, clipp[id]) entity_set_vector(minigun,EV_VEC_origin,origin) has_minigun[id] = false canfire[id] = false remowegun(id) g_plAction[id] = false return PLUGIN_HANDLED } return PLUGIN_CONTINUE } public pfn_touch(ptr, ptd) { if(is_valid_ent(ptr)) { new classname[32] entity_get_string(ptr,EV_SZ_classname,classname,31) if(equal(classname, "minigun")) { if(is_valid_ent(ptd)) { new id = ptd if(id > 0 && id < 34) { if(!has_minigun[id] && is_alive[id]) { give_weapon(id,entity_get_int(ptr, EV_INT_iuser1), 0) canfire[id] = true remove_entity(ptr) } } } } } } public remove_miniguns() { new nextitem = find_ent_by_class(-1,"minigun") while(nextitem) { remove_entity(nextitem) nextitem = find_ent_by_class(-1,"minigun") } return PLUGIN_CONTINUE } public event_start_freezetime(){ remove_miniguns() static iPlayers[32], iPlayersNum, i get_players(iPlayers, iPlayersNum, "a") if(!get_pcvar_num(only_adminCB)){ for (i = 0; i <= iPlayersNum; ++i){ if(!has_minigun[iPlayers[i]]){ set_task(random_float(0.1,1.0),"msghelp",iPlayers[i]) } } } if(get_pcvar_num(oneround)){ for (i = 0; i <= iPlayersNum; ++i){ if(has_minigun[iPlayers[i]]){ has_minigun[iPlayers[i]] = false remowegun(iPlayers[i]) } } } else { for (i = 0; i <= iPlayersNum; ++i){ g_plAction[iPlayers[i]] = false canfire[iPlayers[i]] = false frstCLIP[iPlayers[i]] = true } } } public remowegun(id) { new wpnList[32] new number get_user_weapons(id,wpnList,number) for (new i = 0;i < number ;i++) { if (wpnList[i] == CSW_M249) { fm_strip_user_gun(id, wpnList[i]) } } } public msghelp(id){ client_print(id, print_chat, "[MiniGun] Zeby kupic Minigun, napisz /minigun") client_print(id, print_chat, "[MiniGun] Cena Miniguna - $%d",get_pcvar_num(mcost)) } public event_start(){ static iPlayers[32], iPlayersNum, i get_players(iPlayers, iPlayersNum, "a") for (i = 0; i <= iPlayersNum; ++i) canfire[iPlayers[i]] = true } public fwEvGameWillRestartIn() { static iPlayers[32], iPlayersNum, i get_players(iPlayers, iPlayersNum, "a") for (i = 0; i <= iPlayersNum; ++i) has_minigun[iPlayers[i]] = false } public client_connect(id){ canfire[id]= false has_minigun[id] = false g_normal_trace[id] = 0 if(is_user_bot(id)) user_bot[id] = true else user_bot[id] = false } public fwd_emitsound(id, channel, sample[], Float:volume, Float:attn, flag, pitch) { if (!is_user_valid_connected(id) || !has_minigun[id]) return FMRES_IGNORED; else if((equal(sample, g_noammo_sounds[0])) && has_minigun[id] && haswhpnnmg[id]) { return FMRES_SUPERCEDE } return FMRES_IGNORED } public give_weapon(id, ammo, frst){ has_minigun[id] = true give_item(id,"weapon_m249") canfire[id] = true clipp[id] = ammo if(frst) frstCLIP[id] = true else beackup[id] = true } public native_playanim(player,anim) { set_pev(player, pev_weaponanim, anim) message_begin(MSG_ONE, SVC_WEAPONANIM, {0, 0, 0}, player) write_byte(anim) write_byte(pev(player, pev_body)) message_end() } public fwd_CmdStart(id, uc_handle, seed) { if(!is_alive
Dodanych wklejek: 4031
Powered By (Pav32) Pastebin © 2011