hlmod.hu

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



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: nincs regisztrált felhasználó 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  [ 3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Anti Rush
HozzászólásElküldve: 2014.09.27. 11:35 
Offline
Jómunkásember
Avatar

Csatlakozott: 2013.12.18. 17:35
Hozzászólások: 365
Megköszönt másnak: 152 alkalommal
Megköszönték neki: 31 alkalommal
Hali!
Azt anti rush plugint keresem amelyik a "Rush engedélyezve van xy idő múlva"(hudba) és ugyanezt, ha a rush engedélyezve van szintén hudba!
Előre is köszi!

_________________
Ha segítettem használd a gombot!

Kép
KépKép


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: 2014.09.27. 17:57 
Offline
Őskövület
Avatar

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

_________________
****

Ők köszönték meg pixxa112 nek ezt a hozzászólást: Beckx (2014.09.27. 17:59)
  Népszerűség: 2.27%


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: 2014.09.27. 17:59 
Offline
Jómunkásember
Avatar

Csatlakozott: 2013.12.18. 17:35
Hozzászólások: 365
Megköszönt másnak: 152 alkalommal
Megköszönték neki: 31 alkalommal
Köszönöm:)

_________________
Ha segítettem használd a gombot!

Kép
KépKé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  [ 3 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 16 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