hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.06.17. 15:45



Jelenlévő felhasználók

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

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-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  [3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Rush szinesen
HozzászólásElküldve:2014.02.28. 16:00 
Offline
Fanatikus
Avatar

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


Kód:
[hu]
AR_NO_ZONE = Nincs Rush ezen mapon
AR_NO_FILE = A fajl nem le'tezik rush.cor
AR_CS_MAP = Ce'l: Terroristak vigyaznak tuszokra - CT megmentese a tuszokat
AR_DE_MAP = Ce'l: Teror lerak egy bombat - CT bomba hatastalanitja vagy megakadalyozza a lerakast
AR_FY_MAP = Ce'l: Olj meg minden ellenseget
AR_AIM_MAP = Ce'l: Olj meg minden ellenseget
AR_AWP_MAP = Ce'l: Olj meg minden ellenséget  AWP-vel
AR_KZ_MAP = Ce'l: A gyoztes jatekos a legtobb ellenseget oli meg
AR_FUN_MAP = Ce'l: Have Fun!
AR_SURF_MAP = Ce'l: A gyoztes jatekos a legjobb szorf spedd, leghosszabb ugras,stb
AR_SJ_MAP = Ce'l: Az gyoz akinek a csapata  tobb golt lo
AR_KA_MAP = Ce'l: Olj meg minden ellenseget
AR_HE_MAP = Ce'l: Olj meg minden ellenseget  granatokkal
AR_INFO_WARN = [AntiRush]-No Rush|Figyelem No Rush
AR_INFO_CLIENT = * Rush engedelyezve %.0f masodperc mulva *
AR_SRV_INFO =% s Jatekos atlepte a RUSH hatart !
AR_RASH_WARN = Atlepted a hatart!Tatrsd be a szerver szabalyait = tilos a RUSH !
AR_RASH_KICK = Atlepted a hatart! Buntetes = visszalokes.
AR_RASH_BAN = Atlepted a hatart!! Bunteted 5 percig.
AR_FREE_WORLD = A Ct-k Rusholhatnak
AR_ACTION_WARN = !!!!!!!A rush hata'ron a'tmente'l!!!!!!!!
AR_ACTION_HP = Rusher HP levona'sa
AR_ACTION_KILL = Rusher megole'se
AR_ACTION_KICK = Rusher Kickele'se
AR_ACTION_BAN = Rusher Bannola'sa
AR_ACTION_SLOW = Lassú Rusher
AR_ACTION_BLIND = Rusher Beflashele'se
AR_ACTION_FFILD = Szabad a rush
AR_ACTION_OFIRE = Rusher megole'se
AR_ACTION_BAIM = Bad ce'lja Rusher
AR_ACTION_CASH = Rusher pe'nz buntete's
AR_ACTION_CASH2 = Rusher pe'nz buntetes
AR_ACTION_NEW = ---
AR_ZONE_NUM = zonak szama
AR_ZONE_TEAM = bteteserol rushers-rol:
AR_ZONE_NEW = Uj zona ke'szite'se
AR_ZONE_DEL = torles az aktualis zona't
AR_ZONE_SAVE = Mente's 
AR_ZONE_EDIT = Zona'k szerkeszte'se
AR_ZONE_MAX = M_Antirusher *** *** max zonak szama elerte a
AR_ZONE_ZERO = M_Antirusher *** *** rush hatar torlese
AR_EDIT_COOR = Kordina'ta'k modosita'sa
AR_EDIT_CHANG = Valtas a

[en]
AR_NO_ZONE = Nincs Rush ezen mapon
AR_NO_FILE = A fajl nem letezik rush.cor
AR_CS_MAP = Cél: Terroristak vigyaznak tuszokra - CT megmentese a tuszokat
AR_DE_MAP = Cél: Teror lerak egy bombat - CT bomba hatastalanitja vagy megakadalyozza a lerakast
AR_FY_MAP = Cél: Olj meg minden ellenseget
AR_AIM_MAP = Cél: Olj meg minden ellenseget
AR_AWP_MAP = Cél: Olj meg minden ellense'get  AWP-vel
AR_KZ_MAP = Cél: A gyoztes jatekos a legtobb ellenseget oli meg
AR_FUN_MAP = Cél: Sok szerencse'T
AR_SURF_MAP = Cél: A gyoztes jatekos a legjobb szorf spedd, leghosszabb ugras,stb
AR_SJ_MAP = Cél: Az gyoz akinek a csapata  tobb golt lo
AR_KA_MAP = Cél: Olj meg minden ellenseget
AR_HE_MAP = Ce'l: Olj meg minden ellenseget  granatokkal
AR_INFO_WARN = *! FIGYELEM ! No Rush ! No Rush ! FIGYELEM ! *
AR_INFO_CLIENT = * Rush engedélyezve % .0  masodperc mulva *
AR_SRV_INFO =% s Jatekos atlepte a RUSH hatart !
AR_RASH_WARN = Atlepted a hatart!Tatrsd be a szerver szabalyait = tilos a RUSH !
AR_RASH_KICK = Atlepted a hatart! Buntetes = visszalokes.
AR_RASH_BAN = A'tle'pted a hata'rt!! Buntete's 5 percig.
AR_FREE_WORLD = *** Rush engedelye'zve *** SZABAD A RUSH ***
AR_ACTION_WARN = Csak figyelmeztete's
AR_ACTION_HP = HP levona's
AR_ACTION_KILL = Rusher megole'se
AR_ACTION_KICK =Kickeli a rusher-t
AR_ACTION_BAN = Banolja a rusher-t
AR_ACTION_SLOW = Lelassitja a rusher-t
AR_ACTION_BLIND = Beflasheli a rusher-t
AR_ACTION_FFILD = Szabad a rush!
AR_ACTION_OFIRE =Rusher megole'se
AR_ACTION_BAIM = ...
AR_ACTION_CASH = Pe'nzbuntete's
AR_ACTION_CASH2 = Pe'nzbuntetes
AR_ACTION_NEW = ---
AR_ZONE_NUM = zona'k sza'ma
AR_ZONE_TEAM =
AR_ZONE_NEW = Uj zona ke'szite'se
AR_ZONE_DEL = torles az aktualis zonat
AR_ZONE_SAVE = Ment's 
AR_ZONE_EDIT = Zona szerkeszte'se
AR_ZONE_MAX = M_Antirusher *** *** max zonak szama elerte a maximumot
AR_ZONE_ZERO = M_Antirusher *** *** rush hatar torlese
AR_EDIT_COOR = Cordina'ta'k modosita'sa
AR_EDIT_CHANG = Valtas a


Valaki ebbe a plugin rakja bele hogy a lang filebe lehessen ilyen szines cuccokat használni ^4 ^1 ^3 ha mellé irom szines legyen

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Rush szinesen
HozzászólásElküldve:2014.03.03. 01:20 
Offline
Jómunkásember
Avatar

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


Kód:
[hu]
AR_NO_ZONE = Nincs Rush ezen mapon
AR_NO_FILE = A fajl nem le'tezik rush.cor
AR_CS_MAP = Ce'l: Terroristak vigyaznak tuszokra - CT megmentese a tuszokat
AR_DE_MAP = Ce'l: Teror lerak egy bombat - CT bomba hatastalanitja vagy megakadalyozza a lerakast
AR_FY_MAP = Ce'l: Olj meg minden ellenseget
AR_AIM_MAP = Ce'l: Olj meg minden ellenseget
AR_AWP_MAP = Ce'l: Olj meg minden ellenséget  AWP-vel
AR_KZ_MAP = Ce'l: A gyoztes jatekos a legtobb ellenseget oli meg
AR_FUN_MAP = Ce'l: Have Fun!
AR_SURF_MAP = Ce'l: A gyoztes jatekos a legjobb szorf spedd, leghosszabb ugras,stb
AR_SJ_MAP = Ce'l: Az gyoz akinek a csapata  tobb golt lo
AR_KA_MAP = Ce'l: Olj meg minden ellenseget
AR_HE_MAP = Ce'l: Olj meg minden ellenseget  granatokkal
AR_INFO_WARN = [AntiRush]-No Rush|Figyelem No Rush
AR_INFO_CLIENT = * Rush engedelyezve %.0f masodperc mulva *
AR_SRV_INFO =% s Jatekos atlepte a RUSH hatart !
AR_RASH_WARN = Atlepted a hatart!Tatrsd be a szerver szabalyait = tilos a RUSH !
AR_RASH_KICK = Atlepted a hatart! Buntetes = visszalokes.
AR_RASH_BAN = Atlepted a hatart!! Bunteted 5 percig.
AR_FREE_WORLD = A Ct-k Rusholhatnak
AR_ACTION_WARN = !!!!!!!A rush hata'ron a'tmente'l!!!!!!!!
AR_ACTION_HP = Rusher HP levona'sa
AR_ACTION_KILL = Rusher megole'se
AR_ACTION_KICK = Rusher Kickele'se
AR_ACTION_BAN = Rusher Bannola'sa
AR_ACTION_SLOW = Lassú Rusher
AR_ACTION_BLIND = Rusher Beflashele'se
AR_ACTION_FFILD = Szabad a rush
AR_ACTION_OFIRE = Rusher megole'se
AR_ACTION_BAIM = Bad ce'lja Rusher
AR_ACTION_CASH = Rusher pe'nz buntete's
AR_ACTION_CASH2 = Rusher pe'nz buntetes
AR_ACTION_NEW = ---
AR_ZONE_NUM = zonak szama
AR_ZONE_TEAM = bteteserol rushers-rol:
AR_ZONE_NEW = Uj zona ke'szite'se
AR_ZONE_DEL = torles az aktualis zona't
AR_ZONE_SAVE = Mente's 
AR_ZONE_EDIT = Zona'k szerkeszte'se
AR_ZONE_MAX = M_Antirusher *** *** max zonak szama elerte a
AR_ZONE_ZERO = M_Antirusher *** *** rush hatar torlese
AR_EDIT_COOR = Kordina'ta'k modosita'sa
AR_EDIT_CHANG = Valtas a

[en]
AR_NO_ZONE = Nincs Rush ezen mapon
AR_NO_FILE = A fajl nem letezik rush.cor
AR_CS_MAP = Cél: Terroristak vigyaznak tuszokra - CT megmentese a tuszokat
AR_DE_MAP = Cél: Teror lerak egy bombat - CT bomba hatastalanitja vagy megakadalyozza a lerakast
AR_FY_MAP = Cél: Olj meg minden ellenseget
AR_AIM_MAP = Cél: Olj meg minden ellenseget
AR_AWP_MAP = Cél: Olj meg minden ellense'get  AWP-vel
AR_KZ_MAP = Cél: A gyoztes jatekos a legtobb ellenseget oli meg
AR_FUN_MAP = Cél: Sok szerencse'T
AR_SURF_MAP = Cél: A gyoztes jatekos a legjobb szorf spedd, leghosszabb ugras,stb
AR_SJ_MAP = Cél: Az gyoz akinek a csapata  tobb golt lo
AR_KA_MAP = Cél: Olj meg minden ellenseget
AR_HE_MAP = Ce'l: Olj meg minden ellenseget  granatokkal
AR_INFO_WARN = *! FIGYELEM ! No Rush ! No Rush ! FIGYELEM ! *
AR_INFO_CLIENT = * Rush engedélyezve % .0  masodperc mulva *
AR_SRV_INFO =% s Jatekos atlepte a RUSH hatart !
AR_RASH_WARN = Atlepted a hatart!Tatrsd be a szerver szabalyait = tilos a RUSH !
AR_RASH_KICK = Atlepted a hatart! Buntetes = visszalokes.
AR_RASH_BAN = A'tle'pted a hata'rt!! Buntete's 5 percig.
AR_FREE_WORLD = *** Rush engedelye'zve *** SZABAD A RUSH ***
AR_ACTION_WARN = Csak figyelmeztete's
AR_ACTION_HP = HP levona's
AR_ACTION_KILL = Rusher megole'se
AR_ACTION_KICK =Kickeli a rusher-t
AR_ACTION_BAN = Banolja a rusher-t
AR_ACTION_SLOW = Lelassitja a rusher-t
AR_ACTION_BLIND = Beflasheli a rusher-t
AR_ACTION_FFILD = Szabad a rush!
AR_ACTION_OFIRE =Rusher megole'se
AR_ACTION_BAIM = ...
AR_ACTION_CASH = Pe'nzbuntete's
AR_ACTION_CASH2 = Pe'nzbuntetes
AR_ACTION_NEW = ---
AR_ZONE_NUM = zona'k sza'ma
AR_ZONE_TEAM =
AR_ZONE_NEW = Uj zona ke'szite'se
AR_ZONE_DEL = torles az aktualis zonat
AR_ZONE_SAVE = Ment's 
AR_ZONE_EDIT = Zona szerkeszte'se
AR_ZONE_MAX = M_Antirusher *** *** max zonak szama elerte a maximumot
AR_ZONE_ZERO = M_Antirusher *** *** rush hatar torlese
AR_EDIT_COOR = Cordina'ta'k modosita'sa
AR_EDIT_CHANG = Valtas a


Valaki ebbe a plugin rakja bele hogy a lang filebe lehessen ilyen szines cuccokat használni ^4 ^1 ^3 ha mellé irom szines legyen




Bele raktam ,de nem biztos ,hogy jó-e szall kellene egy próba :)

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Rush szinesen
HozzászólásElküldve:2014.03.03. 09:03 
Offline
Jómunkásember

Csatlakozott:2013.02.11. 16:06
Hozzászólások:491
Megköszönt másnak: 96 alkalommal
Megköszönték neki: 50 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <engine>
  3. #include <fun>
  4. #include <cstrike>
  5. #include <amxmisc>
  6. #include <fakemeta>
  7. #include <colorchat> //Elég ennyit beleírni...
  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. }

_________________
Rengeteg új beszólás eléréséhez kattints IDE (Ezek alapból sank soundshoz készültek)

Steam profil:
[steam]http://steamcommunity.com/profiles/76561198089487307[/steam]


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


Ki van itt

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