hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.03.28. 19:58



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: Bing [Bot], Google [Bot] 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  [ 2 hozzászólás ] 
Szerző Üzenet
HozzászólásElküldve: 2015.05.09. 22:03 
Offline
Jómunkásember
Avatar

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

_________________
Kép
Kép


Hozzászólás jelentése
Vissza a tetejére
   
HozzászólásElküldve: 2015.06.06. 10:18 
Offline
Senior Tag
Avatar

Csatlakozott: 2013.11.12. 16:39
Hozzászólások: 258
Megköszönt másnak: 87 alkalommal
Megköszönték neki: 2 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. new zone_color_aktiv[3] = { 0, 255, 255 }
  2.  
  3. new zone_color_red[3] = { 0, 255, 255 }
  4.  
  5. new zone_color_yellow[3] = { 0 255, 255 }


Ez a 61-63 sortól van :)

_________________
Nem szégyen megköszönni :)

'The dictator is coming' :D

Ők köszönték meg Charlie224 nek ezt a hozzászólást: parodyshelf (2015.06.08. 14:13)
  Népszerűség: 2.27%


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  [ 2 hozzászólás ] 


Ki van itt

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