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 1l7dgvsl5gskg dodana przez BtL, 08.05.2013 16:53
csdm
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.
/** * csdm_misc.sma * Allows for Counter-Strike to be played as DeathMatch. * * CSDM Miscellanious Settings * * By Freecode and BAILOPAN * (C)2003-2006 David "BAILOPAN" Anderson * * Give credit where due. * Share the source - it sets you free * http://www.opensource.org/ * http://www.gnu.org/ */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <fakemeta> #include <csdm> #define MAPSTRIP_BOMB (1<<0) #define MAPSTRIP_VIP (1<<1) #define MAPSTRIP_HOSTAGE (1<<2) #define MAPSTRIP_BUY (1<<3) new bool:g_BlockBuy = true new bool:g_AmmoRefill = true new bool:g_RadioMsg = false #define MAXMENUPOS 34 new g_Aliases[MAXMENUPOS][] = {"usp","glock","deagle","p228","elites","fn57","m3","xm1014","mp5","tmp","p90","mac10","ump45","ak47","galil","famas","sg552","m4a1","aug","scout","awp","g3sg1","sg550","m249","vest","vesthelm","flash","hegren","sgren","defuser","nvgs","shield","primammo","secammo"} new g_Aliases2[MAXMENUPOS][] = {"km45","9x19mm","nighthawk","228compact","elites","fiveseven","12gauge","autoshotgun","smg","mp","c90","mac10","ump45","cv47","defender","clarion","krieg552","m4a1","bullpup","scout","magnum","d3au1","krieg550","m249","vest","vesthelm","flash","hegren","sgren","defuser","nvgs","shield","primammo","secammo"} //Tampering with the author and name lines can violate the copyright new PLUGINNAME[] = "CSDM Misc" new VERSION[] = CSDM_VERSION new AUTHORS[] = "CSDM Team" new g_MapStripFlags = 0 public csdm_Init(const version[]) { if (version[0] == 0) { set_fail_state("CSDM failed to load.") return } } public csdm_CfgInit() { csdm_reg_cfg("misc", "read_cfg") } public plugin_init() { register_plugin(PLUGINNAME, VERSION, AUTHORS); register_event("CurWeapon", "hook_CurWeapon", "be", "1=1") register_clcmd("buy", "generic_block") register_clcmd("buyammo1", "generic_block") register_clcmd("buyammo2", "generic_block") register_clcmd("buyequip", "generic_block") register_clcmd("cl_autobuy", "generic_block") register_clcmd("cl_rebuy", "generic_block") register_clcmd("cl_setautobuy", "generic_block") register_clcmd("cl_setrebuy", "generic_block") register_concmd("csdm_pvlist", "pvlist") set_task(2.0, "DoMapStrips") } public plugin_precache() { precache_sound("radio/locknload.wav") precache_sound("radio/letsgo.wav") register_forward(FM_Spawn, "OnEntSpawn") } public OnEntSpawn(ent) { if (g_MapStripFlags & MAPSTRIP_HOSTAGE) { new classname[32] pev(ent, pev_classname, classname, 31) if (equal(classname, "hostage_entity")) { engfunc(EngFunc_RemoveEntity, ent) return FMRES_SUPERCEDE } } return FMRES_IGNORED } public pvlist(id, level, cid) { new players[32], num, pv, name[32] get_players(players, num) for (new i=0; i<num; i++) { pv = players[i] get_user_name(pv, name, 31) console_print(id, "[CSDM] Player %s flags: %d deadflags: %d", name, pev(pv, pev_flags), pev(pv, pev_deadflag)) } return PLUGIN_HANDLED } public generic_block(id, level, cid) { if (csdm_active()) return PLUGIN_HANDLED return PLUGIN_CONTINUE } public csdm_PostSpawn(player, bool:fake) { if (g_RadioMsg && !is_user_bot(player)) { if (get_user_team(player) == _TEAM_T) { client_cmd(player, "spk radio/letsgo") } else { client_cmd(player, "spk radio/locknload") } } } public client_command(id) { if (csdm_active() && g_BlockBuy) { new arg[13] if (read_argv(0, arg, 12) > 11) { return PLUGIN_CONTINUE } new a = 0 do { if (equali(g_Aliases[a], arg) || equali(g_Aliases2[a], arg)) { return PLUGIN_HANDLED } } while(++a < MAXMENUPOS) } return PLUGIN_CONTINUE } public hook_CurWeapon(id) { if (!g_AmmoRefill || !csdm_active()) { return } new wp = read_data(2) if (g_WeaponSlots[wp] == SLOT_PRIMARY || g_WeaponSlots[wp] == SLOT_SECONDARY) { new ammo = cs_get_user_bpammo(id, wp) if (ammo < g_MaxBPAmmo[wp]) { cs_set_user_bpammo(id, wp, g_MaxBPAmmo[wp]) } } } public DoMapStrips() { if (g_MapStripFlags & MAPSTRIP_BOMB) { RemoveEntityAll("func_bomb_target") RemoveEntityAll("info_bomb_target") } if (g_MapStripFlags & MAPSTRIP_VIP) { RemoveEntityAll("func_vip_safetyzone") RemoveEntityAll("info_vip_start") } if (g_MapStripFlags & MAPSTRIP_HOSTAGE) { RemoveEntityAll("func_hostage_rescue") RemoveEntityAll("info_hostage_rescue") } if (g_MapStripFlags & MAPSTRIP_BUY) { RemoveEntityAll("func_buyzone") } } public read_cfg(readAction, line[], section[]) { if (!csdm_active()) return if (readAction == CFG_READ) { new setting[24], sign[3], value[32]; parse(line, setting, 23, sign, 2, value, 31); if (equali(setting, "remove_objectives")) { new mapname[24] get_mapname(mapname, 23) if (containi(mapname, "de_") != -1 && containi(value, "d") != -1) { g_MapStripFlags |= MAPSTRIP_BOMB } if (containi(mapname, "as_") != -1 && containi(value, "a") != -1) { g_MapStripFlags |= MAPSTRIP_VIP } if (containi(mapname, "cs_") != -1 && containi(value, "c") != -1) { g_MapStripFlags |= MAPSTRIP_HOSTAGE } if (containi(value, "b") != -1) { g_MapStripFlags |= MAPSTRIP_BUY } } else if (equali(setting, "block_buy")) { g_BlockBuy = str_to_num(value) ? true : false } else if (equali(setting, "ammo_refill")) { g_AmmoRefill = str_to_num(value) ? true : false } else if (equali(setting, "spawn_radio_msg")) { g_RadioMsg = str_to_num(value) ? true : false } } else if (readAction == CFG_RELOAD) { g_MapStripFlags = 0 g_BlockBuy = true g_AmmoRefill = true g_RadioMsg = false } } stock RemoveEntityAll(name[]) { new ent = engfunc(EngFunc_FindEntityByString, 0, "classname", name) new temp while (ent) { temp = engfunc(EngFunc_FindEntityByString, ent, "classname", name) engfunc(EngFunc_RemoveEntity, ent) ent = temp } }
Dodanych wklejek: 4031
Powered By (Pav32) Pastebin © 2011