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 stqe6sajg40 dodana przez GwynBleidD, 11.01.2013 18:21
Deagle's Map Manager - z menu z wynikiem po zagłosowani
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.
/******************************************************************************** * AMX Mod X script. * * Deagles Map Manager (deagsmapmanager.sma) * Copyright (C) 2006-2007 Deages/AMXX Community * (c) Copyright for original Mapchooser by OLO * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * In addition, as a special exception, the author gives permission to * link the code of this program with the Half-Life Game Engine ("HL * Engine") and Modified Game Libraries ("MODs") developed by Valve, * L.L.C ("Valve"). You must obey the GNU General Public License in all * respects for all of the code used other than the HL Engine and MODs * from Valve. If you modify this file, you may extend this exception * to your version of the file, but you are not obligated to do so. If * you do not wish to do so, delete this exception statement from your * version. * ********************************************************************************* * * Deagles Map Management v3.23 * Last Update: 2009-02-16 * * by Deagles/AMXX Community & Posting/Supporting by bmann_420 * Link: http://forums.alliedmods.net/showthread.php?t=59535 * * * Changelog is in the .txt file * * ********************************************************************************* */ #pragma semicolon 1 #include <amxmodx> #include <amxmisc> new const PLUGIN[] = "DeagsMapManager"; new const VERSION[] = "3.23"; new const AUTHOR[] = "Deags/AMXX Community"; // Comment out the following line to disable the dedicated log file #define DEDICATED_LOG_ENABLED #define MAX_MAPS_AMOUNT 600 #define ADMIN_DMAP ADMIN_LEVEL_A #define ADMIN_SUPER_DMAP ADMIN_LEVEL_F new const DMAP_MENU_TITLE[] = "DMAP_MENU_TITLE"; #define DMAP_VOTE_TIME 20 // Total time (in seconds) from vote start to checking votes #define DMAP_TASKID_VTR 10000 // Vote Time Remaining // non-DEFINE ids currently used: // 123400, 123450, 123452, 127600(+id), 127600(+idreal),333333, 444444, 454500, // 454510, 459100, 459200, 765100, 986100, 986200, 987111, 987300, 987456 new maps_to_select, isbuytime = 0, isbetween = 0; new ban_last_maps = 0, quiet = 0; //quiet=0 (words and sounds) quiet=1 (words only, no sound) quiet=2 (no sound, no words) new Float:rtvpercent, Float:thespeed, Float:oldtimelimit; new minimum = 1, minimumwait = 10, enabled = 1, cycle = 0, dofreeze = 1, maxnom = 3, maxcustnom = 5, frequency = 3, oldwinlimit = 0, addthiswait = 0; new mapsurl[64], amt_custom = 0; new isend = 0, isspeedset = 0, istimeset = 0, iswinlimitset = 0, istimeset2 = 0, mapssave = 0, atstart; new usestandard = 1, currentplayers = 0, activeplayers = 0, counttovote = 0, countnum = 0; new inprogress = 0, rocks = 0, rocked[33], hasbeenrocked = 0, waited = 0; new pathtomaps[64]; new custompath[50]; new nmaps[MAX_MAPS_AMOUNT][32]; new listofmaps[MAX_MAPS_AMOUNT][32]; new totalbanned = 0; new banthesemaps[MAX_MAPS_AMOUNT][32]; new totalmaps = 0; new lastmaps[100 + 1][32]; new bannedsofar = 0; new standard[50][32]; new standardtotal = 0; new nmaps_num = 0; //this is number of nominated maps new nbeforefill; new nmapsfill[MAX_MAPS_AMOUNT][32]; new num_nmapsfill; //this is number of maps in users admin.cfg file that are valid new bool:bIsCstrike; new nnextmaps[10]; new nvotes[12]; // Holds the number of votes for each map new nmapstoch, before_num_nmapsfill = 0, bool:mselected = false; #if defined DEDICATED_LOG_ENABLED new logfilename[256]; #endif new teamscore[2], last_map[32]; new Nominated[MAX_MAPS_AMOUNT]; //? new whonmaps_num[MAX_MAPS_AMOUNT]; new curtime = 0, staytime = 0, curplayers = 0, currounds = 0; new pDmapStrict; // Pointer to dmap_strict new pEmptyMap; // Pointer to amx_emptymap new pEmptymapAllowed; // Pointer to emptymap_allowed new pEnforceTimelimit; // Pointer to enforce_timelimit new pExtendmapMax; // Pointer to amx_extendmap_max new pExtendmapStep; // Pointer to amx_extendmap_step new pIdleTime; // Pointer to amx_idletime" new pNominationsAllowed; // Pointer to nominations_allowed new pShowActivity; // Pointer to amx_show_activity new pWeaponDelay; // Pointer to weapon_delay new g_TotalVotes; // Running total used to calculate percentages new bool:g_AlreadyVoted[33]; // Keep track of who voted in current round new g_VoteTimeRemaining; // Used to set duration of display of vote menu new g_HudSync3; new g_HudSync4; forward public hudtext16(textblock[], colr, colg, colb, posx, posy, screen, time, id); forward bool:isbanned(map[]); forward bool:iscustommap(map[]); forward bool:islastmaps(map[]); forward bool:isnominated(map[]); forward public handle_nominate(id, map[], bool:bForce); forward available_maps(); forward public getready(); forward public timetovote(); forward public messagefifteen(); forward public messagenominated(); forward public messagemaps(); forward public stopperson(); forward public countdown(); forward public rock_it_now(); forward public timedisplay(); forward public messagethree(); public client_connect(id) { if (!is_user_bot(id)) { currentplayers++; } return PLUGIN_CONTINUE; } public loopmessages() { if (quiet == 2) { //quiet=0 (words and sounds) quiet=1 (words only, no sound) quiet=2 (no sound, no words) return PLUGIN_HANDLED; } new timeleft = get_timeleft(); new partialtime = timeleft % 370; new maintime = timeleft % 600; if ((maintime > 122 && maintime < 128) && timeleft > 114) { set_task(1.0, "timedisplay", 454510, "", 0, "a", 5); } if ((partialtime > 320 && partialtime < 326) && !cycle) { set_task(3.0, "messagethree", 987300); //, "", 0, "a", 4) return PLUGIN_HANDLED; } return PLUGIN_HANDLED; } public timedisplay() { new timeleft = get_timeleft(); new seconds = timeleft % 60; new minutes = floatround((timeleft - seconds) / 60.0); if (timeleft < 1) { remove_task(454510); remove_task(454500); remove_task(123452); remove_task(123499); return PLUGIN_HANDLED; } if (timeleft > 140) { remove_task(454500); } if (timeleft > 30) { set_hudmessage(255, 255, 220, 0.02, 0.2, 0, 1.0, 1.04, 0.0, 0.05, 3); } else { set_hudmessage(210, 0 ,0, 0.02, 0.15, 0, 1.0, 1.04, 0.0, 0.05, 3); //Flashing red:set_hudmessage(210, 0, 0, 0.02, 0.2, 1, 1.0, 1.04, 0.0, 0.05, 3); } ShowSyncHudMsg(0, g_HudSync3, "%L", LANG_PLAYER, "DMAP_TIME_LEFT", minutes, seconds); if (timeleft < 70 && (timeleft % 5) == 1) { new smap[32]; get_cvar_string("amx_nextmap", smap, 31); set_hudmessage(0, 132, 255, 0.02, 0.27, 0, 5.0, 5.04, 0.0, 0.5, 4); ShowSyncHudMsg(0, g_HudSync4, "%L", LANG_PLAYER, "DMAP_NEXTMAP", smap); } return PLUGIN_HANDLED; } public messagethree() { new timeleft = get_timeleft(); new time2 = timeleft - timeleft % 60; new minutesleft = floatround(float(time2) / 60.0); new mapname[32]; get_mapname(mapname, 31); new smap[32]; get_cvar_string("amx_nextmap", smap, 31); if (minutesleft >= 2 && !mselected) { client_print(0, print_chat, "%L", LANG_PLAYER, "DMAP_NEXTMAP_VOTE_REMAINING", (minutesleft == 3 || minutesleft == 2) ? timeleft -100 : minutesleft - 2, (minutesleft == 3 || minutesleft == 2) ? "seconds" : "minutes"); } else { if (mselected) { client_print(0, print_chat, "%L", LANG_PLAYER, "DMAP_NEXTMAP_VOTED", smap, timeleft); } else { if (minutesleft <= 2 && timeleft) { client_print(0, print_chat, "%L", LANG_PLAYER, "DMAP_CURRENT_MAP", mapname); } } } } public client_putinserver(id) { if (!is_user_bot(id)) { activeplayers++; } return PLUGIN_CONTINUE; } public client_disconnect(id) { remove_task(987600 + id); remove_task(127600 + id); if (is_user_bot(id)) { return PLUGIN_CONTINUE; } currentplayers--; activeplayers--; g_AlreadyVoted[id] = false; if (rocked[id]) { rocked[id] = 0; rocks--; } if (get_timeleft() > 160) { if (!mselected && !hasbeenrocked && !inprogress) { check_if_need(); } } new kName[32]; get_user_name(id, kName, 31); new n = 0; while (Nominated[id] > 0 && n < nmaps_num) { if (whonmaps_num[n] == id) { if (get_timeleft() > 50 && quiet != 2) { //quiet=0 (words and sounds) quiet=1 (words only, no sound) quiet=2 (no sound, no words) client_print(0, print_chat, "%L", LANG_PLAYER, "DMAP_PLAYER_LEFT", kName, nmaps[n]); #if defined DEDICATED_LOG_ENABLED log_to_file(logfilename, "%s has left; %s is no longer nominated", kName, nmaps[n]); #endif } new j = n; while (j < nmaps_num - 1) { whonmaps_num[j] = whonmaps_num[j + 1]; nmaps[j] = nmaps[j + 1]; j++; } nmaps_num--; Nominated[id] = Nominated[id] - 1; } else { n++; } } return PLUGIN_CONTINUE; } public timer(id) { if (get_playersnum() == 0) { curtime++; if (curtime >= staytime) { change_maps(); } } else { new i, noncounted, players = get_playersnum(); for (i = 1; i <= get_maxplayers(); i++) { if ((get_user_time(i, 1) >= (get_pcvar_num(pIdleTime) * 216000)) || is_user_bot(i) || is_user_hltv(i)) { noncounted++; } } if (players == noncounted) { curtime++; if (curtime >= staytime) { change_maps(); } } else { curtime = 0; } } return curtime; } public change_maps() { new map[51], curmap[51]; get_mapname(curmap,50); get_pcvar_string(pEmptyMap, map, 31); if (get_pcvar_num(pEmptymapAllowed) == 1 && strlen(map) > 0) { server_cmd("changelevel %s", map); } } public list_maps(id) { new m, iteration = 0; client_print(id, print_chat, "%L", id, "DMAP_LISTMAPS", totalmaps); if (totalmaps - (50 * iteration) >= 50) { console_print(id, "%L", id, "DMAP_LISTMAPS_MAPS", iteration * 50 + 1, iteration * 50 + 50); } else { console_print(id, "%L", id, "DMAP_LISTMAPS_MAPS", iteration * 50 + 1, iteration * 50 + (totalmaps - iteration * 50)); } for (m = 50 * iteration; (m < totalmaps && m < 50 * (iteration + 1)); m += 3) if (m + 1 < totalmaps) { if (m + 2 < totalmaps) { console_print(id, " %s %s %s", listofmaps[m], listofmaps[m + 1], listofmaps[m + 2]); } else { console_print(id, " %s %s", listofmaps[m], listofmaps[m + 1]); } } else { console_print(id, " %s", listofmaps[m]); } if (50 * (iteration + 1) < totalmaps) { new kIdfake[32]; num_to_str((id + 50 * (iteration + 1)), kIdfake, 31); client_print(id, print_console, "%L", id, "DMAP_LISTMAPS_MORE"); set_task(4.0, "more_list_maps", 127600 + id, kIdfake, 6); } return PLUGIN_CONTINUE; } public more_list_maps(idfakestr[]) { new idreal = str_to_num(idfakestr); new m, iteration = 0; while (idreal >= 50) { idreal -= 50; iteration++; } //Now idreal is the real id of client if (totalmaps - (50 * iteration) >= 50) { console_print(idreal, "%L", idreal, "DMAP_LISTMAPS_MAPS", iteration * 50 + 1, iteration * 50 + 50); } else { console_print(idreal, "%L", idreal, "DMAP_LISTMAPS_MAPS", iteration * 50 + 1, iteration * 50 + (totalmaps - iteration * 50)); } for (m = 50 * iteration; (m < totalmaps && m < 50 * (iteration + 1)); m += 3) { if (m + 1 < totalmaps&
Dodanych wklejek: 12215
Powered By (Pav32) Pastebin © 2011