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
Wklejka 65z30qr2n68s dodana przez Kawon, 15.11.2012 19:27
codclass_obronca.sma
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. 392. 393. 394. 395. 396. 397. 398. 399. 400. 401. 402. 403. 404. 405. 406. 407. 408. 409. 410. 411. 412. 413. 414. 415. 416. 417. 418. 419.
#include <amxmodx> #include <engine> #include <fakemeta> #include <fun> #include <hamsandwich> #include <xs> #include <cstrike> #include <codmod> #define ENG_NULLENT -1 #define EV_INT_WEAPONKEY EV_INT_impulse #define skull7_WEAPONKEY 808 #define MAX_PLAYERS 32 #define IsValidUser(%1) (1 <= %1 <= g_MaxPlayers) const USE_STOPPED = 0 const OFFSET_ACTIVE_ITEM = 373 const OFFSET_WEAPONOWNER = 41 const OFFSET_LINUX = 5 const OFFSET_LINUX_WEAPONS = 4 #define WEAP_LINUX_XTRA_OFF 4 #define m_fKnown 44 #define m_flNextPrimaryAttack 46 #define m_flTimeWeaponIdle 48 #define m_iClip 51 #define m_fInReload 54 #define PLAYER_LINUX_XTRA_OFF 5 #define m_flNextAttack 83 #define skull7_RELOAD_TIME 3.9 #define skull7_SHOOT1 1 #define skull7_SHOOT2 2 #define skull7_RELOAD 3 #define skull7_DRAW 4 #define write_coord_f(%1) engfunc(EngFunc_WriteCoord,%1) native give_weapon_anaconda(id); native told_weapon_anaconda(id); new const Fire_Sounds[][] = { "weapons/m249ex.wav" } new const Sound_Zoom[] = { "weapons/zoom.wav" } new const modelMiny[] = "models/QTM_CodMod/mine.mdl" new sprite_blast_miny; new ilosc_min_gracza[33]; new skull7_V_MODEL[64] = "models/weapons/v_skull7.mdl" new skull7_P_MODEL[64] = "models/weapons/p_skull7.mdl" new skull7_W_MODEL[64] = "models/weapons/w_skull7.mdl" new const GUNSHOT_DECALS[] = { 41, 42, 43, 44, 45 } new cvar_dmg_skull7, cvar_recoil_skull7, cvar_clip_skull7, cvar_spd_skull7, cvar_skull7_ammo new g_MaxPlayers, g_orig_event_skull7, g_IsInPrimaryAttack new Float:cl_pushangle[MAX_PLAYERS + 1][3], m_iBlood[2] new g_has_skull7[33], g_clip_ammo[33], g_skull7_TmpClip[33], oldweap[33], g_hasZoom[33], Float:g_flNextUseTime[33], g_Reload[33] new gmsgWeaponList const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<< CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90) new const WEAPONENTNAMES[][] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10", "weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550", "weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249", "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552", "weapon_ak47", "weapon_knife", "weapon_p90" } public plugin_init() { register_plugin("Klasa Obrocna", "1.0", "Crock & Fili:P") register_message(get_user_msgid("DeathMsg"), "message_DeathMsg") register_event("CurWeapon","CurrentWeapon","be","1=1") //RegisterHam(Ham_Spawn, "player", "fw_spawn", 1); RegisterHam(Ham_Item_AddToPlayer, "weapon_m249", "fw_skull7_AddToPlayer") RegisterHam(Ham_Use, "func_tank", "fw_UseStationary_Post", 1) RegisterHam(Ham_Use, "func_tankmortar", "fw_UseStationary_Post", 1) RegisterHam(Ham_Use, "func_tankrocket", "fw_UseStationary_Post", 1) RegisterHam(Ham_Use, "func_tanklaser", "fw_UseStationary_Post", 1) for (new i = 1; i < sizeof WEAPONENTNAMES; i++) if (WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_Deploy, WEAPONENTNAMES[i], "fw_Item_Deploy_Post", 1) RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_m249", "fw_skull7_PrimaryAttack") RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_m249", "fw_skull7_PrimaryAttack_Post", 1) RegisterHam(Ham_Item_PostFrame, "weapon_m249", "skull7_ItemPostFrame") RegisterHam(Ham_Weapon_Reload, "weapon_m249", "skull7_Reload") RegisterHam(Ham_Weapon_Reload, "weapon_m249", "skull7_Reload_Post", 1) RegisterHam(Ham_Item_Holster, "weapon_m249", "skull7_Holster_Post", 1) RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage") register_forward(FM_SetModel, "fw_SetModel") register_forward(FM_UpdateClientData, "fw_UpdateClientData_Post", 1) register_forward(FM_PlaybackEvent, "fwPlaybackEvent") register_forward(FM_CmdStart, "fw_CmdStart") RegisterHam(Ham_TraceAttack, "worldspawn", "fw_TraceAttack", 1) RegisterHam(Ham_TraceAttack, "func_breakable", "fw_TraceAttack", 1) RegisterHam(Ham_TraceAttack, "func_wall", "fw_TraceAttack", 1) RegisterHam(Ham_TraceAttack, "func_door", "fw_TraceAttack", 1) RegisterHam(Ham_TraceAttack, "func_door_rotating", "fw_TraceAttack", 1) RegisterHam(Ham_TraceAttack, "func_plat", "fw_TraceAttack", 1) RegisterHam(Ham_TraceAttack, "func_rotating", "fw_TraceAttack", 1) register_touch("mine", "player", "DotykMiny"); register_event("HLTV", "NowaRunda_Miny", "a", "1=0", "2=0"); RegisterHam(Ham_Spawn, "player", "fwSpawn_Miny", 1); cvar_dmg_skull7 = register_cvar("cod_skull7_dmg", "1.76") cvar_recoil_skull7 = register_cvar("cod_skull7_recoil", "1.07") cvar_clip_skull7 = register_cvar("cod_skull7_clip", "120") cvar_spd_skull7 = register_cvar("cod_skull7_spd", "1.13") cvar_skull7_ammo = register_cvar("cod_skull7_ammo", "240") cod_register_class("Special Service ", "Ma Skull7, Anaconde, zestaw granatow i 3 miny", 1<<CSW_M249 | 1<<CSW_DEAGLE | 1<<CSW_HEGRENADE | 1<<CSW_SMOKEGRENADE | 1<<CSW_FLASHBANG, 15, -10, 20, 15) g_MaxPlayers = get_maxplayers() gmsgWeaponList = get_user_msgid("WeaponList") } public plugin_precache() { precache_model(skull7_V_MODEL) precache_model(skull7_P_MODEL) precache_model(skull7_W_MODEL) for(new i = 0; i < sizeof Fire_Sounds; i++) precache_sound(Fire_Sounds[i]) precache_sound(Sound_Zoom) precache_sound("weapons/m249ex_clipin1.wav") precache_sound("weapons/m249ex_clipin2.wav") precache_sound("weapons/m249ex_clipin3.wav") precache_sound("weapons/m249ex_clipout1.wav") precache_sound("weapons/m249ex_clipout2.wav") m_iBlood[0] = precache_model("sprites/blood.spr") m_iBlood[1] = precache_model("sprites/bloodspray.spr") precache_generic("sprites/weapon_skull7.txt") precache_generic("sprites/wpn_sprites/640hud51.spr") precache_generic("sprites/wpn_sprites/640hud7.spr") precache_model(modelMiny); sprite_blast_miny = precache_model("sprites/dexplo.spr"); register_clcmd("weapon_skull7", "weapon_hook") register_forward(FM_PrecacheEvent, "fwPrecacheEvent_Post", 1) } public weapon_hook(id) { engclient_cmd(id, "weapon_m249") return PLUGIN_HANDLED } public fw_TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType) { if(!is_user_alive(iAttacker)) return new g_currentweapon = get_user_weapon(iAttacker) if(g_currentweapon != CSW_M249) return if(!g_has_skull7[iAttacker]) return static Float:flEnd[3] get_tr2(ptr, TR_vecEndPos, flEnd) if(iEnt) { message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_DECAL) write_coord_f(flEnd[0]) write_coord_f(flEnd[1]) write_coord_f(flEnd[2]) write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)]) write_short(iEnt) message_end() } else { message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_WORLDDECAL) write_coord_f(flEnd[0]) write_coord_f(flEnd[1]) write_coord_f(flEnd[2]) write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)]) message_end() } message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_GUNSHOTDECAL) write_coord_f(flEnd[0]) write_coord_f(flEnd[1]) write_coord_f(flEnd[2]) write_short(iAttacker) write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)]) message_end() } public plugin_natives () { register_native("give_weapon_skull7", "native_give_weapon_add", 1) } public native_give_weapon_add(id) { give_skull7(id) } public fwPrecacheEvent_Post(type, const name[]) { if (equal("events/m249.sc", name)) { g_orig_event_skull7 = get_orig_retval() return FMRES_HANDLED } return FMRES_IGNORED } public client_connect(id) { g_has_skull7[id] = false } public client_disconnect(id) { g_has_skull7[id] = false new entMiny = find_ent_by_class(0, "mine"); while(entMiny > 0) { if(entity_get_edict(entMiny, EV_ENT_owner) == id) remove_entity(entMiny); entMiny = find_ent_by_class(entMiny, "mine"); } } public cod_class_enabled(id) { g_has_skull7[id]=true; ilosc_min_gracza[id] = 3; give_weapon_anaconda(id); return COD_CONTINUE; } public cod_class_disabled(id){ g_has_skull7[id]=false; told_weapon_anaconda(id); } public fw_SetModel(entity, model[]) { if(!is_valid_ent(entity)) return FMRES_IGNORED static szClassName[33] entity_get_string(entity, EV_SZ_classname, szClassName, charsmax(szClassName)) if(!equal(szClassName, "weaponbox")) return FMRES_IGNORED static iOwner iOwner = entity_get_edict(entity, EV_ENT_owner) if(equal(model, "models/w_m249.mdl")) { static iStoredAugID iStoredAugID = find_ent_by_owner(ENG_NULLENT, "weapon_m249", entity) if(!is_valid_ent(iStoredAugID)) return FMRES_IGNORED if(g_has_skull7[iOwner]) { entity_set_int(iStoredAugID, EV_INT_WEAPONKEY, skull7_WEAPONKEY) //g_has_skull7[iOwner] = false entity_set_model(entity, skull7_W_MODEL) return FMRES_SUPERCEDE } } return FMRES_IGNORED } public give_skull7(id) { drop_weapons(id, 1) new iWep2 = give_item(id,"weapon_m249") if( iWep2 > 0 ) { cs_set_weapon_ammo(iWep2, get_pcvar_num(cvar_clip_skull7)) cs_set_user_bpammo (id, CSW_M249, get_pcvar_num(cvar_skull7_ammo)) UTIL_PlayWeaponAnimation(id, skull7_DRAW) set_pdata_float(id, m_flNextAttack, 1.0, PLAYER_LINUX_XTRA_OFF) ChatColor(id, "!gSpecial Service: !yAby wlaczyc zoom, kliknij !team ''PPM''") message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id) write_string("weapon_skull7") write_byte(3) write_byte(200) write_byte(-1) write_byte(-1) write_byte(0) write_byte(4) write_byte(CSW_M249) message_end() } g_has_skull7[id] = true } public fw_skull7_AddToPlayer(skull7, id) { if(!is_valid_ent(skull7) || !is_user_connected(id)) return HAM_IGNORED if(entity_get_int(skull7, EV_INT_WEAPONKEY) == skull7_WEAPONKEY) { g_has_skull7[id] = true //entity_set_int(skull7, EV_INT_WEAPONKEY, 0) message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id) write_string("weapon_skull7") write_byte(3) write_byte(200) write_byte(-1) write_byte(-1) write_byte(0) write_byte(4) write_byte(CSW_M249) message_end() return HAM_HANDLED } else { message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id) write_string("weapon_m249") write_byte(3) write_byte(200) write_byte(-1) write_byte(-1) write_byte(0) write_byte(4) write_byte(CSW_M249) message_end() } return HAM_IGNORED } public fw_UseStationary_Post(entity, caller, activator, use_type) { if (use_type == USE_STOPPED && is_user_connected(caller)) replace_weapon_models(caller, get_user_weapon(caller)) } public fw_Item_Deploy_Post(weapon_ent) { static owner owner = fm_cs_get_weapon_ent_owner(weapon_ent) static weaponid weaponid = cs_get_weapon_id(weapon_ent) replace_weapon_models(owner, weaponid) } public CurrentWeapon(id) { replace_weapon_models(id, read_data(2)) if(read_data(2) != CSW_M249 || !g_has_skull7[id]) return static Float:iSpeed if(g_has_skull7[id]) iSpeed = get_pcvar_float(cvar_spd_skull7) static weapon[32],Ent get_weaponname(read_data(2),weapon,31) Ent = find_ent_by_owner(-1,weapon,id) if(Ent) { static Float:Delay Delay = get_pdata_float( Ent, 46, 4) * iSpeed if (Delay > 0.0) { set_pdata_float(Ent, 46, Delay, 4) } } } replace_weapon_models(id, weaponid) { switch (weaponid) { case CSW_M249: { if(g_has_skull7[id]) { set_pev(id, pev_viewmodel2, skull7_V_MODEL) set_pev(id, pev_weaponmodel2, skull7_P_MODEL) if(oldweap[id] != CSW_M249) { UTIL_PlayWeaponAnimation(id, skull7_DRAW) set_pdata_float(id, m_flNextAttack, 1.0, PLAYER_LINUX_XTRA_OFF) ChatColor(id, "!gSpecial Service: !yAby wlaczyc zoom, kliknij !team ''PPM''") message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id) write_string("weapon_skull7") write_byte(3) write_byte(200) write_byte(-1) write_byte(-1) write_byte(0) write_byte(4) write_byte(CSW_M249) message_end() } } } } oldweap[id] = weaponid } public fw_UpdateClientData_Post(Player, SendWeapons, CD_Handle) { if(!is_user_alive(Player) || (get_user_weapon(Player) != CSW_M249 || !g_has_skull7[Player])) return FMRES_IGNORED set_cd<
Dodanych wklejek: 11179
Powered By (Pav32) Pastebin © 2011