#include #include #include #include #include #include new Float:TEST_TIME=0.1 new Float:WARN_TIME=1.0 new Float:FLASH_TIME=0.8 #define MAX_ZONES 8 new MIN_PLAYERS=2 /*Dobre do testowania w mniej osob lub gdy chcesz by koniec rashu byl przy wiekszej liczbbie osob*/ #define TASK_ZONE 600743 #define TASK_LOOP 500743 #define TASK_VIEW 400743 #define TASK_INFO 300743 #define TASK_FLASH 200743 new mUsuwaniestrefy // Menu new mcbUsuwaniestrefy // Menu Callback new mZapisacstrefy // Menu new mcbZapisacstrefy // Menu Callback new mAntirushControlMenu // Menu new mcbAntirushControlMenu // Menu Callback //Uzylem generatora i takie malo eleganckie wyszlo new map_cors_edit[MAX_ZONES*6] new zones_edit new zone_editing=0 new map_editor new map_cors_file_line=127 new zone_incresment=10 new zone_coords_num=0 new zone_coords[3][13] = { "Koordynat X", "Koordynat Y", "Koordynat Z"} new editign=0 new edit_g_team[3] new round_start=0 new lines new gMsgScreenFade new rasher[33]=0 new raszer[33] new flashed[33]=0 new sounded[33]=0 new speed_limit[33]=0 new Float:g_time new g_team[3] new g_origin[3] new map_cors_pre=2 new map_cors_origin[MAX_ZONES*6] new slap new warn_control = 0 // miczu new zones = 0 new zone_color_aktiv[3] = { 0, 0, 255 } new zone_color_red[3] = { 0, 255, 0 } new zone_color_yellow[3] = { 255, 255, 0 } new spr_dot new spr_dot1 new spr_dot2 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"} public plugin_init() { register_plugin("M_AntiRusher","2.5d","Miczu") log_amx(" <>") register_dictionary("M_antirusher.txt") register_dictionary("common.txt") register_clcmd("say /rules","info") register_clcmd("say /antirusher_menu","amx_antirusher_menu") register_cvar("Antirusher", "2.5d",FCVAR_SERVER) register_cvar("amx_antirusher","1") register_cvar("amx_antirusher_sound","1") register_cvar("amx_antirusher_sound_mode","0") register_cvar("amx_antirusher_warn","1") register_cvar("amx_antirusher_slap","3") register_cvar("amx_antirusher_time","60.0") register_cvar("amx_antirusher_freq","0.1") register_cvar("amx_antirusher_action","7") register_cvar("amx_antirusher_cash","50") register_cvar("amx_antirusher_cash_end","2") register_cvar("amx_antirusher_immunity","0") register_cvar("amx_antirusher_zasady","1") register_cvar("amx_antirusher_people","2") register_event("HLTV","Event_StartRound","a","1=0","2=0") register_event("RoundTime","event_roundtime","bc") register_event("SendAudio", "bomb_planted", "a", "2&%!MRAD_BOMBPL") register_event("DeathMsg","DeathMsg","ade") register_event("CurWeapon","CurWeapon","be") gMsgScreenFade = get_user_msgid("ScreenFade") map_cors_pre = map_cors_present(map_cors_origin,g_team) TEST_TIME=get_cvar_float("amx_antirusher_freq") register_menucmd(register_menuid("Antirush Menu"), 1023, "Antirush_menu") register_menucmd(register_menuid("Punishment Menu"), 1023, "Punishment_menu") register_menucmd(register_menuid("Antirush Zone Creator"), 1023, "Antirush_Zone_Creator") register_menucmd(register_menuid("Edit Zone"), 1023, "edit_zone2") mAntirushControlMenu = menu_create("Antirush Control Menu", "mh_AntirushControlMenu") mcbAntirushControlMenu = menu_makecallback("mcb_AntirushControlMenu") menu_additem(mAntirushControlMenu, "Antirush cvar control", "ma_AntirushControlMenu", ADMIN_CVAR, mcbAntirushControlMenu) menu_additem(mAntirushControlMenu, "Antirush Punishments", "ma_AntirushControlMenu", ADMIN_CVAR, mcbAntirushControlMenu) menu_additem(mAntirushControlMenu, "Antirush Zone Creator", "ma_AntirushControlMenu", ADMIN_RCON, mcbAntirushControlMenu) mZapisacstrefy = menu_create("Zapisac strefy", "mh_Zapisacstrefy") mcbZapisacstrefy = menu_makecallback("mcb_Zapisacstrefy") menu_additem(mZapisacstrefy, "TAK", "ma_Zapisacstrefy", ADMIN_ALL, mcbZapisacstrefy) menu_additem(mZapisacstrefy, "NIE", "ma_Zapisacstrefy", ADMIN_ALL, mcbZapisacstrefy) mUsuwaniestrefy = menu_create("Usuwanie strefy", "mh_Usuwaniestrefy") mcbUsuwaniestrefy = menu_makecallback("mcb_Usuwaniestrefy") menu_additem(mUsuwaniestrefy, "TAK", "ma_Usuwaniestrefy", ADMIN_ALL, mcbUsuwaniestrefy) menu_additem(mUsuwaniestrefy, "NIE", "ma_Usuwaniestrefy", ADMIN_ALL, mcbUsuwaniestrefy) require_module("fakemeta") require_module("engine") require_module("fun") require_module("cstrike") return PLUGIN_CONTINUE } public plugin_precache() { spr_dot = precache_model("sprites/strefa1.spr") spr_dot1 = precache_model("sprites/strefa2.spr") spr_dot2 = precache_model("sprites/strefa3.spr") } /////////////////////////////////////////////////////////////////////// ///////// M_Antirusher Events ///////// //////////////////////////////////////////////////////////////////////// public client_connect(id){ free_the_man(id) //nie chcemy by ktos kto sie polaczy byl karany } //kiedy osoba co opuszczajac serwer miala kare //czyli gdy stary i nowy gracz beda mieli te same id public client_disconnect(id) { free_the_man(id) //tak na wszelki wypadek, ale mozna sobie odpuscic return PLUGIN_CONTINUE } public Event_StartRound(){ round_start++ MIN_PLAYERS = get_cvar_num("amx_antirusher_people") // zmiana people dziala na starcie rundy } public client_putinserver(id){ //tu informacja o rashu new arg[1] //Zoptymalizowane uzycie set_task arg[0]=id //Deklaracja 1 kumurki pamieci zamiast 4 i bez zmian z str-> num i na odwrot if (map_cors_pre && get_cvar_num("amx_antirusher")) set_task(45.0,"informclient",TASK_INFO+id,arg,1) } public bomb_planted() { //podlozono bombe remove_task(TASK_LOOP) //przerywa sprawdzanie rashu remove_task(TASK_VIEW) //przerywa wyswietlanie granic dla userow free_the_world() //mozna rashowac } public event_roundtime() { if (round_start<1) return PLUGIN_CONTINUE //takie zabezpieczenie by nie sprawdzalo po czasie rashu if (map_cors_pre && get_cvar_num("amx_antirusher")) { slap = floatround(get_cvar_num("amx_antirusher_slap")*(10.0*TEST_TIME)) // slapy biora zawsze tyle samo hp w przedziale czasu remove_task(TASK_LOOP) remove_task(TASK_VIEW) g_time = get_gametime() + get_cvar_float("amx_antirusher_time") set_task(2*TEST_TIME, "checkOrigin",TASK_LOOP) set_task(2*WARN_TIME, "rash_warn",TASK_VIEW) } return PLUGIN_CONTINUE } // public DeathMsg(){ new vid = read_data(2) //id trupa free_the_man(vid) //uwalnia trupa by zaczol runde z czystym kontem } ////////////////////////////////////////////////////////////////////// ///////// M_Antirusher Things ///////// ////////////////////////////////////////////////////////////////////// map_cors_present(maporigin[MAX_ZONES*6],team[3]) { new zonefile[256],zonefile2[256] get_configsdir(zonefile, 255) if(is_linux_server()){ format(zonefile2, 255, "%s/antirusher", zonefile) if(!(dir_exists(zonefile2))) mkdir (zonefile2) format(zonefile2, 255, "%s/antirusher/rush.cor", zonefile) } else{ format(zonefile2, 255, "%s\antirusher", zonefile) if(!(dir_exists(zonefile2))) mkdir (zonefile2) format(zonefile2, 255, "%s\antirusher\rush.cor", zonefile) } if (file_exists(zonefile2)){ new readdata[512] new currentmap[32] get_mapname(currentmap,31) new map[32], len new x11[16],x12[16],y11[16],y12[16],z11[16],z12[16] new x21[16],x22[16],y21[16],y22[16],z21[16],z22[16] new x31[16],x32[16],y31[16],y32[16],z31[16],z32[16] new x41[16],x42[16],y41[16],y42[16],z41[16],z42[16] new x51[16],x52[16],y51[16],y52[16],z51[16],z52[16] new x61[16],x62[16],y61[16],y62[16],z61[16],z62[16] new x71[16],x72[16],y71[16],y72[16],z71[16],z72[16] new x81[16],x82[16],y81[16],y82[16],z81[16],z82[16] for(new i=0; i < 128 && read_file(zonefile2,i,readdata,511,len); i++) { x11="";x12="";y11="";y12="";z11="";z12="" x21="";x22="";y21="";y22="";z21="";z22="" x31="";x32="";y31="";y32="";z31="";z32="" x41="";x42="";y41="";y42="";z41="";z42="" x51="";x52="";y51="";y52="";z51="";z52="" x61="";x62="";y61="";y62="";z61="";z62="" parse(readdata,team,2,map,31,x11,15,x12,15,y11,15,y12,15,z11,15,z12,15, x21,15,x22,15,y21,15,y22,15,z21,15,z22,15, x31,15,x32,15,y31,15,y32,15,z31,15,z32,15, x41,15,x42,15,y41,15,y42,15,z41,15,z42,15, x51,15,x52,15,y51,15,y52,15,z51,15,z52,15, x61,15,x62,15,y61,15,y62,15,z61,15,z62,15, x71,15,x72,15,y71,15,y72,15,z71,15,z72,15, x81,15,x82,15,y81,15,y82,15,z81,15,z82,15) lines=i if(equal(map,currentmap)) { maporigin[0] = str_to_num(x11) maporigin[1] = str_to_num(x12) maporigin[2] = str_to_num(y11) maporigin[3] = str_to_num(y12) maporigin[4] = str_to_num(z11) maporigin[5] = str_to_num(z12) maporigin[6] = str_to_num(x21) maporigin[7] = str_to_num(x22) maporigin[8] = str_to_num(y21) maporigin[9] = str_to_num(y22) maporigin[10] = str_to_num(z21) maporigin[11] = str_to_num(z22) maporigin[12] = str_to_num(x31) maporigin[13] = str_to_num(x32) maporigin[14] = str_to_num(y31) maporigin[15] = str_to_num(y32) maporigin[16] = str_to_num(z31) maporigin[17] = str_to_num(z32) maporigin[18] = str_to_num(x41) maporigin[19] = str_to_num(x42) maporigin[20] = str_to_num(y41) maporigin[21] = str_to_num(y42) maporigin[22] = str_to_num(z41) maporigin[23] = str_to_num(z42) maporigin[24] = str_to_num(x51) maporigin[25] = str_to_num(x52) maporigin[26] = str_to_num(y51) maporigin[27] = str_to_num(y52) maporigin[28] = str_to_num(z51) maporigin[29] = str_to_num(z52) maporigin[30] = str_to_num(x61) maporigin[31] = str_to_num(x62) maporigin[32] = str_to_num(y61) maporigin[33] = str_to_num(y62) maporigin[34] = str_to_num(z61) maporigin[35] = str_to_num(z62) maporigin[36] = str_to_num(x71) maporigin[37] = str_to_num(x72) maporigin[38] = str_to_num(y71) maporigin[39] = str_to_num(y72) maporigin[40] = str_to_num(z71) maporigin[41] = str_to_num(z72) maporigin[42] = str_to_num(x81) maporigin[43] = str_to_num(x82) maporigin[44] = str_to_num(y81) maporigin[45] = str_to_num(y82) maporigin[46] = str_to_num(z81) maporigin[47] = str_to_num(z82) map_cors_file_line=i for(new j=0;j0)&&((maporigin[3+i]-maporigin[2+i])>0)&&((maporigin[5+i]-maporigin[4+i])>0)) zones++ } return 1 } if((len<15) && (map_cors_file_line>i)) map_cors_file_line=i } log_amx("%L",LANG_SERVER,"AR_NO_ZONE") if(lines+2 g_time) { free_the_world() return } new players[32], num,tt_num,ct_num get_players(players,num) for(new i=0;i g_time){ return } if (get_cvar_num("amx_antirusher_warn")==0) return new players[32], num, tt_num, ct_num get_players(players,num) for(new i=0;i(25/floatround(10.0*TEST_TIME))){ // jak dlugo siedzisz w granicy to ci pisze w czacie :p client_print(id, print_chat, "%L",LANG_PLAYER,"AR_RASH_WARN") warn_control=0;} warn_control+=1 if(get_cvar_num("amx_antirusher_sound")){ if(sounded[id]==0){ new sound_mode = get_cvar_num("amx_antirusher_sound_mode") if(sound_mode==0) client_cmd(id,"spk %s",actions[action]) else client_cmd(0,"spk %s",actions[action]) sounded[id]=1 } } } kickPlayer(id) { client_print(id, print_chat, "%L",LANG_PLAYER,"AR_RASH_KICK") client_print(id, print_chat, "%L",LANG_PLAYER,"AR_RASH_KICK") server_cmd("amx_kick #%d", id) } banPlayer(id) { client_print(id, print_chat, "%L",LANG_PLAYER,"AR_RASH_BAN") client_print(id, print_chat, "%L",LANG_PLAYER,"AR_RASH_BAN") server_cmd("amx_ban #%d 5 rush", id) } public CurWeapon(id){ if(speed_limit[id]==1) set_user_maxspeed(id,(get_user_maxspeed(id)/2.0)); // zmiana broni cie przyspieszy? nie ^^ } public Flash(id) { id-=TASK_FLASH if(flashed[id]){ set_task(FLASH_TIME,"Flash",TASK_FLASH+id) message_begin(MSG_ONE,gMsgScreenFade,{0,0,0},id) write_short( 1<<15 ) write_short( 1<<10 ) write_short( 1<<12 ) new x,y,z x= random_num(0,255) write_byte( x ) y= random_num(0,255) write_byte( y ) z= random_num(0,255) write_byte( z ) write_byte( 255 ) message_end() emit_sound(id,CHAN_BODY, "weapons/flashbang-2.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH) } } public client_PreThink(id){ if (rasher[id]){ new button = entity_get_int(id, EV_INT_button) if ((button & IN_ATTACK2) || (button & IN_ATTACK)){ user_silentkill(id) } } } public aim_on_me(id){ new radom, radom2 radom = random_num(0,3) radom2 = random_num(1,6) new polecenie[64] switch (radom){ case 0:{ format(polecenie, 63, "+left;") } case 1:{ format(polecenie, 63, "+right;") } case 2:{ format(polecenie, 63, "+lookup;") } case 3:{ format(polecenie, 63, "+lookdown;") } } for (new i=0; i < radom2; i++) { add(polecenie, 63, "wait;") } switch (radom) { case 0:{ add(polecenie, 63, "-left;") } case 1:{ add(polecenie, 63, "-right;") } case 2:{ add(polecenie, 63, "-lookup;") } case 3:{ add(polecenie, 63, "-lookdown;") } } client_cmd(id,"%s",polecenie) } ebay_time_to_pay(id){ new cash=get_cvar_num("amx_antirusher_cash")*floatround(10.0*TEST_TIME) new cash2=get_cvar_num("amx_antirusher_cash_end") new money = cs_get_user_money(id) if (money-cash > 0)cs_set_user_money(id,money-cash) else switch(cash2){ case 0: cs_set_user_money(id,0) case 1:{ fakedamage ( id, "rashing", cash/25.0,16384) } case 2:{ fakedamage ( id, "rashing", cash/10.0,16384) } case 3:{ fakedamage ( id, "rashing", cash/5.0,16384) } case 4:{ fakedamage ( id, "rashing", cash/2.0,16384) } case 5:{ fakedamage ( id, "rashing", cash/1.0,16384) } } } public free_the_man(id){ sounded[id]=0 rasher[id]=0 flashed[id]=0 raszer[id]=0 if(speed_limit[id]==1){ set_user_maxspeed(id,(get_user_maxspeed(id)*2.0)) speed_limit[id]=0 } } public free_the_world(){ if(round_start<1) return round_start=0 new players[32],num get_players(players,num,"a") for(new i;i0) zone_editing=1 show_all_zones() remove_task(TASK_ZONE) set_task(0.2, "show_all_zones", TASK_ZONE, _, _, "b") showmenu3(id) } } } public ma_AntirushControlMenu(id) {} // bo z generatora amxx studio public mcb_AntirushControlMenu(id, menu, item) {} // i usuniecie nie daje dobrych efektow... public transfer_zones(){ for(new i=0;i0){ keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<6)|(1<<7)|(1<<8) 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") } show_menu(id, keys, text) return PLUGIN_HANDLED } public Antirush_Zone_Creator(id, key) { if(map_editor!=id){ showmenu(id) return PLUGIN_HANDLED } switch(key) { case 0:{ if (equal(edit_g_team,"XX")) edit_g_team="CT" else if (equal(edit_g_team,"CT")) edit_g_team="T" else edit_g_team="XX" } case 1: { zone_incresment=10 edit_zone(id) return PLUGIN_HANDLED } case 2:{ if(zone_editing>1) zone_editing-- } case 3:{ if(zone_editing0){ menu_display(id, mUsuwaniestrefy, 0) return PLUGIN_HANDLED } else client_print(id, print_chat,"%L",LANG_SERVER,"AR_ZONE_ZERO") } case 7:{ menu_display(id, mZapisacstrefy, 0) return PLUGIN_HANDLED } case 8:{ amx_antirusher_menu(id) remove_task(TASK_ZONE) return PLUGIN_HANDLED } } showmenu3(id) return PLUGIN_HANDLED } public create_zone(id){ new origins[3] get_user_origin(id,origins,0) map_cors_edit[0+zones_edit*6]=origins[0]-32 map_cors_edit[1+zones_edit*6]=origins[0]+32 map_cors_edit[2+zones_edit*6]=origins[1]-32 map_cors_edit[3+zones_edit*6]=origins[1]+32 map_cors_edit[4+zones_edit*6]=origins[2]-32 map_cors_edit[5+zones_edit*6]=origins[2]+32 zones_edit++ } public mh_Zapisacstrefy(id, menu, item) { if(item==0){ remove_task(TASK_ZONE) amx_antirusher_menu(id) map_cors_origin=map_cors_edit zones=zones_edit g_team=edit_g_team if(zones>0) map_cors_pre=1 else map_cors_pre=0 write_to_file() } else if(item==1) showmenu3(id) } public ma_Zapisacstrefy(id) {} public mcb_Zapisacstrefy(id, menu, item) {} public mh_Usuwaniestrefy(id, menu, item) { if(item==0){ amx_antirusher_menu(id) delete_zone(zone_editing) if((zone_editing-1)>=(zones_edit-1)) zone_editing = zones_edit-1 zones_edit-- showmenu3(id) } else if(item==1) showmenu3(id) } public ma_Usuwaniestrefy(id) {} public mcb_Usuwaniestrefy(id, menu, item) {} public delete_zone(zone_num){ new x_num=zone_num-1 while(x_num<(MAX_ZONES-1)){ map_cors_edit[0+x_num*6]=map_cors_edit[6+x_num*6] map_cors_edit[1+x_num*6]=map_cors_edit[7+x_num*6] map_cors_edit[2+x_num*6]=map_cors_edit[8+x_num*6] map_cors_edit[3+x_num*6]=map_cors_edit[9+x_num*6] map_cors_edit[4+x_num*6]=map_cors_edit[10+x_num*6] map_cors_edit[5+x_num*6]=map_cors_edit[11+x_num*6] x_num++ } } public edit_zone(id){ editign=1 new text[512] new keys= (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<6)|(1<<8) 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") show_menu(id, keys, text) return PLUGIN_HANDLED } public edit_zone2(id, key){ switch(key){ case 0:{ if(zone_coords_num<2)zone_coords_num++ else zone_coords_num=0 } case 1:{ 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 } case 2:{ 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 } case 3:{ 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 } case 4:{ 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 } case 6:{ if(zone_incresment<1000)zone_incresment*=10 else zone_incresment=1 } case 8:{ showmenu3(id) return PLUGIN_HANDLED } } edit_zone(id) return PLUGIN_HANDLED } ////////////////////////////////////////////////////////////////////////// ///////// M_Antirusher Draw Lines ///////// ////////////////////////////////////////////////////////////////////////// public FX_Line(start[3], stop[3], color[3], brightness, id) { switch(random_num(1, 3)) { case 1: { message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id) write_byte( TE_BEAMPOINTS ) write_coord(start[0]) write_coord(start[1]) write_coord(start[2]) write_coord(stop[0]) write_coord(stop[1]) write_coord(stop[2]) write_short( spr_dot ) write_byte( 1 ) // framestart write_byte( 1 ) // framerate write_byte( 4 ) // life in 0.1's write_byte( 5 ) // width write_byte( 0 ) // noise write_byte( color[0] ) // r, g, b write_byte( color[1] ) // r, g, b write_byte( color[2] ) // r, g, b write_byte( brightness ) // brightness write_byte( 0 ) // speed message_end() } case 2: { message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id) write_byte( TE_BEAMPOINTS ) write_coord(start[0]) write_coord(start[1]) write_coord(start[2]) write_coord(stop[0]) write_coord(stop[1]) write_coord(stop[2]) write_short( spr_dot1 ) write_byte( 1 ) // framestart write_byte( 1 ) // framerate write_byte( 4 ) // life in 0.1's write_byte( 5 ) // width write_byte( 0 ) // noise write_byte( color[0] ) // r, g, b write_byte( color[1] ) // r, g, b write_byte( color[2] ) // r, g, b write_byte( brightness ) // brightness write_byte( 0 ) // speed message_end() } case 3: { message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id) write_byte( TE_BEAMPOINTS ) write_coord(start[0]) write_coord(start[1]) write_coord(start[2]) write_coord(stop[0]) write_coord(stop[1]) write_coord(stop[2]) write_short( spr_dot2 ) write_byte( 1 ) // framestart write_byte( 1 ) // framerate write_byte( 4 ) // life in 0.1's write_byte( 5 ) // width write_byte( 0 ) // noise write_byte( color[0] ) // r, g, b write_byte( color[1] ) // r, g, b write_byte( color[2] ) // r, g, b write_byte( brightness ) // brightness write_byte( 0 ) // speed message_end() } } } public DrawLine(x1, y1, z1, x2, y2, z2, color[3],id) { new start[3] new stop[3] start[0] = ( x1 ) start[1] = ( y1 ) start[2] = ( z1 ) stop[0] = ( x2 ) stop[1] = ( y2 ) stop[2] = ( z2 ) FX_Line(start, stop, color, 200, id) } public ar_zone(zone_num,id){ new start[3],stop[3] new xyz=0 if(zone_editing==zone_num) xyz=1 zone_num=(zone_num-1)*6 start[0]= map_cors_edit[0+zone_num] start[1]= map_cors_edit[2+zone_num] start[2]= map_cors_edit[4+zone_num] stop[0]= map_cors_edit[1+zone_num] stop[1]= map_cors_edit[3+zone_num] stop[2]= map_cors_edit[5+zone_num] ShowZoneBox(start, stop, id,xyz) } public ShowZoneBox(mins[3], maxs[3], id,xyz) { DrawLine(maxs[0], maxs[1], maxs[2], mins[0], maxs[1], maxs[2], zone_color_aktiv, id) DrawLine(maxs[0], maxs[1], maxs[2], maxs[0], mins[1], maxs[2], zone_color_aktiv, id) DrawLine(maxs[0], maxs[1], maxs[2], maxs[0], maxs[1], mins[2], zone_color_aktiv, id) DrawLine(mins[0], mins[1], mins[2], maxs[0], mins[1], mins[2], zone_color_aktiv, id) DrawLine(mins[0], mins[1], mins[2], mins[0], maxs[1], mins[2], zone_color_aktiv, id) DrawLine(mins[0], mins[1], mins[2], mins[0], mins[1], maxs[2], zone_color_aktiv, id) DrawLine(mins[0], maxs[1], maxs[2], mins[0], maxs[1], mins[2], zone_color_aktiv, id) DrawLine(mins[0], maxs[1], mins[2], maxs[0], maxs[1], mins[2], zone_color_aktiv, id) DrawLine(maxs[0], maxs[1], mins[2], maxs[0], mins[1], mins[2], zone_color_aktiv, id) DrawLine(maxs[0], mins[1], mins[2], maxs[0], mins[1], maxs[2], zone_color_aktiv, id) DrawLine(maxs[0], mins[1], maxs[2], mins[0], mins[1], maxs[2], zone_color_aktiv, id) DrawLine(mins[0], mins[1], maxs[2], mins[0], maxs[1], maxs[2], zone_color_aktiv, id) if((xyz==1)&&(editign==1)){ if(zone_coords_num==0){ DrawLine(maxs[0], maxs[1], maxs[2], maxs[0], mins[1], mins[2], zone_color_yellow, id) DrawLine(maxs[0], maxs[1], mins[2], maxs[0], mins[1], maxs[2], zone_color_yellow, id) DrawLine(mins[0], maxs[1], maxs[2], mins[0], mins[1], mins[2], zone_color_red, id) DrawLine(mins[0], maxs[1], mins[2], mins[0], mins[1], maxs[2], zone_color_red, id) } else if( zone_coords_num==1){ DrawLine(mins[0], mins[1], mins[2], maxs[0], mins[1], maxs[2], zone_color_red, id) DrawLine(maxs[0], mins[1], mins[2], mins[0], mins[1], maxs[2], zone_color_red, id) DrawLine(mins[0], maxs[1], mins[2], maxs[0], maxs[1], maxs[2], zone_color_yellow, id) DrawLine(maxs[0], maxs[1], mins[2], mins[0], maxs[1], maxs[2], zone_color_yellow, id) } else{ DrawLine(maxs[0], maxs[1], maxs[2], mins[0], mins[1], maxs[2], zone_color_yellow, id) DrawLine(maxs[0], mins[1], maxs[2], mins[0], maxs[1], maxs[2], zone_color_yellow, id) DrawLine(maxs[0], maxs[1], mins[2], mins[0], mins[1], mins[2], zone_color_red, id) DrawLine(maxs[0], mins[1], mins[2], mins[0], maxs[1], mins[2], zone_color_red, id) } } } public show_all_zones(){ new num=1 while(num<=zones_edit){ ar_zone(num,map_editor) num++ } if(zone_editing>0){ new origins[3], origins2[3] get_user_origin(map_editor,origins) new Float: range_line new Float: range_origins[6] for(new i=0;i<6;i++) range_origins[i] = (map_cors_edit[i+6*(zone_editing-1)])*1.0 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])) if(range_line>20000) for(new i=0;i<3;i++){ origins2[i]=((map_cors_edit[i*2+6*(zone_editing-1)] + map_cors_edit[i*2+1+6*(zone_editing-1)])/2)/6 } else if(range_line>15000) for(new i=0;i<3;i++){ origins2[i]=((map_cors_edit[i*2+6*(zone_editing-1)] + map_cors_edit[i*2+1+6*(zone_editing-1)])/2)/5 } else if(range_line>10000) for(new i=0;i<3;i++){ origins2[i]=((map_cors_edit[i*2+6*(zone_editing-1)] + map_cors_edit[i*2+1+6*(zone_editing-1)])/2)/3 } else for(new i=0;i<3;i++){ origins2[i]=((map_cors_edit[i*2+6*(zone_editing-1)] + map_cors_edit[i*2+1+6*(zone_editing-1)])/2) } FX_Line(origins, origins2, zone_color_red,200,map_editor) } } public zone_warn(id,zone,direction,origins[3]){ new start[3],stop[3] start[2]=origins[2]-110 stop[2]=origins[2]-110 switch(direction){ case 0:{ start[0]=map_cors_origin[zone*6]+5 stop[0]=map_cors_origin[zone*6]+5 start[1]=map_cors_origin[zone*6+2] stop[1]=map_cors_origin[zone*6+3] } case 1:{ start[0]=map_cors_origin[zone*6+1]-5 stop[0]=map_cors_origin[zone*6+1]-5 start[1]=map_cors_origin[zone*6+2] stop[1]=map_cors_origin[zone*6+3] } case 2:{ start[0]=map_cors_origin[zone*6+0] stop[0]=map_cors_origin[zone*6+1] start[1]=map_cors_origin[zone*6+2]+5 stop[1]=map_cors_origin[zone*6+2]+5 } case 3:{ start[0]=map_cors_origin[zone*6+0] stop[0]=map_cors_origin[zone*6+1] start[1]=map_cors_origin[zone*6+3]-5 stop[1]=map_cors_origin[zone*6+3]-5 } } for(new i=0;i<9;i++){ start[2]+=30 stop[2]+=30 FX_Line(start, stop, zone_color_red, 60, id) } } /////////////////////////////////////////////////////////////////////////// ///////// M_Antirusher Save to file ///////// /////////////////////////////////////////////////////////////////////////// public write_to_file(){ new text[512],text2[64] new currentmap[32] get_mapname(currentmap,31) format(text,511,"%s %s ", g_team, currentmap) new x0[6],x1[6],y0[6],y1[6],z0[6],z1[6] for(new i=0;i>") } else{ if((write_file ( "addons\amxmodx\configs\antirusher\rush.cor", text, map_cors_file_line ))==0) log_amx("<>") } }