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 144r6sblw5v dodana przez Misiaczek ;c, 08.03.2012 11:55
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. 420. 421. 422. 423. 424. 425. 426. 427. 428. 429. 430. 431. 432. 433. 434. 435. 436. 437. 438. 439. 440. 441. 442. 443. 444. 445. 446. 447. 448. 449. 450. 451. 452. 453. 454. 455. 456. 457. 458. 459. 460. 461. 462. 463. 464. 465. 466. 467. 468. 469. 470. 471.
#include <amxmodx> #include <amxmisc> #include <nvault> #include <pokemod> #define FLAGS ADMIN_IMMUNITY new g_PD[33], g_Save; new g_pKill, g_pBonus, g_pPayXp, g_pGiveXp, g_pPayLegend, g_pPayRandom, g_pRandomXpMin, g_pRandomXpMax, g_pGetXp, g_pSaveXp; new koszt, gMaxPlayers; new bool:zagral[33] public plugin_init() { register_plugin("Pokemon Dollar + Lotto", "1.0", "Raku & emblaze"); //Połączył MisieQ new sz_Dir[128]; get_configsdir(sz_Dir, charsmax(sz_Dir)); format(sz_Dir, charsmax(sz_Dir), "%s/pokemondollar.cfg", sz_Dir); server_cmd("exec %s", sz_Dir); register_dictionary("pokemondollar.txt"); g_Save = nvault_open("pdsave"); set_task(3.0, "Life", _, _, _, "b"); register_event("DeathMsg", "DeathMsg", "a"); register_logevent("LogEvent_Round_Start", 2, "0=World triggered", "1=Round_Start"); register_concmd("pd_give", "GivePD", FLAGS,"<Nick> <Amount>"); register_concmd("pd_take", "DeletePD", FLAGS,"<Nick> <Amount>"); register_clcmd("say", "Send"); register_clcmd("say pdmenu", "pdmenu"); g_pSaveXp = register_cvar("pd_savexp", "1"); g_pKill = register_cvar("pd_kill", "2"); g_pBonus = register_cvar("pd_hs", "2"); g_pGetXp = register_cvar("pd_getxp", "1"); g_pPayXp = register_cvar("pd_costexp", "10"); g_pPayLegend = register_cvar("pd_costlegend", "600"); g_pPayRandom = register_cvar("pd_costrandom", "50"); g_pGiveXp = register_cvar("pd_givexp", "1000"); g_pRandomXpMin = register_cvar("pd_minexp", "50"); g_pRandomXpMax = register_cvar("pd_maxexp", "200"); register_clcmd("say /lotto", "lotto") register_clcmd("say /pula", "pula") set_task(120.0, "reklama",_,_,_,"b") set_task(150.0, "pula",_,_,_,"b") koszt = register_cvar("amx_lotto_koszt", "5") gMaxPlayers = get_maxplayers(); if(file_exists( sz_Dir )) { return PLUGIN_HANDLED; } write_file(sz_Dir, "//Zapis PD (1 = STEAM_ID, 2 = Nick).", 0); write_file(sz_Dir, "pd_savexp 1", 1); write_file(sz_Dir, "//Ile gracz ma dostawać pd za zabicie przeciwnika.", 3); write_file(sz_Dir, "pd_kill 2", 4); write_file(sz_Dir, "//+Ile gracz ma dostawać pd za zabicie przeciwnika headshotem.", 6); write_file(sz_Dir, "pd_hs 2", 7); write_file(sz_Dir, "//Zdobywanie PD (1 = Normalne (Zabojstwo +HS), 2 = Gracz dostaje tyle PD ile zabity przez niego gracz ma fragów).", 9); write_file(sz_Dir, "pd_getxp 1", 10); write_file(sz_Dir, "//Ile kosztuje exp.", 12); write_file(sz_Dir, "pd_costexp 10", 13); write_file(sz_Dir, "//Ile kosztuje pokemon legendarny.", 15); write_file(sz_Dir, "pd_costlegend 600", 16); write_file(sz_Dir, "//Ile kosztuje pralka.", 18); write_file(sz_Dir, "pd_costrandom 50", 19); write_file(sz_Dir, "//Ile ma dawac expa.", 21); write_file(sz_Dir, "pd_givexp 1000", 22); write_file(sz_Dir, "//Ile mamy dostawać minimalnie expa z pralki.", 24); write_file(sz_Dir, "pd_minexp 50", 25); write_file(sz_Dir, "//Ile mamy dostawać maksymalnie expa z pralki.", 27); write_file(sz_Dir, "pd_maxexp 200", 28); return PLUGIN_CONTINUE; } public client_connect(id) { Load_PD(id); zagral[id] = false } public client_disconnect(id) { Save_PD(id); } public plugin_end() { nvault_close(g_Save); } public reklama() { client_print(0,print_chat,"[LOTTO] Wpisz /lotto aby zagrac w lotka.") client_print(0,print_chat,"[LOTTO] W razie problemów wejdz na amxx.pl") client_print(0,print_chat,"[LOTTO] plugin by emblaze") } public lotto(id) { if(zagral[id]) { client_print(0,print_chat,"[LOTTO] Juz grales, mozesz grac co 5 minut...") return PLUGIN_HANDLED } g_PD[id]-=get_pcvar_num(koszt) client_print(id,print_chat,"[LOTTO] Zagraleś w lotto !") client_print(id,print_chat,"[LOTTO] Za 1 minute dowiesz sie czy wygrales...") client_print(id,print_chat,"[LOTTO] Losowanie trwa...") set_task(60.0,"kumulacja",id) return PLUGIN_CONTINUE } public kumulacja (id) { zagral[id] = true new rand = random_num(0,20) switch(rand) { case 0: { client_print(id,print_chat,"[LOTTO] Niestety nie wygrales nic...") } case 1: { client_print(id,print_chat,"[LOTTO] Wygrales 10$ !") g_PD[id]+=10 } case 2: { client_print(id,print_chat,"[LOTTO] Niestety nie wygrales nic...") } case 3: { client_print(id,print_chat,"[LOTTO] Wygrales 5$ !") g_PD[id]+=5 } case 20: { client_print(id,print_chat,"[LOTTO] Niestety nie wygrales...") } case 4: { client_print(id,print_chat,"[LOTTO] Wygrales 10$ !") g_PD[id]+=10 } case 5: { client_print(id,print_chat,"[LOTTO] Wygrales 50$ !") g_PD[id]+=50 } case 6: { client_print(id,print_chat,"[LOTTO] Niestety nie wygrales nic...") } case 7: { client_print(id,print_chat,"[LOTTO] Wygrales 1$ !") g_PD[id]+=1 } case 8: { client_print(id,print_chat,"[LOTTO] Niestety nie wygrales nic...") } case 9: { client_print(id,print_chat,"[LOTTO] Wygrales 100$ !") g_PD[id]+=100 } case 10: { client_print(id,print_chat,"[LOTTO] Niestety nie wygrales nic...") } case 11: { client_print(id,print_chat,"[LOTTO] Wygrales 500$ !") g_PD[id]+=500 } case 12: { client_print(id,print_chat,"[LOTTO] Niestety nie wygrales nic...") } case 13: { client_print(id,print_chat,"[LOTTO] Wygrales 75$ !") g_PD[id]+=75 } case 14: { client_print(id,print_chat,"[LOTTO] Niestety nie wygrales nic...") } case 15: { client_print(id,print_chat,"[LOTTO] Wygrales 50$ !") g_PD[id]+=50 } case 16: { client_print(id,print_chat,"[LOTTO] Niestety nie wygrales nic...") } case 17: { client_print(id,print_chat,"[LOTTO] Wygrales 140$ !!!") g_PD[id]+=140 } case 18: { client_print(id,print_chat,"[LOTTO] Niestety nie wygrales nic...") } case 19: { client_print(id,print_chat,"[LOTTO] Wygrales 160$ !!!") g_PD[id]+=160 } } return PLUGIN_CONTINUE } public pula () { client_print(0,print_chat,"[LOTTO] Dzisiejsza pula nagrod to az 500$!!!") client_print(0,print_chat,"[LOTTO] Aby sie zalapac na konkurs wpisz /lotto") } public LogEvent_Round_Start() { for ( new id = 1; id <= gMaxPlayers; id++ ) { if(!is_user_alive(id)) continue; zagral[id] = false; } } public Life() { new Players[32], Num, i, id; get_players( Players, Num, "a" ); for( i = 0; i < Num; i++ ) { id = Players[i]; set_hudmessage(255, 0, 0, 0.0, 0.88, 0, 6.0, 7.0); show_hudmessage(id, "Pokemon Dollar: %d", g_PD[id]); } } public pdmenu(id) { new menu = menu_create("rPokemon Dollar Menu:", "pdmenu_select"); new i_Cost = get_pcvar_num(g_pPayXp); new i_Costlegend = get_pcvar_num(g_pPayLegend); new i_Costrandom = get_pcvar_num(g_pPayRandom); new sz_String[128]; formatex(sz_String, charsmax(sz_String), "Kup Exp r(%dPD)", i_Cost); menu_additem(menu,sz_String, "1", 0); formatex(sz_String, charsmax(sz_String), "Kup Legende r(%dPD)", i_Costlegend); menu_additem(menu,sz_String, "2", 0); formatex(sz_String, charsmax(sz_String), "Pralka r(%dPD)", i_Costrandom); menu_additem(menu,sz_String, "3", 0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); return PLUGIN_HANDLED; } public pdmenu_select(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_HANDLED; } new data[6], iName[64]; new acces, callback; menu_item_getinfo(menu, item, acces, data, charsmax(data), iName, charsmax(iName), callback); new key = str_to_num(data); switch(key) { case 1: { new i_Cost = get_pcvar_num(g_pPayXp); new i_Xp = get_pcvar_num(g_pGiveXp); if( g_PD[id] < i_Cost) { client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_NONE_PD"); } else { Poke_Give_XP(id, -1, i_Xp); g_PD[id]-=i_Cost; client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_EXP", i_Xp); } } case 2: { menu_destroy(menu); new menu = menu_create("rPokemon Dollar Menu:", "legend_select"); menu_additem(menu, "wMew", "1", 0); menu_additem(menu, "wArticuno", "2", 0); menu_additem(menu, "wMoltres", "3", 0); menu_additem(menu, "wZapdos", "4", 0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); return PLUGIN_HANDLED; } case 3: { new i_Cost = get_pcvar_num(g_pPayRandom); new i_Minexp = get_pcvar_num(g_pRandomXpMin); new i_Maxexp = get_pcvar_num(g_pRandomXpMax); if( g_PD[id] < i_Cost) { client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_NONE_PD") ; } else { switch(random_num(1, 2)) { case 1: { new select = random_num(i_Minexp, i_Maxexp); Poke_Give_XP(id, -1, select); g_PD[id]-=i_Cost; client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_RANDOM", select); } case 2: { new poke; do { poke = random_num(1, 151); } while( poke == 151 || poke == 144 || poke == 146 || poke == 145 ); Poke_Give_Poke(id, poke, 1); g_PD[id]-=i_Cost; client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_RANDOM2"); } } } } } menu_destroy(menu); return PLUGIN_HANDLED; } public legend_select(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_HANDLED; } new data[6], iName[64]; new acces, callback; menu_item_getinfo(menu, item, acces, data, charsmax(data), iName, charsmax(iName), callback); new key = str_to_num(data); switch(key) { case 1: { new i_Costlegend = get_pcvar_num(g_pPayLegend); if( g_PD[id] < i_Costlegend) { client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_NONE_PD"); } else { Poke_Give_Poke(id, 151, 1); g_PD[id]-=i_Costlegend; client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_LEGEND"); } } case 2: { new i_Costlegend = get_pcvar_num(g_pPayLegend); if( g_PD[id] < i_Costlegend) { client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_NONE_PD"); } else { Poke_Give_Poke(id, 144, 1); g_PD[id]-=i_Costlegend; client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_LEGEND2"); } } case 3: { new i_Costlegend = get_pcvar_num(g_pPayLegend); if( g_PD[id] < i_Costlegend) { client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_NONE_PD"); } else { Poke_Give_Poke(id, 146, 1); g_PD[id]-=i_Costlegend; client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_LEGEND3"); } } case 4: { new i_Costlegend = get_pcvar_num(g_pPayLegend); if( g_PD[id] < i_Costlegend) { client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_NONE_PD") ; } else { Poke_Give_Poke(id, 145, 1); g_PD[id]-=i_Costlegend; client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_LEGEND4"); } } } menu_destroy(menu); return PLUGIN_HANDLED; } public Send(id) { new args[256]; read_args(args, charsmax(args)); remove_quotes(args); new szCmd[15], szNick[32], szPD[12]; new parsed = parse(args, szCmd, charsmax(szCmd), szNick, charsmax(szNick), szPD, charsmax(szPD)); if(parsed && equali(szCmd, "wyslij")) { if(parsed < 3) { client_print(id, print_chat, "Uzycie: wyslij <Gracz> <PD>"); return PLUGIN_HANDLED; } new Player = cmd_target( id, szNick, CMDTARGET_ONLY_ALIVE & CMDTARGET_NO_BOTS ); if(!Player) { client_print(id, print_chat,"%L",LANG_PLAYER,"MSG_NONE_PLAYER", szNick); return PLUGIN_HANDLED; } new iPD = str_to_num