hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.04.27. 17:11



Jelenlévő felhasználók

Jelenleg 536 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 535 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: siska15 az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 4 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Anti rush!
HozzászólásElküldve: 2015.01.19. 15:48 
Offline
Jómunkásember
Avatar

Csatlakozott: 2014.09.27. 19:51
Hozzászólások: 411
Megköszönt másnak: 89 alkalommal
Megköszönték neki: 14 alkalommal
Valaki be allitsa hogy 2v2 től lehesen rusholni ?
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fakemeta>
  4. #include <xs>
  5.  
  6. #define MAXZONAK 100
  7. #define ZONAMUTATAS 3333
  8. #define TASKRUSH 4444
  9. #define UnitsToMeters(%1) (%1*0.0254) //Cs?s unit m?rt?kegys?get ?trakja m?terbe
  10.  
  11. enum ZONAMOD
  12. {
  13. SEMMI,
  14. OLES,
  15. RUSH
  16. }
  17.  
  18. new tipus[ZONAMOD] = { SOLID_NOT, SOLID_TRIGGER, SOLID_TRIGGER }
  19. new zonaneve[ZONAMOD][] = { "zona_nincs", "zona_oles", "zona_rush"}
  20. new zonamod[ZONAMOD][] = { "NINCS", "JATEKOS MEGOLESE", "RUSH ZONA"}
  21.  
  22. new zone_color_red[3] = { 255, 0, 0 }
  23. new zone_color_green[3] = { 255, 255, 0 }
  24. new zone_color_blue[3] = { 0, 0, 255 }
  25.  
  26. new zonaszin[ZONAMOD][3] =
  27. {
  28. { 255, 0, 255 },
  29. { 255, 0, 0 },
  30. { 0, 255, 0 }
  31. }
  32.  
  33. new szerkeszto = 0
  34.  
  35. new zona[MAXZONAK]
  36. new maxzonak
  37. new ezazona
  38. new kordinata = 0 // 0 - X | 1 - Y | 2 - Z
  39. new kordinatak[3][] = { "X", "Y", "Z" }
  40.  
  41. new alaptavolsag=10 //Unitba kell megadni!
  42.  
  43. new spr_dot
  44. new g_screenfade
  45.  
  46. new bool:rushmehet
  47.  
  48. new cvar_terrornum
  49. new cvar_time
  50. new cvar_menusounds
  51.  
  52. public plugin_init()
  53. {
  54. register_plugin("Anti-Rush", "2.0", "kiki - hlmod.hu")
  55. register_cvar("Rush Vedo", "By kiki33", FCVAR_SERVER)
  56.  
  57. register_clcmd("say /rush", "rushmenu", ADMIN_MENU)
  58.  
  59. register_logevent( "eRound_start", 2, "1=Round_Start" );
  60. register_event("SendAudio", "bomb_planted", "a", "2&%!MRAD_BOMBPL")
  61. register_logevent("eRoundEnd", 2, "1=Round_End")
  62.  
  63. set_task(2.0,"jatekoscsekk", 0 , _ , _ , "b")
  64.  
  65. register_forward(FM_Touch, "fw_touch")
  66.  
  67. g_screenfade = get_user_msgid("ScreenFade")
  68.  
  69. cvar_terrornum = register_cvar("rush_alive_terrorist", "2") //Ha ketto vagy kevesebb terrorista el mehet a rush
  70. cvar_time = register_cvar("rush_time", "60.0") //Mennyi ido mulva lehessen korkezdestol rusholni. Erteke FLOAT!!!
  71. cvar_menusounds = register_cvar("rush_menusounds", "1") //Menuben a gombok nyomasara hangok jatszodnak le. Bekapcsolasa ajanlott! 1:be | 0:ki
  72.  
  73. set_task(1.0, "zonakbetoltese")
  74. }
  75.  
  76. public jatekoscsekk()
  77. {
  78. if (get_alivetesnum() <= get_pcvar_num(cvar_terrornum) && rushmehet == false)
  79. {
  80. rush_mehet()
  81. return
  82. }
  83. }
  84.  
  85. public plugin_precache()
  86. {
  87. precache_model("models/gib_skull.mdl")
  88. spr_dot = precache_model("sprites/dot.spr")
  89. }
  90.  
  91. public client_disconnect(id)
  92. {
  93. if (id == szerkeszto) zonakeltuntetese()
  94. }
  95.  
  96. public zonakmentese(id)
  97. {
  98. new zonafajl[200]
  99. new palya[50]
  100.  
  101. get_configsdir(zonafajl, 199)
  102. format(zonafajl, 199, "%s/kiki-antirush", zonafajl)
  103.  
  104. if (!dir_exists(zonafajl)) mkdir(zonafajl)
  105.  
  106. get_mapname(palya, 49)
  107. format(zonafajl, 199, "%s/%s.kordinatak", zonafajl, palya)
  108. delete_file(zonafajl)
  109.  
  110. zonakereses()
  111.  
  112. new szoveg[120];
  113. format(szoveg, 119, "; Ez a konfig a %s palyahoz tartozik!", palya)
  114.  
  115. write_file(zonafajl, "; Anti-Rush By kiki - hlmod.hu")
  116. write_file(zonafajl, szoveg)
  117. write_file(zonafajl, "")
  118.  
  119. for(new i = 0; i < maxzonak; i++)
  120. {
  121. new z = zona[i]
  122.  
  123. new zm = pev(z, pev_iuser1)
  124.  
  125. new Float:pos[3]
  126. pev(z, pev_origin, pos)
  127.  
  128. new Float:mins[3], Float:maxs[3]
  129. pev(z, pev_mins, mins)
  130. pev(z, pev_maxs, maxs)
  131.  
  132. new output[1000]
  133. format(output, 999, "%s", zonaneve[ZONAMOD:zm])
  134.  
  135. format(output, 999, "%s %.1f %.1f %.1f", output, pos[0], pos[1], pos[2])
  136.  
  137. format(output, 999, "%s %.0f %.0f %.0f", output, mins[0], mins[1], mins[2])
  138. format(output, 999, "%s %.0f %.0f %.0f", output, maxs[0], maxs[1], maxs[2])
  139.  
  140. write_file(zonafajl, output)
  141. }
  142.  
  143. client_print(id, print_chat, "Sikeres mentes")
  144. }
  145.  
  146. public zonakbetoltese()
  147. {
  148. new zonafajl[200]
  149. new palya[50]
  150.  
  151. get_configsdir(zonafajl, 199)
  152. format(zonafajl, 199, "%s/kiki-antirush", zonafajl)
  153.  
  154. get_mapname(palya, 49)
  155. format(zonafajl, 199, "%s/%s.kordinatak", zonafajl, palya)
  156.  
  157. if (!file_exists(zonafajl))
  158. {
  159. log_to_file("ANTIRUSH-KIKI.log", "Nem talalok %s-en mentett zonakat", palya);
  160. return
  161. }
  162.  
  163. new input[1000], line = 0, len
  164.  
  165. while( (line = read_file(zonafajl , line , input , 127 , len) ) != 0 )
  166. {
  167. if (!strlen(input) || (input[0] == ';')) continue;
  168.  
  169. new data[20], zm = 0
  170. new Float:mins[3], Float:maxs[3], Float:pos[3]
  171.  
  172. argbreak(input, data, 20, input, 999)
  173. zm = -1
  174. for(new i = 0; ZONAMOD:i < ZONAMOD; ZONAMOD:i++)
  175. {
  176. if (equal(data, zonaneve[ZONAMOD:i])) zm = i;
  177. }
  178.  
  179. if (zm == -1)
  180. {
  181. log_to_file("ANTIRUSH-KIKI.log", "Felismerhetetlen sor: %s. Tovabblepes...", data);
  182. continue;
  183. }
  184.  
  185. argbreak(input, data, 20, input, 999); pos[0] = str_to_float(data);
  186. argbreak(input, data, 20, input, 999); pos[1] = str_to_float(data);
  187. argbreak(input, data, 20, input, 999); pos[2] = str_to_float(data);
  188.  
  189. argbreak(input, data, 20, input, 999); mins[0] = str_to_float(data);
  190. argbreak(input, data, 20, input, 999); mins[1] = str_to_float(data);
  191. argbreak(input, data, 20, input, 999); mins[2] = str_to_float(data);
  192. argbreak(input, data, 20, input, 999); maxs[0] = str_to_float(data);
  193. argbreak(input, data, 20, input, 999); maxs[1] = str_to_float(data);
  194. argbreak(input, data, 20, input, 999); maxs[2] = str_to_float(data);
  195.  
  196. zonakeszites(pos, mins, maxs, zm);
  197. }
  198.  
  199. zonakereses()
  200. zonakeltuntetese()
  201. }
  202.  
  203. public eRoundEnd()
  204. {
  205. rushmehet=false
  206. }
  207.  
  208. public eRound_start()
  209. {
  210. rushmehet=false;
  211.  
  212. if(task_exists(TASKRUSH))
  213. {
  214. remove_task(TASKRUSH)
  215. }
  216.  
  217. set_task(get_pcvar_float(cvar_time), "rush_mehet", TASKRUSH)
  218.  
  219. new players[32], num
  220. get_players(players,num)
  221. for(new i = 0; i < num; i++)
  222. {
  223. if(get_user_team(players[i]) == 2)
  224. {
  225. print_color(players[i], "!g[ANTI-RUSH]!t 60 másodpercig nem rusholhatsz!")
  226. }
  227. }
  228. }
  229.  
  230. public bomb_planted()
  231. {
  232. rush_mehet()
  233. }
  234.  
  235. public rush_mehet()
  236. {
  237. rushmehet = true;
  238. if(task_exists(TASKRUSH))
  239. {
  240. remove_task(TASKRUSH)
  241. }
  242. new players[32], num
  243. get_players(players,num)
  244. for(new i = 0; i < num; i++)
  245. {
  246. if(is_user_connected(players[i]))
  247. {
  248. set_dhudmessage(255, 255, 0, -1.0, 0.3, 0, 6.0, 6.0)
  249. show_dhudmessage(players[i], "A Ct-k rusholhatnak!")
  250. print_color(players[i], "!g[ANTI-RUSH]!t Mehet a rush!")
  251. }
  252. }
  253. }
  254.  
  255. public fw_touch(zona, player)
  256. {
  257. if (szerkeszto) return FMRES_IGNORED //Ha valaki a szerkeszt? men?ben van, arra nem hat...
  258.  
  259. if (!pev_valid(zona) || !is_user_connected(player))
  260. return FMRES_IGNORED
  261.  
  262. static classname[33]
  263. pev(player, pev_classname, classname, 32)
  264. if (!equal(classname, "player"))
  265. return FMRES_IGNORED
  266.  
  267. pev(zona, pev_classname, classname, 32)
  268. if (!equal(classname, "rushzona"))
  269. return FMRES_IGNORED
  270.  
  271. if(rushmehet == false)
  272. {
  273. zonastuff(player, zona)
  274. }
  275.  
  276. return FMRES_IGNORED
  277. }
  278.  
  279. public zonastuff(jatekos, zona)
  280. {
  281. new ez = pev(zona, pev_iuser1)
  282. new csapat = get_user_team(jatekos)
  283.  
  284. if(ZONAMOD:ez == OLES && csapat == 2 && is_user_alive(jatekos))
  285. {
  286. user_silentkill(jatekos)
  287. print_color(jatekos, "!g[ANTI-RUSH]!t Meghaltál mert rusholni próbáltál!")
  288. }
  289.  
  290. if(ZONAMOD:ez == RUSH)
  291. {
  292. if(is_user_alive(jatekos) && csapat == 2)
  293. {
  294. new Float: velocity[3]
  295. new Float: DW
  296. pev(jatekos,pev_velocity,velocity)
  297. DW=vector_length ( velocity )+0.0001
  298. velocity[0]=(velocity[0]/DW)*(-500.0)
  299. velocity[1]=(velocity[1]/DW)*(-500.0)
  300. if(velocity[2]<0) velocity[2]=velocity[2]*(-1.0)+15.0
  301. set_pev(jatekos,pev_velocity,velocity)
  302. message_begin(MSG_ONE_UNRELIABLE, g_screenfade, {0,0,0}, jatekos)
  303. write_short(1<<12)
  304. write_short(5)
  305. write_short(0x0000)
  306. write_byte(255)
  307. write_byte(255)
  308. write_byte(255)
  309. write_byte(255)
  310. message_end()
  311. }
  312. }
  313. }
  314.  
  315. public zonakereses()
  316. {
  317. new entity = -1
  318. maxzonak = 0
  319. while( (entity = fm_find_ent_by_class(entity, "rushzona")) )
  320. {
  321. zona[maxzonak] = entity
  322. maxzonak++
  323. }
  324. }
  325.  
  326. public zonakmutatasa()
  327. {
  328. zonakereses()
  329.  
  330. for(new i = 0; i < maxzonak; i++)
  331. {
  332. new z = zona[i];
  333. remove_task(ZONAMUTATAS + z)
  334. set_pev(z, pev_solid, SOLID_NOT)
  335. set_task(0.2, "mutasdazonakat", ZONAMUTATAS + z, _, _, "b")
  336. }
  337. }
  338.  
  339. public zonakeltuntetese()
  340. {
  341. szerkeszto = 0
  342. for(new i = 0; i < maxzonak; i++)
  343. {
  344. new id = pev(zona[i], pev_iuser1)
  345. set_pev(zona[i], pev_solid, tipus[ZONAMOD:id])
  346. remove_task(ZONAMUTATAS + zona[i])
  347. }
  348. }
  349.  
  350. public rushmenu(id)
  351. {
  352. if (get_user_flags(id) & ADMIN_RCON)
  353. {
  354. szerkeszto = id
  355. zonakereses();
  356. zonakmutatasa();
  357.  
  358. set_task(0.1, "rushmenunyitas", id)
  359. }
  360.  
  361. return PLUGIN_HANDLED
  362. }
  363.  
  364. public rushmenunyitas(id)
  365. {
  366. new item1[1024], item2[1024], palya[50];
  367. get_mapname(palya, 49);
  368. format(item1, 1023, "\yAnti-Rush By kiki | www.hlmod.hu^n\wTalált zónák: \r%d\w | Pálya: \r%s", maxzonak, palya)
  369. format(item2, 1023, "\yAnti-Rush By kiki | www.hlmod.hu^n\wTalált zónák: \r%d\w | Pálya: \r%s^n\wZóna Index: \r%d", maxzonak, palya, ezazona)
  370.  
  371. if(maxzonak <= 0)
  372. {
  373. new menu = menu_create(item1, "alap_handler");
  374. menu_additem( menu, "\wÚj zóna készítése", "a", 0 );
  375. menu_setprop( menu, MPROP_EXITNAME, "Kilépés" );
  376. menu_setprop( menu, MPROP_NEXTNAME, "Következő" );
  377. menu_setprop( menu, MPROP_BACKNAME, "Vissza" );
  378. menu_setprop( menu, MPROP_EXIT, MEXIT_ALL);
  379. menu_display(id, menu, 0 );
  380. }
  381. else
  382. {
  383. new menu = menu_create(item2, "alap_handler");
  384. new item3[120];
  385. format(item3, 119, "\wEnnek a zónának a szerkesztése: %d", ezazona)
  386. menu_additem( menu, "Új zóna készítése", "a", 0 );
  387. menu_addblank( menu, 0);
  388. menu_additem( menu, item3, "b", 0 );
  389. menu_additem( menu, "Előző zóna", "b", 0 );
  390. menu_additem( menu, "Következő zóna", "b", 0 );
  391. menu_additem( menu, "Kijelölt zóna \rtörlése", "b", 0 );
  392. menu_additem( menu, "Összes zóna mentése", "b", 0 );
  393. menu_setprop( menu, MPROP_EXITNAME, "Kilépés" );
  394. menu_setprop( menu, MPROP_NEXTNAME, "Következő" );
  395. menu_setprop( menu, MPROP_BACKNAME, "Vissza" );
  396. menu_setprop( menu, MPROP_EXIT, MEXIT_ALL);
  397. menu_display(id, menu, 0 );
  398. }
  399.  
  400. if(get_pcvar_num(cvar_menusounds)) client_cmd(id, "spk sound/buttons/blip1.wav")
  401. }
  402.  
  403. public alap_handler(id, menu, item)
  404. {
  405. if ( item == MENU_EXIT )
  406. {
  407. szerkeszto = 0
  408. zonakeltuntetese()
  409. menu_destroy( menu );
  410. return PLUGIN_HANDLED;
  411. }
  412.  
  413. new szData[6], szName[64];
  414. new item_access, item_callback;
  415. menu_item_getinfo( menu, item, item_access, szData,charsmax( szData ), szName,charsmax( szName ), item_callback );
  416.  
  417. switch( szData[0] )
  418. {
  419. case 'a':
  420. {
  421. switch( item )
  422. {
  423. case 0:
  424. {
  425. if (maxzonak < MAXZONAK - 1)
  426. {
  427. ujzonajatekospoz(id);
  428. zonakmutatasa();
  429. rushmenunyitas(id);
  430. } else
  431. {
  432. print_color(id, "!g[ANTI-RUSH]!t Nem lehet több zónát létrehozni!");
  433. rushmenunyitas(id);
  434. }
  435. menu_destroy( menu );
  436. return PLUGIN_HANDLED;
  437. }
  438. }
  439. }
  440. case 'b':
  441. {
  442. switch( item )
  443. {
  444. case 1:
  445. {
  446. if (fm_is_valid_ent(zona[ezazona])) szerkesztesmenu(id); else rushmenunyitas(id);
  447. }
  448. case 2:
  449. {
  450. ezazona = (ezazona > 0) ? ezazona - 1 : ezazona;
  451. rushmenunyitas(id)
  452. }
  453. case 3:
  454. {
  455. ezazona = (ezazona < maxzonak - 1) ? ezazona + 1 : ezazona;
  456. rushmenunyitas(id)
  457. }
  458. case 4:
  459. {
  460. zonatorlese(id);
  461. }
  462. case 5:
  463. {
  464. zonakmentese(id)
  465. rushmenunyitas(id)
  466. }
  467. }
  468. }
  469. case 't':
  470. {
  471. switch( item )
  472. {
  473. case 0:
  474. {
  475. print_color(id, "!g[ANTI-RUSH]!t Nem törölted ezt a zónát.");
  476. rushmenunyitas(id)
  477. }
  478. case 1:
  479. {
  480. fm_remove_entity(zona[ezazona])
  481. ezazona--;
  482. if (ezazona < 0) ezazona = 0;
  483. zonakereses()
  484. rushmenunyitas(id)
  485. }
  486. }
  487. }
  488. case 's':
  489. {
  490. switch( item )
  491. {
  492. case 0:
  493. {
  494. new zm = -1
  495. zm = pev(zona[ezazona], pev_iuser1)
  496. if (ZONAMOD:zm == RUSH) zm = 0; else zm++;
  497. set_pev(zona[ezazona], pev_iuser1, zm)
  498. szerkesztesmenu(id)
  499. }
  500. case 1:
  501. {
  502. kordinata = (kordinata < 2) ? kordinata + 1 : 0
  503. szerkesztesmenu(id)
  504. }
  505. case 2:
  506. {
  507. r_kicsinyites()
  508. szerkesztesmenu(id)
  509. }
  510. case 3:
  511. {
  512. r_nagyitas()
  513. szerkesztesmenu(id)
  514. }
  515. case 4:
  516. {
  517. y_kicsinyites()
  518. szerkesztesmenu(id)
  519. }
  520. case 5:
  521. {
  522. y_nagyitas()
  523. szerkesztesmenu(id)
  524. }
  525. case 6:
  526. {
  527. alaptavolsag = (alaptavolsag < 100) ? alaptavolsag * 10 : 1
  528. szerkesztesmenu(id)
  529. }
  530. case 7:
  531. {
  532. rushmenunyitas(id)
  533. }
  534. }
  535. }
  536. }
  537.  
  538. menu_destroy( menu );
  539. return PLUGIN_HANDLED;
  540. }
  541.  
  542. public szerkesztesmenu(id)
  543. {
  544. new cim[120], jelenlegi[120], mkord[120], tavolsag[120];
  545.  
  546. format(tavolsag, 119, "\wEltolás \y%.2f \wméterrel!", UnitsToMeters(alaptavolsag))
  547.  
  548. format(cim, 119, "\wZóna szerkesztése: \r%d", ezazona)
  549. new menu = menu_create(cim, "alap_handler" );
  550.  
  551. new zm = -1
  552. if (fm_is_valid_ent(zona[ezazona]))
  553. {
  554. zm = pev(zona[ezazona], pev_iuser1)
  555. }
  556.  
  557. if (zm != -1)
  558. {
  559. format(jelenlegi, 119, "\wJelenlegi mód: \r%s", zonamod[ZONAMOD:zm])
  560. menu_additem( menu, jelenlegi, "s", 0 );
  561. }
  562.  
  563. format(mkord, 119, "\wMéret változtatása a \y%s \wkordinátán!", kordinatak[kordinata])
  564. menu_additem( menu, mkord, "s", 0 );
  565. menu_addblank( menu, 0);
  566. menu_additem( menu, "\r Eltolás közepe fele", "s", 0 );
  567. menu_additem( menu, "\r Közepe felől nagyítás", "s", 0 );
  568. menu_additem( menu, "\y Eltolás közepe fele", "s", 0 );
  569. menu_additem( menu, "\y Közepe felől nagyítás", "s", 0 );
  570. menu_addblank( menu, 0);
  571. menu_additem( menu, tavolsag, "s", 0 );
  572. menu_addblank( menu, 0);
  573. menu_additem( menu, "\wVissza a főmenübe", "s", 0 );
  574.  
  575. menu_setprop( menu, MPROP_PERPAGE, 0 );
  576. menu_setprop( menu, MPROP_EXITNAME, "Kilépés" );
  577. menu_setprop( menu, MPROP_EXIT, MEXIT_ALL);
  578.  
  579. menu_display(id, menu, 0 );
  580. if(get_pcvar_num(cvar_menusounds)) client_cmd(id, "spk sound/buttons/blip1.wav")
  581. }
  582.  
  583. public r_kicsinyites()
  584. {
  585. new entity = zona[ezazona]
  586.  
  587. new Float:pos[3]
  588. pev(entity, pev_origin, pos)
  589.  
  590. new Float:mins[3], Float:maxs[3]
  591. pev(entity, pev_mins, mins)
  592. pev(entity, pev_maxs, maxs)
  593.  
  594. if ((floatabs(mins[kordinata]) + maxs[kordinata]) < alaptavolsag + 1) return
  595.  
  596. mins[kordinata] += float(alaptavolsag) / 2.0
  597. maxs[kordinata] -= float(alaptavolsag) / 2.0
  598. pos[kordinata] += float(alaptavolsag) / 2.0
  599.  
  600. set_pev(entity, pev_origin, pos)
  601. fm_entity_set_size(entity, mins, maxs)
  602. }
  603.  
  604. public r_nagyitas()
  605. {
  606. new entity = zona[ezazona]
  607.  
  608. new Float:pos[3]
  609. pev(entity, pev_origin, pos)
  610.  
  611. new Float:mins[3], Float:maxs[3]
  612. pev(entity, pev_mins, mins)
  613. pev(entity, pev_maxs, maxs)
  614.  
  615. mins[kordinata] -= float(alaptavolsag) / 2.0
  616. maxs[kordinata] += float(alaptavolsag) / 2.0
  617. pos[kordinata] -= float(alaptavolsag) / 2.0
  618.  
  619. set_pev(entity, pev_origin, pos)
  620. fm_entity_set_size(entity, mins, maxs)
  621. }
  622.  
  623. public y_kicsinyites()
  624. {
  625. new entity = zona[ezazona]
  626.  
  627. new Float:pos[3]
  628. pev(entity, pev_origin, pos)
  629.  
  630. new Float:mins[3], Float:maxs[3]
  631. pev(entity, pev_mins, mins)
  632. pev(entity, pev_maxs, maxs)
  633.  
  634. if ((floatabs(mins[kordinata]) + maxs[kordinata]) < alaptavolsag + 1) return
  635.  
  636. mins[kordinata] += float(alaptavolsag) / 2.0
  637. maxs[kordinata] -= float(alaptavolsag) / 2.0
  638. pos[kordinata] -= float(alaptavolsag) / 2.0
  639.  
  640. set_pev(entity, pev_origin, pos)
  641. fm_entity_set_size(entity, mins, maxs)
  642. }
  643.  
  644. public y_nagyitas()
  645. {
  646. new entity = zona[ezazona]
  647.  
  648. new Float:pos[3]
  649. pev(entity, pev_origin, pos)
  650.  
  651. new Float:mins[3], Float:maxs[3]
  652. pev(entity, pev_mins, mins)
  653. pev(entity, pev_maxs, maxs)
  654.  
  655. mins[kordinata] -= float(alaptavolsag) / 2.0
  656. maxs[kordinata] += float(alaptavolsag) / 2.0
  657. pos[kordinata] += float(alaptavolsag) / 2.0
  658.  
  659. set_pev(entity, pev_origin, pos)
  660. fm_entity_set_size(entity, mins, maxs)
  661. }
  662.  
  663. public zonatorlese(id)
  664. {
  665. new cim[120];
  666. format(cim, 119, "\yFIGYELMEZTETÉS\w Törölni akarod ezt a zónát: %d ?", ezazona)
  667. new menu = menu_create(cim, "alap_handler" );
  668.  
  669. menu_additem( menu, "\wNem, nem szeretném törölni", "t", 0 );
  670. menu_additem( menu, "\rIgen, törölni szeretném", "t", 0 );
  671. menu_setprop( menu, MPROP_EXITNAME, "Kilépés" );
  672. menu_setprop( menu, MPROP_NEXTNAME, "Következő" );
  673. menu_setprop( menu, MPROP_BACKNAME, "Vissza" );
  674. menu_setprop( menu, MPROP_EXIT, MEXIT_ALL);
  675. menu_display(id, menu, 0 );
  676.  
  677.  
  678. if(get_pcvar_num(cvar_menusounds)) client_cmd(id, "spk sound/buttons/button10.wav")
  679. }
  680.  
  681. public zonakeszites(Float:position[3], Float:mins[3], Float:maxs[3], zm)
  682. {
  683. new entity = fm_create_entity("info_target")
  684. set_pev(entity, pev_classname, "rushzona")
  685. fm_entity_set_model(entity, "models/gib_skull.mdl")
  686. fm_entity_set_origin(entity, position)
  687.  
  688. set_pev(entity, pev_movetype, MOVETYPE_FLY)
  689. new id = pev(entity, pev_iuser1)
  690. if (szerkeszto)
  691. {
  692. set_pev(entity, pev_solid, SOLID_NOT)
  693. }
  694. else
  695. {
  696. set_pev(entity, pev_solid, tipus[ZONAMOD:id])
  697. }
  698.  
  699. fm_entity_set_size(entity, mins, maxs)
  700.  
  701. fm_set_entity_visibility(entity, 0)
  702.  
  703. set_pev(entity, pev_iuser1, zm)
  704.  
  705. return entity
  706. }
  707.  
  708. public ujzona(Float:position[3])
  709. {
  710. new Float:mins[3] = { -32.0, -32.0, -32.0 }
  711. new Float:maxs[3] = { 32.0, 32.0, 32.0 }
  712. return zonakeszites(position, mins, maxs, 0);
  713. }
  714.  
  715. public ujzonajatekospoz(player)
  716. {
  717. new Float:position[3]
  718. pev(player, pev_origin, position)
  719.  
  720. new entity = ujzona(position)
  721. zonakereses()
  722.  
  723. for(new i = 0; i < maxzonak; i++) if (zona[i] == entity) ezazona = i;
  724. }
  725.  
  726. public mutasdazonakat(entity)
  727. {
  728. entity -= ZONAMUTATAS
  729. if ((!fm_is_valid_ent(entity)) || !szerkeszto) return
  730.  
  731. new Float:pos[3]
  732. pev(entity, pev_origin, pos)
  733. if (!fm_is_in_viewcone(szerkeszto, pos) && (entity != zona[ezazona])) return
  734.  
  735. new Float:editorpos[3]
  736. pev(szerkeszto, pev_origin, editorpos)
  737. new Float:hitpoint[3]
  738. fm_trace_line(-1, editorpos, pos, hitpoint)
  739.  
  740. if (entity == zona[ezazona]) DrawLine(editorpos[0], editorpos[1], editorpos[2] - 16.0, pos[0], pos[1], pos[2], { 255, 0, 0} )
  741.  
  742. new Float:dh = vector_distance(editorpos, pos) - vector_distance(editorpos, hitpoint)
  743. if ( (floatabs(dh) > 128.0) && (entity != zona[ezazona])) return
  744.  
  745. new Float:mins[3], Float:maxs[3]
  746. pev(entity, pev_mins, mins)
  747. pev(entity, pev_maxs, maxs)
  748.  
  749. mins[0] += pos[0]
  750. mins[1] += pos[1]
  751. mins[2] += pos[2]
  752. maxs[0] += pos[0]
  753. maxs[1] += pos[1]
  754. maxs[2] += pos[2]
  755.  
  756. new id = pev(entity, pev_iuser1)
  757.  
  758. new color[3]
  759. color[0] = (zona[ezazona] == entity) ? zone_color_blue[0] : zonaszin[ZONAMOD:id][0]
  760. color[1] = (zona[ezazona] == entity) ? zone_color_blue[1] : zonaszin[ZONAMOD:id][1]
  761. color[2] = (zona[ezazona] == entity) ? zone_color_blue[2] : zonaszin[ZONAMOD:id][2]
  762.  
  763. DrawLine(maxs[0], maxs[1], maxs[2], mins[0], maxs[1], maxs[2], color)
  764. DrawLine(maxs[0], maxs[1], maxs[2], maxs[0], mins[1], maxs[2], color)
  765. DrawLine(maxs[0], maxs[1], maxs[2], maxs[0], maxs[1], mins[2], color)
  766.  
  767. DrawLine(mins[0], mins[1], mins[2], maxs[0], mins[1], mins[2], color)
  768. DrawLine(mins[0], mins[1], mins[2], mins[0], maxs[1], mins[2], color)
  769. DrawLine(mins[0], mins[1], mins[2], mins[0], mins[1], maxs[2], color)
  770.  
  771. DrawLine(mins[0], maxs[1], maxs[2], mins[0], maxs[1], mins[2], color)
  772. DrawLine(mins[0], maxs[1], mins[2], maxs[0], maxs[1], mins[2], color)
  773. DrawLine(maxs[0], maxs[1], mins[2], maxs[0], mins[1], mins[2], color)
  774. DrawLine(maxs[0], mins[1], mins[2], maxs[0], mins[1], maxs[2], color)
  775. DrawLine(maxs[0], mins[1], maxs[2], mins[0], mins[1], maxs[2], color)
  776. DrawLine(mins[0], mins[1], maxs[2], mins[0], maxs[1], maxs[2], color)
  777.  
  778. if (entity != zona[ezazona]) return
  779.  
  780. if (kordinata == 0) // X
  781. {
  782. DrawLine(maxs[0], maxs[1], maxs[2], maxs[0], mins[1], mins[2], zone_color_green)
  783. DrawLine(maxs[0], maxs[1], mins[2], maxs[0], mins[1], maxs[2], zone_color_green)
  784.  
  785. DrawLine(mins[0], maxs[1], maxs[2], mins[0], mins[1], mins[2], zone_color_red)
  786. DrawLine(mins[0], maxs[1], mins[2], mins[0], mins[1], maxs[2], zone_color_red)
  787. }
  788. if (kordinata == 1) // Y
  789. {
  790. DrawLine(mins[0], mins[1], mins[2], maxs[0], mins[1], maxs[2], zone_color_red)
  791. DrawLine(maxs[0], mins[1], mins[2], mins[0], mins[1], maxs[2], zone_color_red)
  792.  
  793. DrawLine(mins[0], maxs[1], mins[2], maxs[0], maxs[1], maxs[2], zone_color_green)
  794. DrawLine(maxs[0], maxs[1], mins[2], mins[0], maxs[1], maxs[2], zone_color_green)
  795. }
  796. if (kordinata == 2) // Z
  797. {
  798. DrawLine(maxs[0], maxs[1], maxs[2], mins[0], mins[1], maxs[2], zone_color_green)
  799. DrawLine(maxs[0], mins[1], maxs[2], mins[0], maxs[1], maxs[2], zone_color_green)
  800.  
  801. DrawLine(maxs[0], maxs[1], mins[2], mins[0], mins[1], mins[2], zone_color_red)
  802. DrawLine(maxs[0], mins[1], mins[2], mins[0], maxs[1], mins[2], zone_color_red)
  803. }
  804. }
  805.  
  806. public FX_Box(Float:sizemin[3], Float:sizemax[3], color[3], life)
  807. {
  808. message_begin(MSG_ALL, SVC_TEMPENTITY);
  809. write_byte(31);
  810.  
  811. write_coord( floatround( sizemin[0] ) ); // x
  812. write_coord( floatround( sizemin[1] ) ); // y
  813. write_coord( floatround( sizemin[2] ) ); // z
  814.  
  815. write_coord( floatround( sizemax[0] ) ); // x
  816. write_coord( floatround( sizemax[1] ) ); // y
  817. write_coord( floatround( sizemax[2] ) ); // z
  818.  
  819. write_short(life) // Life
  820.  
  821. write_byte(color[0]) // Color R / G / B
  822. write_byte(color[1])
  823. write_byte(color[2])
  824.  
  825. message_end();
  826. }
  827.  
  828. public FX_Line(start[3], stop[3], color[3], brightness)
  829. {
  830. message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, szerkeszto)
  831.  
  832. write_byte( TE_BEAMPOINTS )
  833.  
  834. write_coord(start[0])
  835. write_coord(start[1])
  836. write_coord(start[2])
  837.  
  838. write_coord(stop[0])
  839. write_coord(stop[1])
  840. write_coord(stop[2])
  841.  
  842. write_short( spr_dot )
  843.  
  844. write_byte( 1 ) // framestart
  845. write_byte( 1 ) // framerate
  846. write_byte( 4 ) // life in 0.1's
  847. write_byte( 5 ) // width
  848. write_byte( 0 ) // noise
  849.  
  850. write_byte( color[0] ) // r, g, b
  851. write_byte( color[1] ) // r, g, b
  852. write_byte( color[2] ) // r, g, b
  853.  
  854. write_byte( brightness ) // brightness
  855. write_byte( 0 ) // speed
  856.  
  857. message_end()
  858. }
  859.  
  860. public DrawLine(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, color[3]) {
  861. new start[3]
  862. new stop[3]
  863.  
  864. start[0] = floatround( x1 )
  865. start[1] = floatround( y1 )
  866. start[2] = floatround( z1 )
  867.  
  868. stop[0] = floatround( x2 )
  869. stop[1] = floatround( y2 )
  870. stop[2] = floatround( z2 )
  871.  
  872. FX_Line(start, stop, color, 200)
  873. }
  874.  
  875. stock fm_set_kvd(entity, const key[], const value[], const classname[] = "") {
  876. if (classname[0])
  877. set_kvd(0, KV_ClassName, classname)
  878. else {
  879. new class[32]
  880. pev(entity, pev_classname, class, sizeof class - 1)
  881. set_kvd(0, KV_ClassName, class)
  882. }
  883.  
  884. set_kvd(0, KV_KeyName, key)
  885. set_kvd(0, KV_Value, value)
  886. set_kvd(0, KV_fHandled, 0)
  887.  
  888. return dllfunc(DLLFunc_KeyValue, entity, 0)
  889. }
  890.  
  891. stock fm_fake_touch(toucher, touched)
  892. return dllfunc(DLLFunc_Touch, toucher, touched)
  893.  
  894. stock fm_DispatchSpawn(entity)
  895. return dllfunc(DLLFunc_Spawn, entity)
  896.  
  897. stock fm_remove_entity(index)
  898. return engfunc(EngFunc_RemoveEntity, index)
  899.  
  900. stock fm_find_ent_by_class(index, const classname[])
  901. return engfunc(EngFunc_FindEntityByString, index, "classname", classname)
  902.  
  903. stock fm_is_valid_ent(index)
  904. return pev_valid(index)
  905.  
  906. stock fm_entity_set_size(index, const Float:mins[3], const Float:maxs[3])
  907. return engfunc(EngFunc_SetSize, index, mins, maxs)
  908.  
  909. stock fm_entity_set_model(index, const model[])
  910. return engfunc(EngFunc_SetModel, index, model)
  911.  
  912. stock fm_create_entity(const classname[])
  913. return engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, classname))
  914.  
  915. stock fm_fakedamage(victim, const classname[], Float:takedmgdamage, damagetype) {
  916. new class[] = "trigger_hurt"
  917. new entity = fm_create_entity(class)
  918. if (!entity)
  919. return 0
  920.  
  921. new value[16]
  922. float_to_str(takedmgdamage * 2, value, sizeof value - 1)
  923. fm_set_kvd(entity, "dmg", value, class)
  924.  
  925. num_to_str(damagetype, value, sizeof value - 1)
  926. fm_set_kvd(entity, "damagetype", value, class)
  927.  
  928. fm_set_kvd(entity, "origin", "8192 8192 8192", class)
  929. fm_DispatchSpawn(entity)
  930.  
  931. set_pev(entity, pev_classname, classname)
  932. fm_fake_touch(entity, victim)
  933. fm_remove_entity(entity)
  934.  
  935. return 1
  936. }
  937.  
  938. stock fm_entity_set_origin(index, const Float:origin[3]) {
  939. new Float:mins[3], Float:maxs[3]
  940. pev(index, pev_mins, mins)
  941. pev(index, pev_maxs, maxs)
  942. engfunc(EngFunc_SetSize, index, mins, maxs)
  943.  
  944. return engfunc(EngFunc_SetOrigin, index, origin)
  945. }
  946.  
  947. stock fm_set_entity_visibility(index, visible = 1) {
  948. set_pev(index, pev_effects, visible == 1 ? pev(index, pev_effects) & ~EF_NODRAW : pev(index, pev_effects) | EF_NODRAW)
  949.  
  950. return 1
  951. }
  952.  
  953. stock bool:fm_is_in_viewcone(index, const Float:point[3]) {
  954. new Float:angles[3]
  955. pev(index, pev_angles, angles)
  956. engfunc(EngFunc_MakeVectors, angles)
  957. global_get(glb_v_forward, angles)
  958. angles[2] = 0.0
  959.  
  960. new Float:origin[3], Float:diff[3], Float:norm[3]
  961. pev(index, pev_origin, origin)
  962. xs_vec_sub(point, origin, diff)
  963. diff[2] = 0.0
  964. xs_vec_normalize(diff, norm)
  965.  
  966. new Float:dot, Float:fov
  967. dot = xs_vec_dot(norm, angles)
  968. pev(index, pev_fov, fov)
  969. if (dot >= floatcos(fov * M_PI / 360))
  970. return true
  971.  
  972. return false
  973. }
  974.  
  975. stock fm_trace_line(ignoreent, const Float:start[3], const Float:end[3], Float:ret[3]) {
  976. engfunc(EngFunc_TraceLine, start, end, ignoreent == -1 ? 1 : 0, ignoreent, 0)
  977.  
  978. new ent = get_tr2(0, TR_pHit)
  979. get_tr2(0, TR_vecEndPos, ret)
  980.  
  981. return pev_valid(ent) ? ent : 0
  982. }
  983.  
  984. stock print_color(const id, const input[], any:...)
  985. {
  986. new count = 1, players[32]
  987. static msg[191]
  988. vformat(msg, 190, input, 3)
  989.  
  990. replace_all(msg, 190, "!g", "^4")
  991. replace_all(msg, 190, "!y", "^1")
  992. replace_all(msg, 190, "!t", "^3")
  993.  
  994. if (id) players[0] = id; else get_players(players, count, "ch")
  995. {
  996. for (new i = 0; i < count; i++)
  997. {
  998. if (is_user_connected(players[i]))
  999. {
  1000. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  1001. write_byte(players[i])
  1002. write_string(msg)
  1003. message_end()
  1004. }
  1005. }
  1006. }
  1007. return PLUGIN_HANDLED
  1008. }
  1009.  
  1010. stock get_alivetesnum()
  1011. {
  1012. new players[32], pnum;
  1013. get_players(players, pnum, "ae", "TERRORIST");
  1014. return pnum;
  1015. }


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Anti rush!
HozzászólásElküldve: 2015.01.19. 15:49 
Offline
Beavatott
Avatar

