hlmod.hu

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



Jelenlévő felhasználók

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

_________________
Kép
Kép


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


Ki van itt

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