hlmod.hu

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



Jelenlévő felhasználók

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

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

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

Sziasztok!
Annyit kéne megcsinálni hogy tudjam szinezni a langot pl hogy irja Rush engedélyzve 60 másodpercmulva és azt zöldel vagy igy....
Vagy a pluginba valaki irja bele :D

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Rush szinezése...
HozzászólásElküldve: 2015.01.19. 20:42 
Offline
Beavatott
Avatar

Csatlakozott: 2015.01.15. 22:08
Hozzászólások: 99
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 15 alkalommal
Lang színezés

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


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

Nem engedi átt rakni amxx re nézzed meg kérlek :/

_________________
Kép


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


Ki van itt

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