Csatlakozott: 2015.01.15. 22:08
Hozzászólások: 99
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 15 alkalommal
Úgy vagy meg csinálva alapból :D :lol:

_________________
Kép
http://www.klanhaboru.hu/ Gyere játssz!!! világ 28-ban vagyok.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Anti rush!
HozzászólásElküldve: 2015.01.19. 15:58 
Offline
Jómunkásember
Avatar

Csatlakozott: 2014.09.27. 19:51
Hozzászólások: 411
Megköszönt másnak: 89 alkalommal
Megköszönték neki: 14 alkalommal
Mindegy ebbe nem tudnad bele irni hogy aszt irja minden kor elejen hogy 60 masodper mulva mehet a rush
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <engine>
  3. #include <fun>
  4. #include <cstrike>
  5. #include <amxmisc>
  6. #include <fakemeta>
  7. #include <xs>
  8.  
  9. new Float:TEST_TIME=0.1
  10. new Float:WARN_TIME=1.0
  11. new Float:FLASH_TIME=0.8
  12.  
  13. #define MAX_ZONES 8
  14. new MIN_PLAYERS=2 /*Dobre do testowania w mniej osob
  15. lub gdy chcesz by koniec rashu byl
  16. przy wiekszej liczbbie osob*/
  17. #define TASK_ZONE 600743
  18. #define TASK_LOOP 500743
  19. #define TASK_VIEW 400743
  20. #define TASK_INFO 300743
  21. #define TASK_FLASH 200743
  22.  
  23. #define AUTHOR "Miczu"
  24.  
  25. new mUsuwaniestrefy // Menu
  26. new mcbUsuwaniestrefy // Menu Callback
  27. new mZapisacstrefy // Menu
  28. new mcbZapisacstrefy // Menu Callback
  29. new mAntirushControlMenu // Menu
  30. new mcbAntirushControlMenu // Menu Callback
  31. //Uzylem generatora i takie malo eleganckie wyszlo
  32.  
  33. new map_cors_edit[MAX_ZONES*6]
  34. new zones_edit
  35. new zone_editing=0
  36. new map_editor
  37. new map_cors_file_line=127
  38. new zone_incresment=10
  39. new zone_coords_num=0
  40. new zone_coords[3][13] = { "X Kordinata", "Y Kordinata", "Z Kordinata"}
  41. new editign=0
  42. new edit_g_team[3]
  43. new round_start=0
  44. new lines
  45.  
  46. new gMsgScreenFade
  47. new rasher[33]=0
  48. new raszer[33]
  49. new flashed[33]=0
  50. new sounded[33]=0
  51. new speed_limit[33]=0
  52. new Float:g_time
  53. new g_team[3]
  54. new g_origin[3]
  55. new map_cors_pre=2
  56. new map_cors_origin[MAX_ZONES*6]
  57. new slap
  58. new warn_control = 0 // miczu
  59. new zones = 0
  60.  
  61. new zone_color_aktiv[3] = { 0, 0, 255 }
  62. new zone_color_red[3] = { 0, 255, 0 }
  63. new zone_color_yellow[3] = { 255, 255, 0 }
  64. new spr_dot
  65.  
  66. new actions[11][32] = { "barney/donthurtem.wav","nihilanth/nil_now_die.wav","hgrunt/c2a3_hg_laugh.wav","hgrunt/silence!.wav","hgrunt/silence!.wav","barney/whatsgoingon.wav","barney/rightway.wav","barney/nosir.wav","barney/openfire.wav","barney/stophere.wav","hgrunt/c2a2_hg_chat5a.wav"}
  67.  
  68. public plugin_init()
  69. {
  70. register_plugin("Anti-Rush","2.5d",AUTHOR)
  71.  
  72.  
  73. register_clcmd("say /rules","info")
  74. register_clcmd("say /antirusher_menu","amx_antirusher_menu")
  75.  
  76. register_cvar("Antirusher", "2.5d",FCVAR_SERVER)
  77. register_cvar("amx_antirusher","1")
  78. register_cvar("amx_antirusher_sound","1")
  79. register_cvar("amx_antirusher_sound_mode","0")
  80. register_cvar("amx_antirusher_warn","1")
  81. register_cvar("amx_antirusher_slap","3")
  82. register_cvar("amx_antirusher_time","60.0")
  83. register_cvar("amx_antirusher_freq","0.1")
  84. register_cvar("amx_antirusher_action","2")
  85. register_cvar("amx_antirusher_cash","50")
  86. register_cvar("amx_antirusher_cash_end","2")
  87. register_cvar("amx_antirusher_immunity","0")
  88. register_cvar("amx_antirusher_zasady","1")
  89. register_cvar("amx_antirusher_people","2")
  90.  
  91. register_event("HLTV","Event_StartRound","a","1=0","2=0")
  92. register_event("RoundTime","event_roundtime","bc")
  93. register_event("SendAudio", "bomb_planted", "a", "2&%!MRAD_BOMBPL")
  94. register_event("DeathMsg","DeathMsg","ade")
  95. register_event("CurWeapon","CurWeapon","be")
  96.  
  97. gMsgScreenFade = get_user_msgid("ScreenFade")
  98. map_cors_pre = map_cors_present(map_cors_origin,g_team)
  99. TEST_TIME=get_cvar_float("amx_antirusher_freq")
  100.  
  101. register_menucmd(register_menuid("Antirush Menu"), 1023, "Antirush_menu")
  102. register_menucmd(register_menuid("Punishment Menu"), 1023, "Punishment_menu")
  103. register_menucmd(register_menuid("Antirush Zone Creator"), 1023, "Antirush_Zone_Creator")
  104. register_menucmd(register_menuid("Edit Zone"), 1023, "edit_zone2")
  105.  
  106. mAntirushControlMenu = menu_create("Antirush Control Menu", "mh_AntirushControlMenu")
  107. mcbAntirushControlMenu = menu_makecallback("mcb_AntirushControlMenu")
  108. menu_additem(mAntirushControlMenu, "Antirush cvar control", "ma_AntirushControlMenu", ADMIN_CVAR, mcbAntirushControlMenu)
  109. menu_additem(mAntirushControlMenu, "Antirush Punishments", "ma_AntirushControlMenu", ADMIN_CVAR, mcbAntirushControlMenu)
  110. menu_additem(mAntirushControlMenu, "Antirush Zone Creator", "ma_AntirushControlMenu", ADMIN_RCON, mcbAntirushControlMenu)
  111.  
  112. mZapisacstrefy = menu_create("Zapisac strefy", "mh_Zapisacstrefy")
  113. mcbZapisacstrefy = menu_makecallback("mcb_Zapisacstrefy")
  114. menu_additem(mZapisacstrefy, "TAK", "ma_Zapisacstrefy", ADMIN_ALL, mcbZapisacstrefy)
  115. menu_additem(mZapisacstrefy, "NIE", "ma_Zapisacstrefy", ADMIN_ALL, mcbZapisacstrefy)
  116.  
  117. mUsuwaniestrefy = menu_create("Usuwanie strefy", "mh_Usuwaniestrefy")
  118. mcbUsuwaniestrefy = menu_makecallback("mcb_Usuwaniestrefy")
  119. menu_additem(mUsuwaniestrefy, "TAK", "ma_Usuwaniestrefy", ADMIN_ALL, mcbUsuwaniestrefy)
  120. menu_additem(mUsuwaniestrefy, "NIE", "ma_Usuwaniestrefy", ADMIN_ALL, mcbUsuwaniestrefy)
  121.  
  122. require_module("fakemeta")
  123.  
  124. require_module("engine")
  125. require_module("fun")
  126. require_module("cstrike")
  127.  
  128. return PLUGIN_CONTINUE
  129. }
  130.  
  131. public plugin_precache() {
  132. spr_dot = precache_model("sprites/dot.spr") // potrzebne do robienia lini
  133. }
  134.  
  135. ///////////////////////////////////////////////////////////////////////
  136. ///////// M_Antirusher Events /////////
  137. ////////////////////////////////////////////////////////////////////////
  138.  
  139. public client_connect(id){
  140. free_the_man(id) //nie chcemy by ktos kto sie polaczy byl karany
  141. } //kiedy osoba co opuszczajac serwer miala kare
  142. //czyli gdy stary i nowy gracz beda mieli te same id
  143.  
  144. public client_disconnect(id) {
  145. free_the_man(id) //tak na wszelki wypadek, ale mozna sobie odpuscic
  146. return PLUGIN_CONTINUE
  147. }
  148.  
  149. public Event_StartRound(){
  150. round_start++
  151. MIN_PLAYERS = get_cvar_num("amx_antirusher_people") // zmiana people dziala na starcie rundy
  152. }
  153.  
  154. public client_putinserver(id){ //tu informacja o rashu
  155. new arg[1] //Zoptymalizowane uzycie set_task
  156. arg[0]=id //Deklaracja 1 kumurki pamieci zamiast 4 i bez zmian z str-> num i na odwrot
  157.  
  158. if (map_cors_pre && get_cvar_num("amx_antirusher"))
  159. set_task(45.0,"informclient",TASK_INFO+id,arg,1)
  160. }
  161.  
  162. public bomb_planted() { //podlozono bombe
  163. remove_task(TASK_LOOP) //przerywa sprawdzanie rashu
  164. remove_task(TASK_VIEW) //przerywa wyswietlanie granic dla userow
  165. free_the_world() //mozna rashowac
  166. }
  167.  
  168. public event_roundtime() {
  169. if (round_start<1) return PLUGIN_CONTINUE //takie zabezpieczenie by nie sprawdzalo po czasie rashu
  170. if (map_cors_pre && get_cvar_num("amx_antirusher")) {
  171. slap = floatround(get_cvar_num("amx_antirusher_slap")*(10.0*TEST_TIME)) // slapy biora zawsze tyle samo hp w przedziale czasu
  172. remove_task(TASK_LOOP)
  173. remove_task(TASK_VIEW)
  174. g_time = get_gametime() + get_cvar_float("amx_antirusher_time")
  175. set_task(2*TEST_TIME, "checkOrigin",TASK_LOOP)
  176. set_task(2*WARN_TIME, "rash_warn",TASK_VIEW)
  177.  
  178. }
  179. return PLUGIN_CONTINUE
  180. } //
  181.  
  182. public DeathMsg(){
  183. new vid = read_data(2) //id trupa
  184. free_the_man(vid) //uwalnia trupa by zaczol runde z czystym kontem
  185. }
  186.  
  187. //////////////////////////////////////////////////////////////////////
  188. ///////// M_Antirusher Things /////////
  189. //////////////////////////////////////////////////////////////////////
  190.  
  191. map_cors_present(maporigin[MAX_ZONES*6],team[3]) {
  192.  
  193. new zonefile[256],zonefile2[256]
  194.  
  195. get_configsdir(zonefile, 255)
  196.  
  197. if(is_linux_server()){
  198. format(zonefile2, 255, "%s/antirusher", zonefile)
  199. if(!(dir_exists(zonefile2))) mkdir (zonefile2)
  200. format(zonefile2, 255, "%s/antirusher/rush.cor", zonefile)
  201. }
  202. else{
  203. format(zonefile2, 255, "%s\antirusher", zonefile)
  204. if(!(dir_exists(zonefile2))) mkdir (zonefile2)
  205. format(zonefile2, 255, "%s\antirusher\rush.cor", zonefile)
  206. }
  207.  
  208. if (file_exists(zonefile2)){
  209.  
  210. new readdata[512]
  211. new currentmap[32]
  212. get_mapname(currentmap,31)
  213. new map[32], len
  214. new x11[16],x12[16],y11[16],y12[16],z11[16],z12[16]
  215. new x21[16],x22[16],y21[16],y22[16],z21[16],z22[16]
  216. new x31[16],x32[16],y31[16],y32[16],z31[16],z32[16]
  217. new x41[16],x42[16],y41[16],y42[16],z41[16],z42[16]
  218. new x51[16],x52[16],y51[16],y52[16],z51[16],z52[16]
  219. new x61[16],x62[16],y61[16],y62[16],z61[16],z62[16]
  220. new x71[16],x72[16],y71[16],y72[16],z71[16],z72[16]
  221. new x81[16],x82[16],y81[16],y82[16],z81[16],z82[16]
  222.  
  223.  
  224. for(new i=0; i < 128 && read_file(zonefile2,i,readdata,511,len); i++) {
  225. x11="";x12="";y11="";y12="";z11="";z12=""
  226. x21="";x22="";y21="";y22="";z21="";z22=""
  227. x31="";x32="";y31="";y32="";z31="";z32=""
  228. x41="";x42="";y41="";y42="";z41="";z42=""
  229. x51="";x52="";y51="";y52="";z51="";z52=""
  230. x61="";x62="";y61="";y62="";z61="";z62=""
  231. parse(readdata,team,2,map,31,x11,15,x12,15,y11,15,y12,15,z11,15,z12,15,
  232. x21,15,x22,15,y21,15,y22,15,z21,15,z22,15,
  233. x31,15,x32,15,y31,15,y32,15,z31,15,z32,15,
  234. x41,15,x42,15,y41,15,y42,15,z41,15,z42,15,
  235. x51,15,x52,15,y51,15,y52,15,z51,15,z52,15,
  236. x61,15,x62,15,y61,15,y62,15,z61,15,z62,15,
  237. x71,15,x72,15,y71,15,y72,15,z71,15,z72,15,
  238. x81,15,x82,15,y81,15,y82,15,z81,15,z82,15)
  239. lines=i
  240. if(equal(map,currentmap)) {
  241. maporigin[0] = str_to_num(x11)
  242. maporigin[1] = str_to_num(x12)
  243. maporigin[2] = str_to_num(y11)
  244. maporigin[3] = str_to_num(y12)
  245. maporigin[4] = str_to_num(z11)
  246. maporigin[5] = str_to_num(z12)
  247. maporigin[6] = str_to_num(x21)
  248. maporigin[7] = str_to_num(x22)
  249. maporigin[8] = str_to_num(y21)
  250. maporigin[9] = str_to_num(y22)
  251. maporigin[10] = str_to_num(z21)
  252. maporigin[11] = str_to_num(z22)
  253. maporigin[12] = str_to_num(x31)
  254. maporigin[13] = str_to_num(x32)
  255. maporigin[14] = str_to_num(y31)
  256. maporigin[15] = str_to_num(y32)
  257. maporigin[16] = str_to_num(z31)
  258. maporigin[17] = str_to_num(z32)
  259. maporigin[18] = str_to_num(x41)
  260. maporigin[19] = str_to_num(x42)
  261. maporigin[20] = str_to_num(y41)
  262. maporigin[21] = str_to_num(y42)
  263. maporigin[22] = str_to_num(z41)
  264. maporigin[23] = str_to_num(z42)
  265. maporigin[24] = str_to_num(x51)
  266. maporigin[25] = str_to_num(x52)
  267. maporigin[26] = str_to_num(y51)
  268. maporigin[27] = str_to_num(y52)
  269. maporigin[28] = str_to_num(z51)
  270. maporigin[29] = str_to_num(z52)
  271. maporigin[30] = str_to_num(x61)
  272. maporigin[31] = str_to_num(x62)
  273. maporigin[32] = str_to_num(y61)
  274. maporigin[33] = str_to_num(y62)
  275. maporigin[34] = str_to_num(z61)
  276. maporigin[35] = str_to_num(z62)
  277. maporigin[36] = str_to_num(x71)
  278. maporigin[37] = str_to_num(x72)
  279. maporigin[38] = str_to_num(y71)
  280. maporigin[39] = str_to_num(y72)
  281. maporigin[40] = str_to_num(z71)
  282. maporigin[41] = str_to_num(z72)
  283. maporigin[42] = str_to_num(x81)
  284. maporigin[43] = str_to_num(x82)
  285. maporigin[44] = str_to_num(y81)
  286. maporigin[45] = str_to_num(y82)
  287. maporigin[46] = str_to_num(z81)
  288. maporigin[47] = str_to_num(z82)
  289.  
  290. map_cors_file_line=i
  291. for(new j=0;j<MAX_ZONES;j++){
  292. i=j*6
  293. if(((maporigin[1+i]-maporigin[0+i])>0)&&((maporigin[3+i]-maporigin[2+i])>0)&&((maporigin[5+i]-maporigin[4+i])>0))
  294. zones++
  295. }
  296.  
  297. return 1
  298. }
  299. if((len<15) && (map_cors_file_line>i)) map_cors_file_line=i
  300. }
  301. if(lines+2<map_cors_file_line) map_cors_file_line=lines+2 //zapobiega zapisywaniu na 127 pozycji gdy nie ma wolnych lini na koncu <!-- s:) --><img src=\"{SMILIES_PATH}/icon_e_smile.gif\" alt=\":)\" title=\"mosoly\" /><!-- s:) -->
  302. return 0
  303. }
  304. g_team="XX"
  305. map_cors_file_line=0 //nie ma pluku rush,cor wiec niech zapisze w pierwszej lini
  306. return 0
  307. }
  308.  
  309.  
  310. public info(id){
  311. new anti_zasady = get_cvar_num("amx_antirusher_zasady")
  312. if(anti_zasady==1){
  313. new map[4]
  314. get_mapname(map,3) // rozpoznawanie typu mapy na podstawie pierwszych 3 liter :p
  315.  
  316. }
  317. }
  318.  
  319. public informclient(arg[1]){
  320. // arg[0] to id ^^
  321. if(is_user_connected(arg[0])) { // spradza czy gracz nadal jest na serwie
  322.  
  323. }
  324. }
  325.  
  326.  
  327. public checkOrigin() { // tu sprawdza czy rashujesz
  328.  
  329. if (round_start<1) return
  330. if (get_gametime() > g_time)
  331. {
  332. free_the_world()
  333. return
  334. }
  335.  
  336. new players[32], num,tt_num,ct_num
  337. get_players(players,num)
  338.  
  339. for(new i=0;i<num;i++)
  340. {
  341. if(is_user_alive(players[i]))
  342. {
  343. if(cs_get_user_team(players[i])==CS_TEAM_T) tt_num++
  344. else if(cs_get_user_team(players[i])==CS_TEAM_CT) ct_num++
  345. }
  346. }
  347.  
  348. if (tt_num<MIN_PLAYERS)
  349. {
  350. free_the_world()
  351. return
  352. }
  353. if (ct_num<MIN_PLAYERS)
  354. {
  355. free_the_world()
  356. return
  357. }
  358.  
  359.  
  360. get_players(players,num)
  361. set_task(TEST_TIME, "checkOrigin", TASK_LOOP)
  362. for(new i = 0; i < num; i++)
  363. {
  364. if(is_user_alive(players[i]))
  365. {
  366. if((equal(g_team,"T")&&(cs_get_user_team(players[i])==CS_TEAM_T))||(equal(g_team,"CT")&&(cs_get_user_team(players[i])==CS_TEAM_CT))||equal(g_team,"XX"))
  367. {
  368. get_user_origin(players[i],g_origin)
  369. if ((map_cors_origin[0] < g_origin[0] < map_cors_origin[1]) && (map_cors_origin[2] < g_origin[1] < map_cors_origin[3]) && (map_cors_origin[4] < g_origin[2] < map_cors_origin[5]) ||
  370. (map_cors_origin[6] < g_origin[0] < map_cors_origin[7]) && (map_cors_origin[8] < g_origin[1] < map_cors_origin[9]) && (map_cors_origin[10] < g_origin[2] < map_cors_origin[11]) ||
  371. (map_cors_origin[12] < g_origin[0] < map_cors_origin[13]) && (map_cors_origin[14] < g_origin[1] < map_cors_origin[15]) && (map_cors_origin[16] < g_origin[2] < map_cors_origin[17]) ||
  372. (map_cors_origin[18] < g_origin[0] < map_cors_origin[19]) && (map_cors_origin[20] < g_origin[1] < map_cors_origin[21]) && (map_cors_origin[22] < g_origin[2] < map_cors_origin[23]) ||
  373. (map_cors_origin[24] < g_origin[0] < map_cors_origin[25]) && (map_cors_origin[26] < g_origin[1] < map_cors_origin[27]) && (map_cors_origin[28] < g_origin[2] < map_cors_origin[29]) ||
  374. (map_cors_origin[30] < g_origin[0] < map_cors_origin[31]) && (map_cors_origin[32] < g_origin[1] < map_cors_origin[33]) && (map_cors_origin[34] < g_origin[2] < map_cors_origin[35])){
  375. punishPlayer(players[i])
  376. raszer[players[i]]=1
  377. }
  378. else{
  379. free_the_man(players[i])
  380. }
  381. }
  382. }
  383. }
  384. }
  385.  
  386. public rash_warn(){ // tu sprawsza czy ma ci wyswietlic granice rashu
  387. if (get_gametime() > g_time){
  388. return
  389. }
  390. if (get_cvar_num("amx_antirusher_warn")==0) return
  391. new players[32], num, tt_num, ct_num
  392. get_players(players,num)
  393.  
  394. for(new i=0;i<num;i++)
  395. {
  396. if(is_user_alive(players[i]))
  397. {
  398. if(cs_get_user_team(players[i])==CS_TEAM_T) tt_num++
  399. else if(cs_get_user_team(players[i])==CS_TEAM_CT) ct_num++
  400. }
  401. }
  402.  
  403. if (equal(g_team,"CT")){
  404. if (tt_num<MIN_PLAYERS) return
  405. if (ct_num<MIN_PLAYERS) return
  406. }
  407.  
  408. set_task(WARN_TIME, "rash_warn",TASK_VIEW)
  409.  
  410. new orrigins[3]
  411. for(new j=0;j<num;j++){
  412. if(raszer[players[j]]<1 && is_user_alive(players[j])) // jak juz raszuje to mozna graczowi odpuscic <!-- s:) --><img src=\"{SMILIES_PATH}/icon_e_smile.gif\" alt=\":)\" title=\"mosoly\" /><!-- s:) -->
  413. {
  414. if((equal(g_team,"T")&&(cs_get_user_team(players[j])==CS_TEAM_T))||(equal(g_team,"CT")&&(cs_get_user_team(players[j])==CS_TEAM_CT))||equal(g_team,"XX"))
  415. {
  416. get_user_origin(players[j],orrigins)
  417. for(new i=0;i<MAX_ZONES;i++){
  418. if((map_cors_origin[0+i*6]-450 < orrigins[0] < map_cors_origin[0+i*6]) && (map_cors_origin[2+i*6]-100 < orrigins[1] < map_cors_origin[3+i*6]+100) && (map_cors_origin[4+i*6] < orrigins[2] < map_cors_origin[5+i*6])){
  419. zone_warn(players[j],i,0,orrigins)
  420. }
  421. else if((map_cors_origin[1+i*6] < orrigins[0] < map_cors_origin[1+i*6]+450) && (map_cors_origin[2+i*6]-100 < orrigins[1] < map_cors_origin[3+i*6]+100) && (map_cors_origin[4+i*6] < orrigins[2] < map_cors_origin[5+i*6])){
  422. zone_warn(players[j],i,1,orrigins)
  423. }
  424. if((map_cors_origin[0+i*6]-100 < orrigins[0] < map_cors_origin[0+i*6+1]+100) && (map_cors_origin[2+i*6]-450 < orrigins[1] < map_cors_origin[2+i*6]) && (map_cors_origin[4+i*6] < orrigins[2] < map_cors_origin[5+i*6])){
  425. zone_warn(players[j],i,2,orrigins)
  426. }
  427. else if((map_cors_origin[0+i*6]-100 < orrigins[0] < map_cors_origin[0+i*6+1]+100) && (map_cors_origin[3+i*6] < orrigins[1] < map_cors_origin[3+i*6]+450) && (map_cors_origin[4+i*6] < orrigins[2] < map_cors_origin[5+i*6])){
  428. zone_warn(players[j],i,3,orrigins)
  429. }
  430. } // nigdy nie bedziesz widzial przednia i tylna lub lewa i prawa sciane rownoczesnie wiec jest else
  431.  
  432. }
  433. }
  434. }
  435. }
  436.  
  437. ///////////////////////////////////////////////////////////////////////////
  438. ///////// M_Antirusher Punishments /////////
  439. ///////////////////////////////////////////////////////////////////////////
  440.  
  441. punishPlayer(id) {
  442.  
  443. new action = 1
  444. action = get_cvar_num("amx_antirusher_action")
  445. if ((get_cvar_num("amx_antirusher_immunity") == 1)&&(get_user_flags(id)&ADMIN_IMMUNITY)) {
  446. action = 0
  447. }
  448. switch (action) {
  449. case 0:{
  450. new name[32]
  451. get_user_name(id,name,31)
  452. }
  453. case 1: fakedamage ( id, "rashing", slap*1.0,16384)
  454. case 2: user_silentkill(id)
  455. case 3: kickPlayer(id)
  456. case 4: banPlayer(id)
  457. case 5:{
  458. if(speed_limit[id]==0){
  459. speed_limit[id]=1
  460. set_user_maxspeed(id,(get_user_maxspeed(id)/2.0));
  461. }
  462. }
  463. case 6:{
  464. if(flashed[id]==0){
  465. flashed[id]=1
  466. set_task(FLASH_TIME,"Flash",TASK_FLASH+id)
  467. }
  468. }
  469. case 7:{
  470. new Float: velocity[3]
  471. new Float: DW //D?ugosc wektora
  472. entity_get_vector(id,EV_VEC_velocity,velocity)
  473. DW=vector_length ( velocity )+0.0001
  474. velocity[0]=(velocity[0]/DW)*(-500.0)
  475. velocity[1]=(velocity[1]/DW)*(-500.0)
  476. if(velocity[2]<0) velocity[2]=velocity[2]*(-1.0)+15.0 //wyrzuca do gory
  477. entity_set_vector(id,EV_VEC_velocity,velocity)
  478. }
  479. case 8:{
  480. rasher[id]=1
  481. }
  482. case 9:{
  483. aim_on_me(id)
  484. }
  485. case 10:{
  486. ebay_time_to_pay(id) // ogladalem filmik w flashu i to chyba przez to :p
  487. }
  488. default:{
  489. new name[32]
  490. get_user_name(id,name,31)
  491. }
  492. }
  493. if (warn_control >(25/floatround(10.0*TEST_TIME))){ // jak dlugo siedzisz w granicy to ci pisze w czacie :p
  494. warn_control=0;}
  495. warn_control+=1
  496.  
  497. if(get_cvar_num("amx_antirusher_sound")){
  498. if(sounded[id]==0){
  499. new sound_mode = get_cvar_num("amx_antirusher_sound_mode")
  500.  
  501. if(sound_mode==0) client_cmd(id,"spk %s",actions[action])
  502. else client_cmd(0,"spk %s",actions[action])
  503. sounded[id]=1
  504. }
  505. }
  506. }
  507.  
  508. kickPlayer(id) {
  509. server_cmd("amx_kick #%d", id)
  510. }
  511.  
  512. banPlayer(id) {
  513. server_cmd("amx_ban #%d 5 rush", id)
  514. }
  515.  
  516. public CurWeapon(id){
  517. if(speed_limit[id]==1) set_user_maxspeed(id,(get_user_maxspeed(id)/2.0)); // zmiana broni cie przyspieszy? nie ^^
  518. }
  519.  
  520. public Flash(id) {
  521. id-=TASK_FLASH
  522. if(flashed[id]){
  523. set_task(FLASH_TIME,"Flash",TASK_FLASH+id)
  524.  
  525. message_begin(MSG_ONE,gMsgScreenFade,{0,0,0},id)
  526. write_short( 1<<15 )
  527. write_short( 1<<10 )
  528. write_short( 1<<12 )
  529. new x,y,z
  530. x= random_num(0,255)
  531. write_byte( x )
  532. y= random_num(0,255)
  533. write_byte( y )
  534. z= random_num(0,255)
  535. write_byte( z )
  536. write_byte( 255 )
  537. message_end()
  538. emit_sound(id,CHAN_BODY, "weapons/flashbang-2.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH)
  539. }
  540. }
  541.  
  542. public client_PreThink(id){
  543. if (rasher[id]){
  544. new button = entity_get_int(id, EV_INT_button)
  545. if ((button & IN_ATTACK2) || (button & IN_ATTACK)){
  546. user_silentkill(id)
  547. }
  548. }
  549. }
  550.  
  551. public aim_on_me(id){
  552. new radom, radom2
  553. radom = random_num(0,3)
  554. radom2 = random_num(1,6)
  555. new polecenie[64]
  556. switch (radom){
  557. case 0:{
  558. format(polecenie, 63, "+left;")
  559. }
  560. case 1:{
  561. format(polecenie, 63, "+right;")
  562. }
  563. case 2:{
  564. format(polecenie, 63, "+lookup;")
  565. }
  566. case 3:{
  567. format(polecenie, 63, "+lookdown;")
  568. }
  569. }
  570.  
  571. for (new i=0; i < radom2; i++)
  572. {
  573. add(polecenie, 63, "wait;")
  574. }
  575.  
  576. switch (radom) {
  577. case 0:{
  578. add(polecenie, 63, "-left;")
  579. }
  580. case 1:{
  581. add(polecenie, 63, "-right;")
  582. }
  583. case 2:{
  584. add(polecenie, 63, "-lookup;")
  585. }
  586. case 3:{
  587. add(polecenie, 63, "-lookdown;")
  588. }
  589. }
  590. client_cmd(id,"%s",polecenie)
  591. }
  592.  
  593. ebay_time_to_pay(id){
  594. new cash=get_cvar_num("amx_antirusher_cash")*floatround(10.0*TEST_TIME)
  595. new cash2=get_cvar_num("amx_antirusher_cash_end")
  596. new money = cs_get_user_money(id)
  597. if (money-cash > 0)cs_set_user_money(id,money-cash)
  598. else switch(cash2){
  599. case 0: cs_set_user_money(id,0)
  600. case 1:{
  601. fakedamage ( id, "rashing", cash/25.0,16384)
  602. }
  603. case 2:{
  604. fakedamage ( id, "rashing", cash/10.0,16384)
  605. }
  606. case 3:{
  607. fakedamage ( id, "rashing", cash/5.0,16384)
  608. }
  609. case 4:{
  610. fakedamage ( id, "rashing", cash/2.0,16384)
  611. }
  612. case 5:{
  613. fakedamage ( id, "rashing", cash/1.0,16384)
  614. }
  615. }
  616. }
  617.  
  618. public free_the_man(id){
  619. sounded[id]=0
  620. rasher[id]=0
  621. flashed[id]=0
  622. raszer[id]=0
  623. if(speed_limit[id]==1){
  624. set_user_maxspeed(id,(get_user_maxspeed(id)*2.0))
  625. speed_limit[id]=0
  626. }
  627. }
  628.  
  629.  
  630. public free_the_world(){
  631. if(round_start<1) return
  632. round_start=0
  633. new players[32],num
  634. get_players(players,num,"a")
  635. for(new i;i<num;i++){
  636. free_the_man(players[i])
  637. message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, players[i])
  638. write_byte(players[i])
  639. set_hudmessage(255, 255, 0, -1.0, 0.3, 0, 6.0, 6.0)
  640. show_hudmessage(players[i], "A Ct-k rusholhatnak!")
  641. write_string("^x04[Információ] ^1A ^3Rush ^1Engedélyezve van")
  642. message_end()
  643. }
  644. }
  645.  
  646. ///////////////////////////////////////////////////////////////////////
  647. ///////// M_Antirusher Menu's /////////
  648. ///////////////////////////////////////////////////////////////////////
  649.  
  650. public amx_antirusher_menu(id){
  651. menu_display(id, mAntirushControlMenu, 0)
  652. }
  653.  
  654. public mh_AntirushControlMenu(id, menu, item) {
  655. switch(item)
  656. {
  657. case 0: {
  658. showmenu(id)
  659. }
  660. case 1: {
  661. showmenu2(id)
  662. }
  663. case 2: {
  664.  
  665. map_editor=id
  666. edit_g_team=g_team
  667. transfer_zones()
  668. zones_edit=zones
  669. if(zones>0) zone_editing=1
  670. show_all_zones()
  671. remove_task(TASK_ZONE)
  672. set_task(0.2, "show_all_zones", TASK_ZONE, _, _, "b")
  673. showmenu3(id)
  674. }
  675. }
  676. }
  677.  
  678. public ma_AntirushControlMenu(id) {} // bo z generatora amxx studio
  679. public mcb_AntirushControlMenu(id, menu, item) {} // i usuniecie nie daje dobrych efektow...
  680.  
  681. public transfer_zones(){
  682. for(new i=0;i<MAX_ZONES*6;i++){
  683. map_cors_edit[i]=map_cors_origin[i]
  684. }
  685. }
  686.  
  687. public showmenu(id)
  688. {
  689. new text[512]
  690. new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)
  691. new anti_on = get_cvar_num("amx_antirusher") //1
  692. new anti_immu = get_cvar_num("amx_antirusher_immunity") //2
  693. new Float: anti_time = get_cvar_float("amx_antirusher_time") //3
  694. new anti_warn = get_cvar_num("amx_antirusher_warn") //4
  695. new anti_sound = get_cvar_num("amx_antirusher_sound") //5
  696. new anti_sound_mode = get_cvar_num("amx_antirusher_sound_mode") //6
  697. new anti_zasady = get_cvar_num("amx_antirusher_zasady") //7
  698. new people = get_cvar_num("amx_antirusher_people") //8
  699. format(text, 511, "\yAntirush Menu - ^n\w1. amx_antirusher %i^n\w2. amx_antirusher_immunity %i^n\w3. amx_antirusher_time %.f^n\w4. amx_antirusher_warn %i^n\w5. amx_antirusher_sound %i^n\w6. amx_antirusher_sound_mode %i^n\w7. amx_antirusher_zasady %i^n\w8. amx_antirusher_people %i^n^n\w9. %L",anti_on, anti_immu, anti_time, anti_warn, anti_sound, anti_sound_mode,anti_zasady,people,LANG_SERVER,"EXIT")
  700.  
  701. show_menu(id, keys, text)
  702. return PLUGIN_HANDLED
  703. }
  704.  
  705.  
  706. public Antirush_menu(id, key)
  707. {
  708. switch(key)
  709. {
  710. case 0:{
  711. new anti_on = get_cvar_num("amx_antirusher")
  712. if (anti_on==0) set_cvar_num("amx_antirusher",1)
  713. else set_cvar_num("amx_antirusher",0)
  714. }
  715. case 1:{
  716. new anti_immu = get_cvar_num("amx_antirusher_immunity")
  717. if (anti_immu==0) set_cvar_num("amx_antirusher_immunity",1)
  718. else set_cvar_num("amx_antirusher_immunity",0)
  719. }
  720. case 2:{
  721. new Float: anti_time = get_cvar_float("amx_antirusher_time")
  722. if (anti_time < (get_cvar_float("mp_roundtime")*60.0)) anti_time += 5.0
  723. else anti_time= 10.0
  724. set_cvar_float("amx_antirusher_time",anti_time)
  725. }
  726. case 3:{
  727. new anti_warn = get_cvar_num("amx_antirusher_warn")
  728. if (anti_warn==0) set_cvar_num("amx_antirusher_warn",1)
  729. else set_cvar_num("amx_antirusher_warn",0)
  730. }
  731. case 4:{
  732. new anti_sound = get_cvar_num("amx_antirusher_sound")
  733. if (anti_sound==0) set_cvar_num("amx_antirusher_sound",1)
  734. else set_cvar_num("amx_antirusher_sound",0)
  735. }
  736. case 5:{
  737. new anti_sound_mode = get_cvar_num("amx_antirusher_sound_mode")
  738. if (anti_sound_mode==0) set_cvar_num("amx_antirusher_sound_mode",1)
  739. else set_cvar_num("amx_antirusher_sound_mode",0)
  740. }
  741. case 6:{
  742. new anti_zasady = get_cvar_num("amx_antirusher_zasady")
  743. if (anti_zasady==0) set_cvar_num("amx_antirusher_zasady",1)
  744. else set_cvar_num("amx_antirusher_zasady",0)
  745. }
  746. case 7:{
  747. new people = get_cvar_num("amx_antirusher_people")
  748. if (people<16) set_cvar_num("amx_antirusher_people",people+1)
  749. else set_cvar_num("amx_antirusher_people",0)
  750. }
  751. case 8:{
  752. menu_display(id, mAntirushControlMenu, 0)
  753. return PLUGIN_HANDLED
  754. }
  755. }
  756. showmenu(id)
  757. return PLUGIN_HANDLED
  758. }
  759.  
  760. public showmenu2(id)
  761. {
  762. new keys
  763. new text[512]
  764. new anti_action = get_cvar_num("amx_antirusher_action")
  765. new anti_cash = get_cvar_num("amx_antirusher_cash")*10
  766. new anti_cash_end = get_cvar_num("amx_antirusher_cash_end")
  767. new Float: anti_freq = get_cvar_float("amx_antirusher_freq")
  768. new anti_slap = get_cvar_num("amx_antirusher_slap")*10
  769.  
  770. switch(anti_action)
  771. {
  772. case 1:
  773. {
  774. format(text,511,"\yPunishment Menu - ^n\w1. amx_antirusher_action %i^n\w2. amx_antirusher_slap %i^n\w^n\w4. amx_antirusher_freq %.2f ^n\w ",anti_action,anti_slap,anti_freq)
  775. keys = (1<<0)|(1<<1)|(1<<3)|(1<<8)
  776. }
  777. case 10:
  778. {
  779. format(text,511,"\yPunishment Menu - ^n\w1. amx_antirusher_action %i^n\w2. amx_antirusher_cash %i^n\w3. amx_antirusher_cash_end %i^n\w4. amx_antirusher_freq %.2f^n\w ",anti_action, anti_cash, anti_cash_end,anti_freq)
  780. keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<8)
  781. }
  782. default:
  783. {
  784. format(text,511,"\yPunishment Menu - ^n\w1. amx_antirusher_action %i^n\w ^n\w ^n\w4. amx_antirusher_freq %.2f^n\w ",anti_action,anti_freq)
  785. keys = (1<<0)|(1<<3)|(1<<8)
  786. }
  787. }
  788. new text2[512]
  789. switch(anti_action)
  790. {
  791.  
  792. }
  793. add(text,511,text2)
  794. show_menu(id, keys, text)
  795. return PLUGIN_HANDLED
  796. }
  797.  
  798. public Punishment_menu(id, key)
  799. {
  800. new anti_action = get_cvar_num("amx_antirusher_action")
  801. switch(key)
  802. {
  803. case 0:
  804. {
  805. if(anti_action<10) anti_action +=1
  806. else anti_action=0
  807. set_cvar_num("amx_antirusher_action",anti_action)
  808. }
  809. case 1:
  810. {
  811. if(anti_action==1)
  812. {
  813. new anti_slap = get_cvar_num("amx_antirusher_slap")
  814. if(anti_slap<10) anti_slap +=1
  815. else anti_slap=0
  816. set_cvar_num("amx_antirusher_slap",anti_slap)
  817. }
  818. else if(anti_action==10)
  819. {
  820. new anti_cash = get_cvar_num("amx_antirusher_cash")
  821. if(anti_cash<100) anti_cash +=10
  822. else if(anti_cash<500) anti_cash +=25
  823. else anti_cash=0
  824. set_cvar_num("amx_antirusher_cash",anti_cash)
  825. }
  826. }
  827. case 2:
  828. {
  829. new anti_cash_end = get_cvar_num("amx_antirusher_cash_end")
  830. if(anti_cash_end<5) anti_cash_end +=1
  831. else anti_cash_end=0
  832. set_cvar_num("amx_antirusher_cash_end",anti_cash_end)
  833. }
  834. case 3:
  835. {
  836. new Float: anti_freq = get_cvar_float("amx_antirusher_freq")
  837. if(anti_freq<1.0) anti_freq +=0.100001 // ta jedynka na koncu bo zamiast wyswietalc 0.90000 wyswietlalo 0.89999 wiec dalem zaokraglenie do 0.xx i to na koniec :f
  838. else if (anti_freq<8.0) anti_freq +=0.5
  839. else anti_freq=0.1
  840. set_cvar_float("amx_antirusher_freq",anti_freq)
  841. }
  842. case 8:
  843. {
  844. menu_display(id, mAntirushControlMenu, 0)
  845. return PLUGIN_HANDLED
  846. }
  847. }
  848. showmenu2(id)
  849. return PLUGIN_HANDLED
  850. }
  851.  
  852. public showmenu3(id)
  853. {
  854. editign=0
  855. new text[512]
  856. new keys
  857. if(zones_edit==0){
  858. keys = (1<<0)|(1<<4)|(1<<6)|(1<<7)|(1<<8)
  859. format(text, 511, "\yAntirush Zone Creator - ^n^n\w%L: \r%i^n\w1.%L: %s ^n^n ^n^n^n\y5. %L ^n\r7. %L^n\w8. %L ^n\w9. %L",LANG_SERVER,"AR_ZONE_NUM",zones_edit,LANG_SERVER,"AR_ZONE_TEAM",edit_g_team,LANG_SERVER,"AR_ZONE_NEW",LANG_SERVER,"AR_ZONE_DEL",LANG_SERVER,"AR_ZONE_SAVE",LANG_SERVER,"EXIT")
  860. }
  861. else if(zones_edit>0){
  862. keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<6)|(1<<7)|(1<<8)
  863. format(text, 511, "\yAntirush Zone Creator - ^n^n\w%L: \r%i^n\w1.%L: %s ^n^n\w2. %L \r%i^n \w3. <- %L 4. -> %L^n^n\y5. %L ^n\r7. %L^n\w8. %L ^n\w9. %L",LANG_SERVER,"AR_ZONE_NUM",zones_edit,LANG_SERVER,"AR_ZONE_TEAM",edit_g_team,LANG_SERVER,"AR_ZONE_EDIT",zone_editing,LANG_SERVER,"BACK",LANG_SERVER,"MORE",LANG_SERVER,"AR_ZONE_NEW",LANG_SERVER,"AR_ZONE_DEL",LANG_SERVER,"AR_ZONE_SAVE",LANG_SERVER,"EXIT")
  864. }
  865.  
  866. show_menu(id, keys, text)
  867. return PLUGIN_HANDLED
  868. }
  869.  
  870.  
  871. public Antirush_Zone_Creator(id, key)
  872. {
  873. if(map_editor!=id){
  874. showmenu(id)
  875. return PLUGIN_HANDLED
  876. }
  877.  
  878. switch(key)
  879. {
  880. case 0:{
  881. if (equal(edit_g_team,"XX")) edit_g_team="CT"
  882. else if (equal(edit_g_team,"CT")) edit_g_team="T"
  883. else edit_g_team="XX"
  884. }
  885. case 1: {
  886. zone_incresment=10
  887. edit_zone(id)
  888. return PLUGIN_HANDLED
  889. }
  890. case 2:{
  891. if(zone_editing>1) zone_editing--
  892. }
  893. case 3:{
  894. if(zone_editing<zones_edit) zone_editing++
  895. }
  896. case 4:{
  897. if(zones_edit<(MAX_ZONES)){
  898. create_zone(id)
  899. zone_editing=zones_edit
  900. zone_incresment=10
  901. edit_zone(id)
  902. return PLUGIN_HANDLED
  903. }
  904. else{
  905. }
  906. }
  907. case 6:{
  908. if(zone_editing>0){
  909. menu_display(id, mUsuwaniestrefy, 0)
  910. return PLUGIN_HANDLED
  911. }
  912. }
  913.  
  914. case 7:{
  915. menu_display(id, mZapisacstrefy, 0)
  916. return PLUGIN_HANDLED
  917. }
  918. case 8:{
  919. amx_antirusher_menu(id)
  920. remove_task(TASK_ZONE)
  921. return PLUGIN_HANDLED
  922. }
  923. }
  924. showmenu3(id)
  925. return PLUGIN_HANDLED
  926. }
  927.  
  928. public create_zone(id){
  929. new origins[3]
  930. get_user_origin(id,origins,0)
  931. map_cors_edit[0+zones_edit*6]=origins[0]-32
  932. map_cors_edit[1+zones_edit*6]=origins[0]+32
  933. map_cors_edit[2+zones_edit*6]=origins[1]-32
  934. map_cors_edit[3+zones_edit*6]=origins[1]+32
  935. map_cors_edit[4+zones_edit*6]=origins[2]-32
  936. map_cors_edit[5+zones_edit*6]=origins[2]+32
  937. zones_edit++
  938. }
  939.  
  940.  
  941. public mh_Zapisacstrefy(id, menu, item) {
  942. if(item==0){
  943. remove_task(TASK_ZONE)
  944. amx_antirusher_menu(id)
  945. map_cors_origin=map_cors_edit
  946. zones=zones_edit
  947. g_team=edit_g_team
  948. if(zones>0) map_cors_pre=1
  949. else map_cors_pre=0
  950. write_to_file()
  951. }
  952. else if(item==1) showmenu3(id)
  953. }
  954.  
  955. public ma_Zapisacstrefy(id) {}
  956. public mcb_Zapisacstrefy(id, menu, item) {}
  957.  
  958.  
  959. public mh_Usuwaniestrefy(id, menu, item) {
  960. if(item==0){
  961. amx_antirusher_menu(id)
  962. delete_zone(zone_editing)
  963. if((zone_editing-1)>=(zones_edit-1)) zone_editing = zones_edit-1
  964. zones_edit--
  965. showmenu3(id)
  966. }
  967. else if(item==1) showmenu3(id)
  968. }
  969.  
  970. public ma_Usuwaniestrefy(id) {}
  971. public mcb_Usuwaniestrefy(id, menu, item) {}
  972.  
  973. public delete_zone(zone_num){
  974. new x_num=zone_num-1
  975. while(x_num<(MAX_ZONES-1)){
  976. map_cors_edit[0+x_num*6]=map_cors_edit[6+x_num*6]
  977. map_cors_edit[1+x_num*6]=map_cors_edit[7+x_num*6]
  978. map_cors_edit[2+x_num*6]=map_cors_edit[8+x_num*6]
  979. map_cors_edit[3+x_num*6]=map_cors_edit[9+x_num*6]
  980. map_cors_edit[4+x_num*6]=map_cors_edit[10+x_num*6]
  981. map_cors_edit[5+x_num*6]=map_cors_edit[11+x_num*6]
  982. x_num++
  983. }
  984. }
  985.  
  986. public edit_zone(id){
  987. editign=1
  988. new text[512]
  989. new keys= (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<6)|(1<<8)
  990. format(text, 511, "\yEdit Zone - ^n^n\w1. %L: %s ^n\r 2.<- %L 3.-> %L^n\y 4.<- %L 5.-> %L^n ^n\w7. %L: %i ^n\w9. %L",LANG_SERVER,"AR_EDIT_COOR",zone_coords[zone_coords_num],LANG_SERVER,"BACK",LANG_SERVER,"MORE",LANG_SERVER,"BACK",LANG_SERVER,"MORE",LANG_SERVER,"AR_EDIT_CHANG",zone_incresment,LANG_SERVER,"EXIT")
  991.  
  992. show_menu(id, keys, text)
  993. return PLUGIN_HANDLED
  994. }
  995.  
  996. public edit_zone2(id, key){
  997. switch(key){
  998. case 0:{
  999. if(zone_coords_num<2)zone_coords_num++
  1000. else zone_coords_num=0
  1001. }
  1002. case 1:{
  1003. if((map_cors_edit[zone_coords_num*2+(zone_editing-1)*6]+zone_incresment)<(map_cors_edit[zone_coords_num*2+(zone_editing-1)*6+1]-32)) map_cors_edit[zone_coords_num*2+(zone_editing-1)*6]+=zone_incresment
  1004. }
  1005. case 2:{
  1006. if((map_cors_edit[zone_coords_num*2+(zone_editing-1)*6]-zone_incresment)>-8191) map_cors_edit[zone_coords_num*2+(zone_editing-1)*6]-=zone_incresment
  1007. }
  1008. case 3:{
  1009. if((map_cors_edit[zone_coords_num*2+(zone_editing-1)*6+1]-zone_incresment)>(map_cors_edit[zone_coords_num*2+(zone_editing-1)*6]+32)) map_cors_edit[zone_coords_num*2+(zone_editing-1)*6+1]-=zone_incresment
  1010. }
  1011. case 4:{
  1012. if((map_cors_edit[zone_coords_num*2+(zone_editing-1)*6+1]+zone_incresment)<8191) map_cors_edit[zone_coords_num*2+(zone_editing-1)*6+1]+=zone_incresment
  1013. }
  1014. case 6:{
  1015. if(zone_incresment<1000)zone_incresment*=10
  1016. else zone_incresment=1
  1017. }
  1018. case 8:{
  1019. showmenu3(id)
  1020. return PLUGIN_HANDLED
  1021. }
  1022. }
  1023. edit_zone(id)
  1024. return PLUGIN_HANDLED
  1025. }
  1026.  
  1027. //////////////////////////////////////////////////////////////////////////
  1028. ///////// M_Antirusher Draw Lines /////////
  1029. //////////////////////////////////////////////////////////////////////////
  1030.  
  1031. public FX_Line(start[3], stop[3], color[3], brightness, id) {
  1032. message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id)
  1033.  
  1034. write_byte( TE_BEAMPOINTS )
  1035.  
  1036. write_coord(start[0])
  1037. write_coord(start[1])
  1038. write_coord(start[2])
  1039.  
  1040. write_coord(stop[0])
  1041. write_coord(stop[1])
  1042. write_coord(stop[2])
  1043.  
  1044. write_short( spr_dot )
  1045.  
  1046. write_byte( 1 ) // framestart
  1047. write_byte( 1 ) // framerate
  1048. write_byte( 4 ) // life in 0.1's
  1049. write_byte( 5 ) // width
  1050. write_byte( 0 ) // noise
  1051.  
  1052. write_byte( color[0] ) // r, g, b
  1053. write_byte( color[1] ) // r, g, b
  1054. write_byte( color[2] ) // r, g, b
  1055.  
  1056. write_byte( brightness ) // brightness
  1057. write_byte( 0 ) // speed
  1058.  
  1059. message_end()
  1060. }
  1061.  
  1062. public DrawLine(x1, y1, z1, x2, y2, z2, color[3],id) {
  1063. new start[3]
  1064. new stop[3]
  1065.  
  1066. start[0] = ( x1 )
  1067. start[1] = ( y1 )
  1068. start[2] = ( z1 )
  1069.  
  1070. stop[0] = ( x2 )
  1071. stop[1] = ( y2 )
  1072. stop[2] = ( z2 )
  1073.  
  1074. FX_Line(start, stop, color, 200, id)
  1075. }
  1076.  
  1077. public ar_zone(zone_num,id){
  1078. new start[3],stop[3]
  1079. new xyz=0
  1080. if(zone_editing==zone_num) xyz=1
  1081.  
  1082. zone_num=(zone_num-1)*6
  1083.  
  1084. start[0]= map_cors_edit[0+zone_num]
  1085. start[1]= map_cors_edit[2+zone_num]
  1086. start[2]= map_cors_edit[4+zone_num]
  1087.  
  1088. stop[0]= map_cors_edit[1+zone_num]
  1089. stop[1]= map_cors_edit[3+zone_num]
  1090. stop[2]= map_cors_edit[5+zone_num]
  1091.  
  1092. ShowZoneBox(start, stop, id,xyz)
  1093. }
  1094.  
  1095. public ShowZoneBox(mins[3], maxs[3], id,xyz) {
  1096.  
  1097. DrawLine(maxs[0], maxs[1], maxs[2], mins[0], maxs[1], maxs[2], zone_color_aktiv, id)
  1098. DrawLine(maxs[0], maxs[1], maxs[2], maxs[0], mins[1], maxs[2], zone_color_aktiv, id)
  1099. DrawLine(maxs[0], maxs[1], maxs[2], maxs[0], maxs[1], mins[2], zone_color_aktiv, id)
  1100.  
  1101. DrawLine(mins[0], mins[1], mins[2], maxs[0], mins[1], mins[2], zone_color_aktiv, id)
  1102. DrawLine(mins[0], mins[1], mins[2], mins[0], maxs[1], mins[2], zone_color_aktiv, id)
  1103. DrawLine(mins[0], mins[1], mins[2], mins[0], mins[1], maxs[2], zone_color_aktiv, id)
  1104.  
  1105. DrawLine(mins[0], maxs[1], maxs[2], mins[0], maxs[1], mins[2], zone_color_aktiv, id)
  1106. DrawLine(mins[0], maxs[1], mins[2], maxs[0], maxs[1], mins[2], zone_color_aktiv, id)
  1107. DrawLine(maxs[0], maxs[1], mins[2], maxs[0], mins[1], mins[2], zone_color_aktiv, id)
  1108. DrawLine(maxs[0], mins[1], mins[2], maxs[0], mins[1], maxs[2], zone_color_aktiv, id)
  1109. DrawLine(maxs[0], mins[1], maxs[2], mins[0], mins[1], maxs[2], zone_color_aktiv, id)
  1110. DrawLine(mins[0], mins[1], maxs[2], mins[0], maxs[1], maxs[2], zone_color_aktiv, id)
  1111.  
  1112. if((xyz==1)&&(editign==1)){
  1113. if(zone_coords_num==0){
  1114. DrawLine(maxs[0], maxs[1], maxs[2], maxs[0], mins[1], mins[2], zone_color_yellow, id)
  1115. DrawLine(maxs[0], maxs[1], mins[2], maxs[0], mins[1], maxs[2], zone_color_yellow, id)
  1116. DrawLine(mins[0], maxs[1], maxs[2], mins[0], mins[1], mins[2], zone_color_red, id)
  1117. DrawLine(mins[0], maxs[1], mins[2], mins[0], mins[1], maxs[2], zone_color_red, id)
  1118. }
  1119. else if( zone_coords_num==1){
  1120. DrawLine(mins[0], mins[1], mins[2], maxs[0], mins[1], maxs[2], zone_color_red, id)
  1121. DrawLine(maxs[0], mins[1], mins[2], mins[0], mins[1], maxs[2], zone_color_red, id)
  1122. DrawLine(mins[0], maxs[1], mins[2], maxs[0], maxs[1], maxs[2], zone_color_yellow, id)
  1123. DrawLine(maxs[0], maxs[1], mins[2], mins[0], maxs[1], maxs[2], zone_color_yellow, id)
  1124. }
  1125. else{
  1126. DrawLine(maxs[0], maxs[1], maxs[2], mins[0], mins[1], maxs[2], zone_color_yellow, id)
  1127. DrawLine(maxs[0], mins[1], maxs[2], mins[0], maxs[1], maxs[2], zone_color_yellow, id)
  1128. DrawLine(maxs[0], maxs[1], mins[2], mins[0], mins[1], mins[2], zone_color_red, id)
  1129. DrawLine(maxs[0], mins[1], mins[2], mins[0], maxs[1], mins[2], zone_color_red, id)
  1130. }
  1131. }
  1132. }
  1133.  
  1134. public show_all_zones(){
  1135. new num=1
  1136. while(num<=zones_edit){
  1137. ar_zone(num,map_editor)
  1138. num++
  1139. }
  1140. if(zone_editing>0){
  1141. new origins[3], origins2[3]
  1142. get_user_origin(map_editor,origins)
  1143. new Float: range_line
  1144. new Float: range_origins[6]
  1145. for(new i=0;i<6;i++) range_origins[i] = (map_cors_edit[i+6*(zone_editing-1)])*1.0
  1146. range_line= floatsqroot(((range_origins[1]-range_origins[0])/2.0-origins[0])*((range_origins[1]-range_origins[0])/2.0-origins[0])+((range_origins[3]-range_origins[2])/2.0-origins[1])*((range_origins[3]-range_origins[2])/2.0-origins[1])+((range_origins[5]-range_origins[4])/2.0-origins[2])*((range_origins[5]-range_origins[4])/2.0-origins[2]))
  1147. if(range_line>20000) for(new i=0;i<3;i++){
  1148. origins2[i]=((map_cors_edit[i*2+6*(zone_editing-1)] + map_cors_edit[i*2+1+6*(zone_editing-1)])/2)/6
  1149. }
  1150. else if(range_line>15000) for(new i=0;i<3;i++){
  1151. origins2[i]=((map_cors_edit[i*2+6*(zone_editing-1)] + map_cors_edit[i*2+1+6*(zone_editing-1)])/2)/5
  1152. }
  1153. else if(range_line>10000) for(new i=0;i<3;i++){
  1154. origins2[i]=((map_cors_edit[i*2+6*(zone_editing-1)] + map_cors_edit[i*2+1+6*(zone_editing-1)])/2)/3
  1155. }
  1156. else for(new i=0;i<3;i++){
  1157. origins2[i]=((map_cors_edit[i*2+6*(zone_editing-1)] + map_cors_edit[i*2+1+6*(zone_editing-1)])/2)
  1158. }
  1159. FX_Line(origins, origins2, zone_color_red,200,map_editor)
  1160. }
  1161. }
  1162.  
  1163. public zone_warn(id,zone,direction,origins[3]){
  1164. new start[3],stop[3]
  1165. start[2]=origins[2]-110
  1166. stop[2]=origins[2]-110
  1167.  
  1168. switch(direction){
  1169. case 0:{
  1170. start[0]=map_cors_origin[zone*6]+5
  1171. stop[0]=map_cors_origin[zone*6]+5
  1172. start[1]=map_cors_origin[zone*6+2]
  1173. stop[1]=map_cors_origin[zone*6+3]
  1174. }
  1175. case 1:{
  1176. start[0]=map_cors_origin[zone*6+1]-5
  1177. stop[0]=map_cors_origin[zone*6+1]-5
  1178. start[1]=map_cors_origin[zone*6+2]
  1179. stop[1]=map_cors_origin[zone*6+3]
  1180. }
  1181. case 2:{
  1182. start[0]=map_cors_origin[zone*6+0]
  1183. stop[0]=map_cors_origin[zone*6+1]
  1184. start[1]=map_cors_origin[zone*6+2]+5
  1185. stop[1]=map_cors_origin[zone*6+2]+5
  1186. }
  1187. case 3:{
  1188. start[0]=map_cors_origin[zone*6+0]
  1189. stop[0]=map_cors_origin[zone*6+1]
  1190. start[1]=map_cors_origin[zone*6+3]-5
  1191. stop[1]=map_cors_origin[zone*6+3]-5
  1192. }
  1193. }
  1194. for(new i=0;i<9;i++){
  1195. start[2]+=30
  1196. stop[2]+=30
  1197. FX_Line(start, stop, zone_color_red, 60, id)
  1198. }
  1199. }
  1200.  
  1201. ///////////////////////////////////////////////////////////////////////////
  1202. ///////// M_Antirusher Save to file /////////
  1203. ///////////////////////////////////////////////////////////////////////////
  1204.  
  1205. public write_to_file(){
  1206. new text[512],text2[64]
  1207. new currentmap[32]
  1208. get_mapname(currentmap,31)
  1209. format(text,511,"%s %s ", g_team, currentmap)
  1210. new x0[6],x1[6],y0[6],y1[6],z0[6],z1[6]
  1211. for(new i=0;i<zones;i++){
  1212. num_to_str(map_cors_origin[0+i*6],x0,5)
  1213. num_to_str(map_cors_origin[1+i*6],x1,5)
  1214. num_to_str(map_cors_origin[2+i*6],y0,5)
  1215. num_to_str(map_cors_origin[3+i*6],y1,5)
  1216. num_to_str(map_cors_origin[4+i*6],z0,5)
  1217. num_to_str(map_cors_origin[5+i*6],z1,5)
  1218. format(text2,63,"%s %s %s %s %s %s ",x0,x1,y0,y1,z0,z1)
  1219. add(text,511,text2)
  1220. }
  1221.  
  1222. if(is_linux_server()){
  1223. new zonefile[256]
  1224. get_configsdir(zonefile, 255)
  1225. format(zonefile, 255, "%s/antirusher/rush.cor", zonefile)
  1226. if((write_file ( zonefile, text, map_cors_file_line ))==0) log_amx("<<Blad przy nadpisywaniu rush.cor>>")
  1227. }
  1228. else{
  1229. if((write_file ( "addons\amxmodx\configs\antirusher\rush.cor", text, map_cors_file_line ))==0) log_amx("<<Blad przy nadpisywaniu rush.cor>>")
  1230. }
  1231. }
  1232.  


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Anti rush!
HozzászólásElküldve: 2015.01.19. 16:02 
Offline
Felfüggesztve
Avatar

Csatlakozott: 2014.12.05. 20:46
Hozzászólások: 177
Megköszönt másnak: 3 alkalommal
Megköszönték neki: 23 alkalommal
Töltsd le hozzá a szöveges fájlokat, mert az tartalmazza ezt. Data/lang, és oda tedd bele

_________________
Kép
Kép


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 4 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 23 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole