hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.06.16. 07:43



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: Bing [Bot], Google [Bot] az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 4 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Antirush kicsit másképp
HozzászólásElküldve: 2012.05.17. 08:24 
Offline
Őstag
Avatar

Csatlakozott: 2010.04.16. 16:50
Hozzászólások: 1342
Megköszönt másnak: 42 alkalommal
Megköszönték neki: 58 alkalommal
Sziasztok ! azt szeretném kérni, hogy az antirush-t úgy átkéne írni, hogy az minél kevésbé fogja a szervert !! És a felesleges dolgokat ellehetne belőle távolítani !! Mint pl a pénz,és az élet levonást is! nekem elég lenne ha benne maradna a visszalökés és a halál ! A másik amit szeretnék változtatni benne, hogy a lézer sűrűbben legyen mert most elég ritka ahogy van szerintem ! És ha még lehetne és megtudja valaki írni azt, hogy a lézer villogása már távolról is látszódjon ! Az utolsó amit kérnék az a visszalökés bug kiküszöbölése !! Tudjuk, hogy ha visszalökésre van állítva az ellenőrzés akkor 2-3 próbálkozás után átlehet menni rajta !! na ezt nagyon jó lenne javítani !
Aki fáradozik vele és idejét rászánja annak hálásan köszönöm !!!
Kód:
  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   // Lézer villogásának idököze

  10. new Float:FLASH_TIME=0.8

  11.  

  12. #define MAX_ZONES 8

  13. new MIN_PLAYERS=2              

  14.  

  15. #define TASK_ZONE 600743

  16. #define TASK_LOOP 500743

  17. #define TASK_VIEW 400743

  18. #define TASK_INFO 300743

  19. #define TASK_FLASH 200743

  20.  

  21. new mUsuwaniestrefy // Menu

  22. new mcbUsuwaniestrefy // Menu Callback

  23. new mZapisacstrefy // Menu

  24. new mcbZapisacstrefy // Menu Callback

  25. new mAntirushControlMenu // Menu

  26. new mcbAntirushControlMenu // Menu Callback

  27.  

  28. new map_cors_edit[MAX_ZONES*6]

  29. new zones_edit

  30. new zone_editing=0

  31. new map_editor

  32. new map_cors_file_line=127

  33. new zone_incresment=10

  34. new zone_coords_num=0

  35. new zone_coords[3][13] = { "Koordynat X", "Koordynat Y", "Koordynat Z"}

  36. new editign=0

  37. new edit_g_team[3]

  38. new round_start=0

  39. new lines

  40.  

  41. new gMsgScreenFade

  42. new rasher[33]=0

  43. new raszer[33]

  44. new flashed[33]=0

  45. new sounded[33]=0

  46. new speed_limit[33]=0

  47. new Float:g_time

  48. new g_team[3]

  49. new g_origin[3]

  50. new map_cors_pre=2

  51. new map_cors_origin[MAX_ZONES*6]

  52. new slap

  53. new warn_control = 0 // miczu

  54. new zones = 0

  55.  

  56. new zone_color_aktiv[3] = { 0, 0, 255 }

  57. new zone_color_red[3] = { 0, 255, 0 }

  58. new zone_color_yellow[3] = { 255, 255, 0 }

  59. new spr_dot

  60.  

  61. 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"}

  62.                                        

  63. public plugin_init()

  64. {      

  65.         register_plugin("M_AntiRusher","2.5d","Miczu")

  66.         log_amx(" <<Uruchomiono M_Antirusher 2.5d>>")

  67.                

  68.         register_dictionary("M_antirusher.txt")

  69.         register_dictionary("common.txt")

  70.        

  71.         register_clcmd("say /rush","info")

  72.         register_clcmd("say /antirusher_menu","amx_antirusher_menu")

  73.                

  74.         register_cvar("Antirusher", "2.5d",FCVAR_SERVER)

  75.         register_cvar("amx_antirusher","1")                    

  76.         register_cvar("amx_antirusher_sound","1")              

  77.         register_cvar("amx_antirusher_sound_mode","0")

  78.         register_cvar("amx_antirusher_warn","1")

  79.         register_cvar("amx_antirusher_slap","3")               

  80.         register_cvar("amx_antirusher_time","60.0")            

  81.         register_cvar("amx_antirusher_freq","0.4")

  82.         register_cvar("amx_antirusher_action","7")

  83.         register_cvar("amx_antirusher_cash","50")              

  84.         register_cvar("amx_antirusher_cash_end","2")           

  85.         register_cvar("amx_antirusher_immunity","0")   

  86.         register_cvar("amx_antirusher_zasady","1")

  87.         register_cvar("amx_antirusher_people","2")

  88.        

  89.         register_event("HLTV","Event_StartRound","a","1=0","2=0")

  90.         register_event("RoundTime","event_roundtime","bc")

  91.         register_event("SendAudio", "bomb_planted", "a", "2&%!MRAD_BOMBPL")

  92.         register_event("DeathMsg","DeathMsg","ade")

  93.         register_event("CurWeapon","CurWeapon","be")

  94.        

  95.         gMsgScreenFade = get_user_msgid("ScreenFade")

  96.         map_cors_pre = map_cors_present(map_cors_origin,g_team)

  97.         TEST_TIME=get_cvar_float("amx_antirusher_freq")

  98.        

  99.         register_menucmd(register_menuid("Antirush Menu"), 1023, "Antirush_menu")

  100.         register_menucmd(register_menuid("Punishment Menu"), 1023, "Punishment_menu")

  101.         register_menucmd(register_menuid("Antirush Zone Creator"), 1023, "Antirush_Zone_Creator")

  102.         register_menucmd(register_menuid("Edit Zone"), 1023, "edit_zone2")

  103.        

  104.         mAntirushControlMenu = menu_create("Antirush Control Menu", "mh_AntirushControlMenu")

  105.         mcbAntirushControlMenu = menu_makecallback("mcb_AntirushControlMenu")

  106.         menu_additem(mAntirushControlMenu, "Antirush cvar control", "ma_AntirushControlMenu", ADMIN_CVAR, mcbAntirushControlMenu)

  107.         menu_additem(mAntirushControlMenu, "Antirush Punishments", "ma_AntirushControlMenu", ADMIN_CVAR, mcbAntirushControlMenu)

  108.         menu_additem(mAntirushControlMenu, "Antirush Zone Creator", "ma_AntirushControlMenu", ADMIN_RCON, mcbAntirushControlMenu)

  109.        

  110.         mZapisacstrefy = menu_create("Zapisac strefy", "mh_Zapisacstrefy")

  111.         mcbZapisacstrefy = menu_makecallback("mcb_Zapisacstrefy")

  112.         menu_additem(mZapisacstrefy, "TAK", "ma_Zapisacstrefy", ADMIN_ALL, mcbZapisacstrefy)

  113.         menu_additem(mZapisacstrefy, "NIE", "ma_Zapisacstrefy", ADMIN_ALL, mcbZapisacstrefy)

  114.        

  115.         mUsuwaniestrefy = menu_create("Usuwanie strefy", "mh_Usuwaniestrefy")

  116.         mcbUsuwaniestrefy = menu_makecallback("mcb_Usuwaniestrefy")

  117.         menu_additem(mUsuwaniestrefy, "TAK", "ma_Usuwaniestrefy", ADMIN_ALL, mcbUsuwaniestrefy)

  118.         menu_additem(mUsuwaniestrefy, "NIE", "ma_Usuwaniestrefy", ADMIN_ALL, mcbUsuwaniestrefy)

  119.        

  120.         require_module("fakemeta")

  121.        

  122.         require_module("engine")

  123.         require_module("fun")

  124.         require_module("cstrike")

  125.        

  126.         return PLUGIN_CONTINUE

  127. }

  128.  

  129. public plugin_precache() {

  130.         spr_dot = precache_model("sprites/dot.spr") // potrzebne do robienia lini

  131. }

  132.  

  133. ///////////////////////////////////////////////////////////////////////

  134. /////////                M_Antirusher  Events                 /////////

  135. ////////////////////////////////////////////////////////////////////////

  136.  

  137. public client_connect(id){

  138.         free_the_man(id)                //nie chcemy by ktos kto sie polaczy byl karany

  139. }                                       //kiedy osoba co opuszczajac serwer miala kare

  140.                                         //czyli gdy stary i nowy gracz beda mieli te same id

  141.  

  142. public client_disconnect(id) {

  143.         free_the_man(id)                //tak na wszelki wypadek, ale mozna sobie odpuscic

  144.         return PLUGIN_CONTINUE

  145. }

  146.  

  147. public Event_StartRound(){

  148.         round_start++                          

  149.         MIN_PLAYERS = get_cvar_num("amx_antirusher_people")     // zmiana people dziala na starcie rundy

  150. }

  151.  

  152. public client_putinserver(id){          //tu informacja o rashu

  153.         new arg[1]                      //Zoptymalizowane uzycie set_task

  154.         arg[0]=id                       //Deklaracja 1 kumurki pamieci zamiast 4 i bez zmian z str-> num i na odwrot

  155.                

  156.         if (map_cors_pre && get_cvar_num("amx_antirusher"))

  157.                 set_task(45.0,"informclient",TASK_INFO+id,arg,1)

  158. }

  159.  

  160. public bomb_planted() {                 //podlozono bombe

  161.         remove_task(TASK_LOOP)          //przerywa sprawdzanie rashu

  162.         remove_task(TASK_VIEW)          //przerywa wyswietlanie granic dla userow      

  163.         free_the_world()                //mozna rashowac

  164. }

  165.  

  166. public event_roundtime() {

  167.         if (round_start<1) return PLUGIN_CONTINUE       //takie zabezpieczenie by nie sprawdzalo po czasie rashu

  168.         if (map_cors_pre && get_cvar_num("amx_antirusher")) {

  169.                 slap = floatround(get_cvar_num("amx_antirusher_slap")*(10.0*TEST_TIME)) // slapy biora zawsze tyle samo hp w przedziale czasu

  170.                 remove_task(TASK_LOOP)

  171.                 remove_task(TASK_VIEW)

  172.                 g_time = get_gametime() + get_cvar_float("amx_antirusher_time")

  173.                 set_task(2*TEST_TIME, "checkOrigin",TASK_LOOP)

  174.                 set_task(2*WARN_TIME, "rash_warn",TASK_VIEW)

  175.  

  176.         }

  177.         return PLUGIN_CONTINUE

  178. }                                       //

  179.  

  180. public DeathMsg(){

  181.         new vid = read_data(2)          //id trupa

  182.         free_the_man(vid)               //uwalnia trupa by zaczol runde z czystym kontem

  183. }

  184.  

  185. //////////////////////////////////////////////////////////////////////

  186. /////////                M_Antirusher Things                 /////////

  187. //////////////////////////////////////////////////////////////////////

  188.  

  189. map_cors_present(maporigin[MAX_ZONES*6],team[3]) {

  190.        

  191.         new zonefile[256],zonefile2[256]

  192.        

  193.         get_configsdir(zonefile, 255)

  194.        

  195.         if(is_linux_server()){

  196.                 format(zonefile2, 255, "%s/antirusher", zonefile)

  197.                 if(!(dir_exists(zonefile2))) mkdir (zonefile2)

  198.                 format(zonefile2, 255, "%s/antirusher/rush.cor", zonefile)

  199.         }

  200.         else{

  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.        

  206.         if (file_exists(zonefile2)){   

  207.                

  208.                 new readdata[512]

  209.                 new currentmap[32]

  210.                 get_mapname(currentmap,31)

  211.                 new map[32], len

  212.                 new x11[16],x12[16],y11[16],y12[16],z11[16],z12[16]

  213.                 new x21[16],x22[16],y21[16],y22[16],z21[16],z22[16]

  214.                 new x31[16],x32[16],y31[16],y32[16],z31[16],z32[16]

  215.                 new x41[16],x42[16],y41[16],y42[16],z41[16],z42[16]

  216.                 new x51[16],x52[16],y51[16],y52[16],z51[16],z52[16]

  217.                 new x61[16],x62[16],y61[16],y62[16],z61[16],z62[16]

  218.                 new x71[16],x72[16],y71[16],y72[16],z71[16],z72[16]

  219.                 new x81[16],x82[16],y81[16],y82[16],z81[16],z82[16]

  220.                

  221.                

  222.                 for(new i=0; i < 128 && read_file(zonefile2,i,readdata,511,len); i++) {

  223.                         x11="";x12="";y11="";y12="";z11="";z12=""

  224.                         x21="";x22="";y21="";y22="";z21="";z22=""

  225.                         x31="";x32="";y31="";y32="";z31="";z32=""

  226.                         x41="";x42="";y41="";y42="";z41="";z42=""

  227.                         x51="";x52="";y51="";y52="";z51="";z52=""

  228.                         x61="";x62="";y61="";y62="";z61="";z62=""

  229.                         parse(readdata,team,2,map,31,x11,15,x12,15,y11,15,y12,15,z11,15,z12,15,

  230.                                 x21,15,x22,15,y21,15,y22,15,z21,15,z22,15,

  231.                                 x31,15,x32,15,y31,15,y32,15,z31,15,z32,15,

  232.                                 x41,15,x42,15,y41,15,y42,15,z41,15,z42,15,

  233.                                 x51,15,x52,15,y51,15,y52,15,z51,15,z52,15,

  234.                                 x61,15,x62,15,y61,15,y62,15,z61,15,z62,15,

  235.                                 x71,15,x72,15,y71,15,y72,15,z71,15,z72,15,

  236.                                 x81,15,x82,15,y81,15,y82,15,z81,15,z82,15)

  237.                         lines=i

  238.                         if(equal(map,currentmap)) {

  239.                                 maporigin[0] = str_to_num(x11)

  240.                                 maporigin[1] = str_to_num(x12)

  241.                                 maporigin[2] = str_to_num(y11)

  242.                                 maporigin[3] = str_to_num(y12)

  243.                                 maporigin[4] = str_to_num(z11)

  244.                                 maporigin[5] = str_to_num(z12)

  245.                                 maporigin[6] = str_to_num(x21)

  246.                                 maporigin[7] = str_to_num(x22)

  247.                                 maporigin[8] = str_to_num(y21)

  248.                                 maporigin[9] = str_to_num(y22)

  249.                                 maporigin[10] = str_to_num(z21)

  250.                                 maporigin[11] = str_to_num(z22)

  251.                                 maporigin[12] = str_to_num(x31)

  252.                                 maporigin[13] = str_to_num(x32)

  253.                                 maporigin[14] = str_to_num(y31)

  254.                                 maporigin[15] = str_to_num(y32)

  255.                                 maporigin[16] = str_to_num(z31)

  256.                                 maporigin[17] = str_to_num(z32)

  257.                                 maporigin[18] = str_to_num(x41)

  258.                                 maporigin[19] = str_to_num(x42)

  259.                                 maporigin[20] = str_to_num(y41)

  260.                                 maporigin[21] = str_to_num(y42)

  261.                                 maporigin[22] = str_to_num(z41)

  262.                                 maporigin[23] = str_to_num(z42)

  263.                                 maporigin[24] = str_to_num(x51)

  264.                                 maporigin[25] = str_to_num(x52)

  265.                                 maporigin[26] = str_to_num(y51)

  266.                                 maporigin[27] = str_to_num(y52)

  267.                                 maporigin[28] = str_to_num(z51)

  268.                                 maporigin[29] = str_to_num(z52)

  269.                                 maporigin[30] = str_to_num(x61)

  270.                                 maporigin[31] = str_to_num(x62)

  271.                                 maporigin[32] = str_to_num(y61)

  272.                                 maporigin[33] = str_to_num(y62)

  273.                                 maporigin[34] = str_to_num(z61)

  274.                                 maporigin[35] = str_to_num(z62)

  275.                                 maporigin[36] = str_to_num(x71)

  276.                                 maporigin[37] = str_to_num(x72)

  277.                                 maporigin[38] = str_to_num(y71)

  278.                                 maporigin[39] = str_to_num(y72)

  279.                                 maporigin[40] = str_to_num(z71)

  280.                                 maporigin[41] = str_to_num(z72)

  281.                                 maporigin[42] = str_to_num(x81)

  282.                                 maporigin[43] = str_to_num(x82)

  283.                                 maporigin[44] = str_to_num(y81)

  284.                                 maporigin[45] = str_to_num(y82)

  285.                                 maporigin[46] = str_to_num(z81)

  286.                                 maporigin[47] = str_to_num(z82)

  287.                                

  288.                                 map_cors_file_line=i

  289.                                 for(new j=0;j<MAX_ZONES;j++){

  290.                                         i=j*6

  291.                                         if(((maporigin[1+i]-maporigin[0+i])>0)&&((maporigin[3+i]-maporigin[2+i])>0)&&((maporigin[5+i]-maporigin[4+i])>0))

  292.                                         zones++

  293.                                 }

  294.                                

  295.                                 return 1

  296.                         }

  297.                         if((len<15)  && (map_cors_file_line>i)) map_cors_file_line=i

  298.                 }

  299.                 log_amx("%L",LANG_SERVER,"AR_NO_ZONE")

  300.                 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 :)

  301.                 return 0

  302.         }

  303.         else log_amx("%L",LANG_SERVER,"AR_NO_FILE")

  304.         g_team="XX"

  305.         map_cors_file_line=0                    //nie ma pluku rush,cor wiec niech zapisze w pierwszej lini

  306.         return 0

  307. }

  308.  

  309.  

  310. public info(id){

  311.         new anti_zasady = get_cvar_num("amx_antirusher_zasady")

  312.         if(anti_zasady==1){

  313.                 new map[4]

  314.                 get_mapname(map,3)              // rozpoznawanie typu mapy na podstawie pierwszych 3 liter :p

  315.                

  316.                 if (equal(map,"cs_")) client_print(id,print_chat, "%L",LANG_PLAYER,"AR_CS_MAP")

  317.                 else if (equal(map,"de_")) client_print(id,print_chat, "%L",LANG_PLAYER,"AR_DE_MAP")

  318.                 else if (equal(map,"fy_")) client_print(id,print_chat, "%L",LANG_PLAYER,"AR_FY_MAP")

  319.                 else if (equal(map,"aim")) client_print(id,print_chat, "%L",LANG_PLAYER,"AR_AIM_MAP")

  320.                 else if (equal(map,"awp")) client_print(id,print_chat, "%L",LANG_PLAYER,"AR_AWP_MAP")

  321.                 else if (equal(map,"kz_")) client_print(id,print_chat, "%L",LANG_PLAYER,"AR_KZ_MAP")

  322.                 else if (equal(map,"fun")) client_print(id,print_chat, "%L",LANG_PLAYER,"AR_FUN_MAP")

  323.                 else if (equal(map,"sur")) client_print(id,print_chat, "%L",LANG_PLAYER,"AR_SURF_MAP")

  324.                 else if (equal(map,"sj_")) client_print(id,print_chat, "%L",LANG_PLAYER,"AR_SJ_MAP")

  325.                 else if (equal(map,"ka_")) client_print(id,print_chat, "%L",LANG_PLAYER,"AR_KA_MAP")

  326.                 else if (equal(map,"he_")) client_print(id,print_chat, "%L",LANG_PLAYER,"AR_HE_MAP")

  327.         }

  328. }

  329.  

  330. public informclient(arg[1]){

  331.                                         // arg[0] to id ^^

  332.         if(is_user_connected(arg[0])) { // spradza czy gracz nadal jest na serwie

  333.                 client_print(arg[0],print_chat,"%L",LANG_PLAYER,"AR_INFO_WARN")

  334.                 client_print(arg[0],print_chat,"%L",LANG_PLAYER,"AR_INFO_CLIENT",get_cvar_float("amx_antirusher_time"))

  335.         }

  336. }

  337.  

  338.  

  339. public checkOrigin() {                  // tu sprawdza czy rashujesz

  340.        

  341.         if (round_start<1) return

  342.         if (get_gametime() > g_time)

  343.         {

  344.                 free_the_world()

  345.                 return

  346.         }

  347.        

  348.         new players[32], num,tt_num,ct_num

  349.         get_players(players,num)

  350.        

  351.         for(new i=0;i<num;i++)

  352.         {

  353.                 if(is_user_alive(players[i]))

  354.                 {

  355.                         if(cs_get_user_team(players[i])==CS_TEAM_T) tt_num++

  356.                         else if(cs_get_user_team(players[i])==CS_TEAM_CT) ct_num++

  357.                 }

  358.         }

  359.        

  360.         if (tt_num<MIN_PLAYERS)

  361.         {

  362.                 free_the_world()

  363.                 return

  364.         }

  365.         if (ct_num<MIN_PLAYERS)

  366.         {

  367.                 free_the_world()

  368.                 return

  369.         }

  370.        

  371.        

  372.         get_players(players,num)

  373.         set_task(TEST_TIME, "checkOrigin", TASK_LOOP)

  374.         for(new i = 0; i < num; i++)

  375.         {

  376.                 if(is_user_alive(players[i]))

  377.                 {

  378.                         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"))

  379.                         {      

  380.                                 get_user_origin(players[i],g_origin)

  381.                                 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]) ||

  382.                                         (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]) ||

  383.                                         (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]) ||

  384.                                         (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]) ||

  385.                                         (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]) ||

  386.                                         (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])){

  387.                                         punishPlayer(players[i])

  388.                                         raszer[players[i]]=1

  389.                                 }

  390.                                 else{

  391.                                         free_the_man(players[i])

  392.                                 }

  393.                         }

  394.                 }

  395.         }

  396. }

  397.  

  398. public rash_warn(){                             // tu sprawsza czy ma ci wyswietlic granice rashu

  399.         if (get_gametime() > g_time){

  400.                 return

  401.         }

  402.         if (get_cvar_num("amx_antirusher_warn")==0) return

  403.         new players[32], num, tt_num, ct_num

  404.         get_players(players,num)

  405.        

  406.         for(new i=0;i<num;i++)

  407.         {

  408.                 if(is_user_alive(players[i]))

  409.                 {

  410.                         if(cs_get_user_team(players[i])==CS_TEAM_T) tt_num++

  411.                         else if(cs_get_user_team(players[i])==CS_TEAM_CT) ct_num++

  412.                 }

  413.         }

  414.        

  415.         if (equal(g_team,"CT")){

  416.                 if (tt_num<MIN_PLAYERS) return

  417.                 if (ct_num<MIN_PLAYERS) return

  418.         }

  419.        

  420.         set_task(WARN_TIME, "rash_warn",TASK_VIEW)

  421.        

  422.         new orrigins[3]

  423.         for(new j=0;j<num;j++){

  424.                 if(raszer[players[j]]<1 && is_user_alive(players[j]))    // jak juz raszuje to mozna graczowi odpuscic :)

  425.                 {              

  426.                         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"))

  427.                         {      

  428.                                 get_user_origin(players[j],orrigins)

  429.                                 for(new i=0;i<MAX_ZONES;i++){

  430.                                         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])){

  431.                                                 zone_warn(players[j],i,0,orrigins)

  432.                                         }

  433.                                         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])){

  434.                                                 zone_warn(players[j],i,1,orrigins)

  435.                                         }

  436.                                         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])){

  437.                                                 zone_warn(players[j],i,2,orrigins)

  438.                                         }

  439.                                         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])){

  440.                                                 zone_warn(players[j],i,3,orrigins)

  441.                                         }

  442.                                 }                       // nigdy nie bedziesz widzial przednia i tylna lub lewa i prawa sciane rownoczesnie wiec jest else

  443.  

  444.                         }

  445.                 }

  446.         }

  447. }

  448.  

  449. ///////////////////////////////////////////////////////////////////////////

  450. /////////                M_Antirusher Punishments                 /////////

  451. ///////////////////////////////////////////////////////////////////////////

  452.  

  453. punishPlayer(id) {

  454.                                

  455.         new action = 1

  456.         action = get_cvar_num("amx_antirusher_action") 

  457.         if ((get_cvar_num("amx_antirusher_immunity") == 1)&&(get_user_flags(id)&ADMIN_IMMUNITY)) {

  458.                 action = 0

  459.         }

  460.         switch (action) {

  461.                 case 0:{

  462.                 new name[32]

  463.                 get_user_name(id,name,31)

  464.                 server_cmd("amx_chat %L",LANG_SERVER,"AR_SRV_INFO", name)

  465.                 }

  466.                 case 1: fakedamage ( id, "rashing", slap*1.0,16384)

  467.                 case 2: user_silentkill(id)

  468.                 case 3: kickPlayer(id)

  469.                 case 4: banPlayer(id)

  470.                 case 5:{

  471.                         if(speed_limit[id]==0){

  472.                                 speed_limit[id]=1

  473.                                 set_user_maxspeed(id,(get_user_maxspeed(id)/2.0));

  474.                         }

  475.                 }

  476.                 case 6:{

  477.                         if(flashed[id]==0){

  478.                                 flashed[id]=1

  479.                                 set_task(FLASH_TIME,"Flash",TASK_FLASH+id)

  480.                         }

  481.                 }

  482.                 case 7:{

  483.                         new Float: velocity[3]

  484.                         new Float: DW //Długosc wektora

  485.                         entity_get_vector(id,EV_VEC_velocity,velocity)

  486.                         DW=vector_length ( velocity )+0.0001

  487.                         velocity[0]=(velocity[0]/DW)*(-950.0)

  488.                         velocity[1]=(velocity[1]/DW)*(-950.0)

  489.                         if(velocity[2]<0) velocity[2]=velocity[2]*(-1.0)+15.0 //wyrzuca do gory

  490.                         entity_set_vector(id,EV_VEC_velocity,velocity) 

  491.                 }

  492.                 case 8:{

  493.                         rasher[id]=1

  494.                 }

  495.                 case 9:{

  496.                         aim_on_me(id)

  497.                 }

  498.                 case 10:{

  499.                         ebay_time_to_pay(id)    // ogladalem filmik w flashu i to chyba przez to :p

  500.                 }

  501.                 default:{

  502.                         new name[32]

  503.                         get_user_name(id,name,31)

  504.                         server_cmd("amx_chat %L:p",LANG_SERVER,"AR_SRV_INFO", name)

  505.                 }

  506.         }

  507.         if (warn_control >(25/floatround(10.0*TEST_TIME))){     // jak dlugo siedzisz w granicy to ci pisze w czacie :p

  508.         client_print(id, print_chat, "%L",LANG_PLAYER,"AR_RASH_WARN")

  509.         warn_control=0;}

  510.         warn_control+=1

  511.  

  512.         if(get_cvar_num("amx_antirusher_sound")){

  513.                 if(sounded[id]==0){

  514.                 new sound_mode = get_cvar_num("amx_antirusher_sound_mode")

  515.                

  516.                 if(sound_mode==0) client_cmd(id,"spk %s",actions[action])

  517.                 else client_cmd(0,"spk %s",actions[action])

  518.                 sounded[id]=1

  519.                 }              

  520.         }

  521. }

  522.  

  523. kickPlayer(id) {

  524.         client_print(id, print_chat, "%L",LANG_PLAYER,"AR_RASH_KICK")

  525.         client_print(id, print_chat, "%L",LANG_PLAYER,"AR_RASH_KICK")

  526.         server_cmd("amx_kick #%d", id)

  527. }

  528.  

  529. banPlayer(id) {

  530.         client_print(id, print_chat, "%L",LANG_PLAYER,"AR_RASH_BAN")

  531.         client_print(id, print_chat, "%L",LANG_PLAYER,"AR_RASH_BAN")

  532.         server_cmd("amx_ban #%d 5 rush", id)

  533. }

  534.  

  535. public CurWeapon(id){

  536.         if(speed_limit[id]==1) set_user_maxspeed(id,(get_user_maxspeed(id)/2.0));       // zmiana broni cie przyspieszy? nie ^^

  537. }

  538.  

  539. public Flash(id) {

  540.         id-=TASK_FLASH

  541.         if(flashed[id]){

  542.                 set_task(FLASH_TIME,"Flash",TASK_FLASH+id)

  543.        

  544.                 message_begin(MSG_ONE,gMsgScreenFade,{0,0,0},id)

  545.                 write_short( 1<<15 )

  546.                 write_short( 1<<10 )

  547.                 write_short( 1<<12 )

  548.                 new x,y,z

  549.                 x= random_num(0,255)

  550.                 write_byte( x )

  551.                 y= random_num(0,255)

  552.                 write_byte( y )

  553.                 z= random_num(0,255)

  554.                 write_byte( z )

  555.                 write_byte( 255 )

  556.                 message_end()

  557.                 emit_sound(id,CHAN_BODY, "weapons/flashbang-2.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH)

  558.         }

  559. }

  560.  

  561. public client_PreThink(id){    

  562.         if (rasher[id]){

  563.                 new button = entity_get_int(id, EV_INT_button)

  564.                 if ((button & IN_ATTACK2) || (button & IN_ATTACK)){

  565.                         user_silentkill(id)

  566.                 }

  567.         }      

  568. }

  569.  

  570. public aim_on_me(id){

  571.         new radom, radom2

  572.         radom = random_num(0,3)

  573.         radom2 = random_num(1,6)

  574.         new polecenie[64]

  575.         switch (radom){

  576.                 case 0:{

  577.                         format(polecenie, 63, "+left;")

  578.                 }

  579.                 case 1:{

  580.                         format(polecenie, 63, "+right;")

  581.                 }

  582.                 case 2:{

  583.                         format(polecenie, 63, "+lookup;")

  584.                 }

  585.                 case 3:{

  586.                         format(polecenie, 63, "+lookdown;")

  587.                 }

  588.         }

  589.        

  590.         for (new i=0; i < radom2; i++)

  591.         {

  592.                 add(polecenie, 63, "wait;")

  593.         }

  594.        

  595.         switch (radom) {

  596.                 case 0:{

  597.                         add(polecenie, 63, "-left;")

  598.                 }

  599.                 case 1:{

  600.                         add(polecenie, 63, "-right;")

  601.                 }

  602.                 case 2:{

  603.                         add(polecenie, 63, "-lookup;")

  604.                 }

  605.                 case 3:{

  606.                         add(polecenie, 63, "-lookdown;")

  607.                 }

  608.         }

  609.         client_cmd(id,"%s",polecenie)

  610. }

  611.  

  612. ebay_time_to_pay(id){

  613.         new cash=get_cvar_num("amx_antirusher_cash")*floatround(10.0*TEST_TIME)

  614.         new cash2=get_cvar_num("amx_antirusher_cash_end")

  615.         new money = cs_get_user_money(id)

  616.         if (money-cash > 0)cs_set_user_money(id,money-cash)

  617.         else switch(cash2){

  618.                 case 0:         cs_set_user_money(id,0)

  619.                 case 1:{

  620.                         fakedamage ( id, "rashing", cash/25.0,16384)

  621.                 }

  622.                 case 2:{

  623.                         fakedamage ( id, "rashing", cash/10.0,16384)

  624.                 }      

  625.                 case 3:{

  626.                         fakedamage ( id, "rashing", cash/5.0,16384)

  627.                 }

  628.                 case 4:{

  629.                         fakedamage ( id, "rashing", cash/2.0,16384)

  630.                 }

  631.                 case 5:{

  632.                         fakedamage ( id, "rashing", cash/1.0,16384)

  633.                 }

  634.         }

  635. }

  636.  

  637. public free_the_man(id){

  638.         sounded[id]=0

  639.         rasher[id]=0

  640.         flashed[id]=0

  641.         raszer[id]=0

  642.         if(speed_limit[id]==1){

  643.                 set_user_maxspeed(id,(get_user_maxspeed(id)*2.0))

  644.                 speed_limit[id]=0

  645.         }

  646. }

  647.  

  648. public free_the_world(){

  649.         if(round_start<1) return

  650.         round_start=0

  651.         new players[32],num

  652.         get_players(players,num,"a")

  653.         for(new i;i<num;i++){

  654. free_the_man(players[i])

  655. message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, players[i])

  656. write_byte(players[i])

  657. write_string("^x04 Rush engedelyezve - Most mar mehet a rush !!!")

  658. message_end()

  659. set_hudmessage(42, 255, 255, -1.0, 0.23, 0, 6.0, 6.0)

  660. show_hudmessage(players[i], "Mehet a Rush !")

  661.         }

  662. }

  663.  

  664. ///////////////////////////////////////////////////////////////////////

  665. /////////                 M_Antirusher Menu's                 /////////

  666. ///////////////////////////////////////////////////////////////////////

  667.  

  668. public amx_antirusher_menu(id){

  669.         menu_display(id, mAntirushControlMenu, 0)

  670. }

  671.  

  672. public mh_AntirushControlMenu(id, menu, item) {

  673.         switch(item)

  674.         {

  675.                 case 0: {

  676.                         showmenu(id)

  677.                 }

  678.                 case 1: {

  679.                         showmenu2(id)

  680.                 }

  681.                 case 2: {

  682.                        

  683.                         map_editor=id

  684.                         edit_g_team=g_team

  685.                         transfer_zones()

  686.                         zones_edit=zones

  687.                         if(zones>0) zone_editing=1

  688.                         show_all_zones()

  689.                         remove_task(TASK_ZONE)

  690.                         set_task(0.2, "show_all_zones", TASK_ZONE, _, _, "b")

  691.                         showmenu3(id)

  692.                 }

  693.         }                      

  694. }

  695.  

  696. public ma_AntirushControlMenu(id) {}                    // bo z generatora amxx studio

  697. public mcb_AntirushControlMenu(id, menu, item) {}       // i usuniecie nie daje dobrych efektow...

  698.  

  699. public transfer_zones(){

  700.         for(new i=0;i<MAX_ZONES*6;i++){

  701.         map_cors_edit[i]=map_cors_origin[i]

  702.         }

  703. }

  704.  

  705. public showmenu(id)

  706. {

  707.         new text[512]

  708.         new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)

  709.         new anti_on = get_cvar_num("amx_antirusher")                            //1

  710.         new anti_immu = get_cvar_num("amx_antirusher_immunity")                 //2

  711.         new Float: anti_time = get_cvar_float("amx_antirusher_time")            //3

  712.         new anti_warn = get_cvar_num("amx_antirusher_warn")                     //4

  713.         new anti_sound = get_cvar_num("amx_antirusher_sound")                   //5

  714.         new anti_sound_mode = get_cvar_num("amx_antirusher_sound_mode")         //6

  715.         new anti_zasady = get_cvar_num("amx_antirusher_zasady")                 //7

  716.         new people = get_cvar_num("amx_antirusher_people")                      //8

  717.         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")

  718.        

  719.         show_menu(id, keys, text)

  720.         return PLUGIN_HANDLED  

  721. }

  722.  

  723.  

  724. public Antirush_menu(id, key)

  725. {

  726.         switch(key)

  727.         {

  728.                 case 0:{       

  729.                         new anti_on = get_cvar_num("amx_antirusher")

  730.                         if (anti_on==0) set_cvar_num("amx_antirusher",1)

  731.                         else set_cvar_num("amx_antirusher",0)

  732.                 }

  733.                 case 1:{       

  734.                         new anti_immu = get_cvar_num("amx_antirusher_immunity")

  735.                         if (anti_immu==0) set_cvar_num("amx_antirusher_immunity",1)

  736.                         else set_cvar_num("amx_antirusher_immunity",0)

  737.                 }

  738.                 case 2:{       

  739.                         new Float: anti_time = get_cvar_float("amx_antirusher_time")

  740.                         if (anti_time < (get_cvar_float("mp_roundtime")*60.0)) anti_time += 5.0

  741.                         else anti_time= 10.0

  742.                         set_cvar_float("amx_antirusher_time",anti_time)

  743.                 }

  744.                 case 3:{

  745.                         new anti_warn = get_cvar_num("amx_antirusher_warn")

  746.                         if (anti_warn==0) set_cvar_num("amx_antirusher_warn",1)

  747.                         else set_cvar_num("amx_antirusher_warn",0)

  748.                 }

  749.                 case 4:{

  750.                         new anti_sound = get_cvar_num("amx_antirusher_sound")

  751.                         if (anti_sound==0) set_cvar_num("amx_antirusher_sound",1)

  752.                         else set_cvar_num("amx_antirusher_sound",0)

  753.                 }

  754.                 case 5:{

  755.                         new anti_sound_mode = get_cvar_num("amx_antirusher_sound_mode")

  756.                         if (anti_sound_mode==0) set_cvar_num("amx_antirusher_sound_mode",1)

  757.                         else set_cvar_num("amx_antirusher_sound_mode",0)

  758.                 }

  759.                 case 6:{               

  760.                         new anti_zasady = get_cvar_num("amx_antirusher_zasady")

  761.                         if (anti_zasady==0) set_cvar_num("amx_antirusher_zasady",1)

  762.                         else set_cvar_num("amx_antirusher_zasady",0)

  763.                 }

  764.                 case 7:{               

  765.                         new people = get_cvar_num("amx_antirusher_people")

  766.                         if (people<16) set_cvar_num("amx_antirusher_people",people+1)

  767.                         else set_cvar_num("amx_antirusher_people",0)

  768.                 }              

  769.                 case 8:{

  770.                         menu_display(id, mAntirushControlMenu, 0)

  771.                         return PLUGIN_HANDLED

  772.                 }              

  773.         }

  774.         showmenu(id)

  775.         return PLUGIN_HANDLED

  776. }

  777.  

  778. public showmenu2(id)

  779. {

  780.         new keys

  781.         new text[512]

  782.         new anti_action = get_cvar_num("amx_antirusher_action")                                

  783.         new anti_cash = get_cvar_num("amx_antirusher_cash")*10         

  784.         new anti_cash_end = get_cvar_num("amx_antirusher_cash_end")                            

  785.         new Float: anti_freq = get_cvar_float("amx_antirusher_freq")

  786.         new anti_slap = get_cvar_num("amx_antirusher_slap")*10

  787.        

  788.         switch(anti_action)

  789.         {

  790.                 case 1:

  791.                 {

  792.                         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)

  793.                         keys = (1<<0)|(1<<1)|(1<<3)|(1<<8)

  794.                 }

  795.                 case 10:

  796.                 {

  797.                         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)

  798.                         keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<8)

  799.                 }

  800.                 default:

  801.                 {

  802.                         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)

  803.                         keys = (1<<0)|(1<<3)|(1<<8)

  804.                 }

  805.         }

  806.         new text2[512]

  807.         switch(anti_action)

  808.         {

  809.                 case 0: format(text2,511, "^n\w %L ^n\w ^n\w9. %L",LANG_SERVER,"AR_ACTION_WARN",LANG_SERVER,"EXIT")

  810.                 case 1: format(text2,511, "^n\w %L ^n\w ^n\w9. %L",LANG_SERVER,"AR_ACTION_HP",LANG_SERVER,"EXIT")

  811.                 case 2: format(text2,511, "^n\w %L ^n\w ^n\w9. %L",LANG_SERVER,"AR_ACTION_KILL",LANG_SERVER,"EXIT")

  812.                 case 3: format(text2,511, "^n\w %L ^n\w ^n\w9. %L",LANG_SERVER,"AR_ACTION_KICK",LANG_SERVER,"EXIT")

  813.                 case 4: format(text2,511, "^n\w %L ^n\w ^n\w9. %L",LANG_SERVER,"AR_ACTION_BAN",LANG_SERVER,"EXIT")

  814.                 case 5: format(text2,511, "^n\w %L ^n\w ^n\w9. %L",LANG_SERVER,"AR_ACTION_SLOW",LANG_SERVER,"EXIT")

  815.                 case 6: format(text2,511, "^n\w %L ^n\w ^n\w9. %L",LANG_SERVER,"AR_ACTION_BLIND",LANG_SERVER,"EXIT")

  816.                 case 7: format(text2,511, "^n\w %L ^n\w ^n\w9. %L",LANG_SERVER,"AR_ACTION_FFILD",LANG_SERVER,"EXIT")

  817.                 case 8: format(text2,511, "^n\w %L ^n\w ^n\w9. %L",LANG_SERVER,"AR_ACTION_OFIRE",LANG_SERVER,"EXIT")

  818.                 case 9: format(text2,511, "^n\w %L ^n\w ^n\w9. %L",LANG_SERVER,"AR_ACTION_BAIM",LANG_SERVER,"EXIT")

  819.                 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")

  820.                 default:format(text2,511, "^n\w %L ^n\w ^n\w9. %L",LANG_SERVER,"AR_ACTION_NEW",LANG_SERVER,"EXIT")

  821.         }

  822.         add(text,511,text2)

  823.         show_menu(id, keys, text)

  824.         return PLUGIN_HANDLED  

  825. }

  826.  

  827. public Punishment_menu(id, key)

  828. {

  829.         new anti_action = get_cvar_num("amx_antirusher_action")

  830.         switch(key)

  831.         {

  832.                 case 0:

  833.                 {      

  834.                         if(anti_action<10) anti_action +=1

  835.                         else anti_action=0

  836.                         set_cvar_num("amx_antirusher_action",anti_action)

  837.                 }

  838.                 case 1:

  839.                 {      

  840.                         if(anti_action==1)

  841.                         {

  842.                                 new anti_slap = get_cvar_num("amx_antirusher_slap")

  843.                                 if(anti_slap<10) anti_slap +=1

  844.                                 else anti_slap=0

  845.                                 set_cvar_num("amx_antirusher_slap",anti_slap)

  846.                         }

  847.                         else if(anti_action==10)

  848.                         {

  849.                                 new anti_cash = get_cvar_num("amx_antirusher_cash")

  850.                                 if(anti_cash<100) anti_cash +=10

  851.                                 else if(anti_cash<500) anti_cash +=25

  852.                                 else anti_cash=0

  853.                                 set_cvar_num("amx_antirusher_cash",anti_cash)

  854.                         }

  855.                 }

  856.                 case 2:

  857.                 {      

  858.                         new anti_cash_end = get_cvar_num("amx_antirusher_cash_end")    

  859.                         if(anti_cash_end<5) anti_cash_end +=1

  860.                         else anti_cash_end=0

  861.                         set_cvar_num("amx_antirusher_cash_end",anti_cash_end)

  862.                 }

  863.                 case 3:

  864.                 {      

  865.                         new Float: anti_freq = get_cvar_float("amx_antirusher_freq")   

  866.                         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

  867.                         else if (anti_freq<8.0) anti_freq +=0.5

  868.                         else anti_freq=0.1

  869.                         set_cvar_float("amx_antirusher_freq",anti_freq)

  870.                 }              

  871.                 case 8:

  872.                 {

  873.                         menu_display(id, mAntirushControlMenu, 0)

  874.                         return PLUGIN_HANDLED

  875.                 }              

  876.         }

  877.         showmenu2(id)

  878.         return PLUGIN_HANDLED

  879. }

  880.  

  881. public showmenu3(id)

  882. {

  883.         editign=0

  884.         new text[512]

  885.         new keys

  886.         if(zones_edit==0){

  887.                 keys = (1<<0)|(1<<4)|(1<<6)|(1<<7)|(1<<8)

  888.                 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")

  889.         }

  890.         else if(zones_edit>0){

  891.                 keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(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\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")

  893.         }      

  894.                

  895.         show_menu(id, keys, text)

  896.         return PLUGIN_HANDLED

  897. }

  898.  

  899.  

  900. public Antirush_Zone_Creator(id, key)

  901. {

  902.         if(map_editor!=id){

  903.                 showmenu(id)

  904.                 return PLUGIN_HANDLED

  905.         }

  906.                

  907.         switch(key)

  908.         {

  909.                 case 0:{

  910.                         if (equal(edit_g_team,"XX")) edit_g_team="CT"

  911.                         else if (equal(edit_g_team,"CT")) edit_g_team="T"

  912.                         else edit_g_team="XX"

  913.                 }

  914.                 case 1: {      

  915.                         zone_incresment=10

  916.                         edit_zone(id)

  917.                         return PLUGIN_HANDLED

  918.                 }

  919.                 case 2:{       

  920.                         if(zone_editing>1) zone_editing--

  921.                 }

  922.                 case 3:{       

  923.                         if(zone_editing<zones_edit) zone_editing++

  924.                 }

  925.                 case 4:{

  926.                         if(zones_edit<(MAX_ZONES)){

  927.                                 create_zone(id)

  928.                                 zone_editing=zones_edit

  929.                                 zone_incresment=10

  930.                                 edit_zone(id)

  931.                                 return PLUGIN_HANDLED

  932.                         }

  933.                         else{

  934.                                 client_print(id, print_chat,"%L",LANG_SERVER,"AR_ZONE_MAX")

  935.                         }

  936.                 }

  937.                 case 6:{

  938.                         if(zone_editing>0){

  939.                                 menu_display(id, mUsuwaniestrefy, 0)

  940.                                 return PLUGIN_HANDLED

  941.                         }

  942.                         else client_print(id, print_chat,"%L",LANG_SERVER,"AR_ZONE_ZERO")

  943.                 }

  944.  

  945.                 case 7:{

  946.                         menu_display(id, mZapisacstrefy, 0)

  947.                         return PLUGIN_HANDLED

  948.                 }

  949.                 case 8:{

  950.                         amx_antirusher_menu(id)

  951.                         remove_task(TASK_ZONE)

  952.                         return PLUGIN_HANDLED

  953.                 }              

  954.         }

  955.         showmenu3(id)

  956.         return PLUGIN_HANDLED

  957. }

  958.  

  959. public create_zone(id){

  960.         new origins[3]

  961.         get_user_origin(id,origins,0)

  962.         map_cors_edit[0+zones_edit*6]=origins[0]-32

  963.         map_cors_edit[1+zones_edit*6]=origins[0]+32

  964.         map_cors_edit[2+zones_edit*6]=origins[1]-32

  965.         map_cors_edit[3+zones_edit*6]=origins[1]+32

  966.         map_cors_edit[4+zones_edit*6]=origins[2]-32

  967.         map_cors_edit[5+zones_edit*6]=origins[2]+32

  968.         zones_edit++

  969. }

  970.  

  971.  

  972. public mh_Zapisacstrefy(id, menu, item) {

  973.         if(item==0){

  974.                 remove_task(TASK_ZONE)

  975.                 amx_antirusher_menu(id)

  976.                 map_cors_origin=map_cors_edit

  977.                 zones=zones_edit

  978.                 g_team=edit_g_team

  979.                 if(zones>0) map_cors_pre=1

  980.                 else map_cors_pre=0

  981.                 write_to_file()

  982.         }

  983.         else if(item==1) showmenu3(id)

  984. }

  985.  

  986. public ma_Zapisacstrefy(id) {}

  987. public mcb_Zapisacstrefy(id, menu, item) {}

  988.  

  989.  

  990. public mh_Usuwaniestrefy(id, menu, item) {

  991.         if(item==0){

  992.                 amx_antirusher_menu(id)

  993.                 delete_zone(zone_editing)

  994.                 if((zone_editing-1)>=(zones_edit-1)) zone_editing = zones_edit-1

  995.                 zones_edit--

  996.                 showmenu3(id)

  997.         }

  998.         else if(item==1) showmenu3(id)

  999. }

  1000.  

  1001. public ma_Usuwaniestrefy(id) {}

  1002. public mcb_Usuwaniestrefy(id, menu, item) {}

  1003.  

  1004. public delete_zone(zone_num){

  1005.         new x_num=zone_num-1

  1006.         while(x_num<(MAX_ZONES-1)){

  1007.                 map_cors_edit[0+x_num*6]=map_cors_edit[6+x_num*6]

  1008.                 map_cors_edit[1+x_num*6]=map_cors_edit[7+x_num*6]

  1009.                 map_cors_edit[2+x_num*6]=map_cors_edit[8+x_num*6]

  1010.                 map_cors_edit[3+x_num*6]=map_cors_edit[9+x_num*6]

  1011.                 map_cors_edit[4+x_num*6]=map_cors_edit[10+x_num*6]

  1012.                 map_cors_edit[5+x_num*6]=map_cors_edit[11+x_num*6]

  1013.                 x_num++

  1014.         }

  1015. }

  1016.  

  1017. public edit_zone(id){

  1018.         editign=1

  1019.         new text[512]

  1020.         new keys= (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<6)|(1<<8)

  1021.         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")      

  1022.                

  1023.         show_menu(id, keys, text)

  1024.         return PLUGIN_HANDLED

  1025. }

  1026.  

  1027. public edit_zone2(id, key){    

  1028.         switch(key){

  1029.                 case 0:{       

  1030.                         if(zone_coords_num<2)zone_coords_num++

  1031.                         else zone_coords_num=0

  1032.                 }

  1033.                 case 1:{       

  1034.                         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

  1035.                 }

  1036.                 case 2:{       

  1037.                         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

  1038.                 }

  1039.                 case 3:{

  1040.                         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

  1041.                 }

  1042.                 case 4:{       

  1043.                         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

  1044.                 }

  1045.                 case 6:{

  1046.                         if(zone_incresment<1000)zone_incresment*=10

  1047.                         else zone_incresment=1

  1048.                 }

  1049.                 case 8:{

  1050.                         showmenu3(id)

  1051.                         return PLUGIN_HANDLED

  1052.                 }              

  1053.         }

  1054.         edit_zone(id)

  1055.         return PLUGIN_HANDLED

  1056. }

  1057.  

  1058. //////////////////////////////////////////////////////////////////////////

  1059. /////////                 M_Antirusher Draw Lines                /////////

  1060. //////////////////////////////////////////////////////////////////////////

  1061.  

  1062. public FX_Line(start[3], stop[3], color[3], brightness, id) {

  1063.         message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id)

  1064.        

  1065.         write_byte( TE_BEAMPOINTS )

  1066.        

  1067.         write_coord(start[0])

  1068.         write_coord(start[1])

  1069.         write_coord(start[2])

  1070.        

  1071.         write_coord(stop[0])

  1072.         write_coord(stop[1])

  1073.         write_coord(stop[2])

  1074.        

  1075.         write_short( spr_dot )

  1076.        

  1077.         write_byte( 1 ) // framestart

  1078.         write_byte( 1 ) // framerate

  1079.         write_byte( 4 ) // life in 0.1's

  1080.         write_byte( 5 ) // width

  1081.         write_byte( 0 )         // noise

  1082.        

  1083.         write_byte( color[0] )   // r, g, b

  1084.         write_byte( color[1] )   // r, g, b

  1085.         write_byte( color[2] )   // r, g, b

  1086.        

  1087.         write_byte( brightness )        // brightness

  1088.         write_byte( 0 )         // speed

  1089.        

  1090.         message_end()

  1091. }

  1092.  

  1093. public DrawLine(x1, y1, z1, x2, y2, z2, color[3],id) {

  1094.         new start[3]

  1095.         new stop[3]

  1096.        

  1097.         start[0] = ( x1 )

  1098.         start[1] = ( y1 )

  1099.         start[2] = ( z1 )

  1100.        

  1101.         stop[0] = ( x2 )

  1102.         stop[1] = ( y2 )

  1103.         stop[2] = ( z2 )

  1104.  

  1105.         FX_Line(start, stop, color, 200, id)

  1106. }

  1107.  

  1108. public ar_zone(zone_num,id){

  1109.         new start[3],stop[3]

  1110.         new xyz=0

  1111.         if(zone_editing==zone_num) xyz=1

  1112.        

  1113.         zone_num=(zone_num-1)*6

  1114.  

  1115.         start[0]= map_cors_edit[0+zone_num]

  1116.         start[1]= map_cors_edit[2+zone_num]

  1117.         start[2]= map_cors_edit[4+zone_num]

  1118.        

  1119.         stop[0]= map_cors_edit[1+zone_num]

  1120.         stop[1]= map_cors_edit[3+zone_num]

  1121.         stop[2]= map_cors_edit[5+zone_num]

  1122.        

  1123.         ShowZoneBox(start, stop, id,xyz)

  1124. }

  1125.  

  1126. public ShowZoneBox(mins[3], maxs[3], id,xyz) {

  1127.                

  1128.         DrawLine(maxs[0], maxs[1], maxs[2], mins[0], maxs[1], maxs[2], zone_color_aktiv, id)

  1129.         DrawLine(maxs[0], maxs[1], maxs[2], maxs[0], mins[1], maxs[2], zone_color_aktiv, id)

  1130.         DrawLine(maxs[0], maxs[1], maxs[2], maxs[0], maxs[1], mins[2], zone_color_aktiv, id)

  1131.  

  1132.         DrawLine(mins[0], mins[1], mins[2], maxs[0], mins[1], mins[2], zone_color_aktiv, id)

  1133.         DrawLine(mins[0], mins[1], mins[2], mins[0], maxs[1], mins[2], zone_color_aktiv, id)

  1134.         DrawLine(mins[0], mins[1], mins[2], mins[0], mins[1], maxs[2], zone_color_aktiv, id)

  1135.  

  1136.         DrawLine(mins[0], maxs[1], maxs[2], mins[0], maxs[1], mins[2], zone_color_aktiv, id)

  1137.         DrawLine(mins[0], maxs[1], mins[2], maxs[0], maxs[1], mins[2], zone_color_aktiv, id)

  1138.         DrawLine(maxs[0], maxs[1], mins[2], maxs[0], mins[1], mins[2], zone_color_aktiv, id)

  1139.         DrawLine(maxs[0], mins[1], mins[2], maxs[0], mins[1], maxs[2], zone_color_aktiv, id)

  1140.         DrawLine(maxs[0], mins[1], maxs[2], mins[0], mins[1], maxs[2], zone_color_aktiv, id)

  1141.         DrawLine(mins[0], mins[1], maxs[2], mins[0], maxs[1], maxs[2], zone_color_aktiv, id)

  1142.        

  1143.         if((xyz==1)&&(editign==1)){

  1144.                 if(zone_coords_num==0){

  1145.                         DrawLine(maxs[0], maxs[1], maxs[2], maxs[0], mins[1], mins[2], zone_color_yellow, id)

  1146.                         DrawLine(maxs[0], maxs[1], mins[2], maxs[0], mins[1], maxs[2], zone_color_yellow, id)

  1147.                         DrawLine(mins[0], maxs[1], maxs[2], mins[0], mins[1], mins[2], zone_color_red, id)

  1148.                         DrawLine(mins[0], maxs[1], mins[2], mins[0], mins[1], maxs[2], zone_color_red, id)

  1149.                 }

  1150.                 else if( zone_coords_num==1){

  1151.                         DrawLine(mins[0], mins[1], mins[2], maxs[0], mins[1], maxs[2], zone_color_red, id)

  1152.                         DrawLine(maxs[0], mins[1], mins[2], mins[0], mins[1], maxs[2], zone_color_red, id)

  1153.                         DrawLine(mins[0], maxs[1], mins[2], maxs[0], maxs[1], maxs[2], zone_color_yellow, id)

  1154.                         DrawLine(maxs[0], maxs[1], mins[2], mins[0], maxs[1], maxs[2], zone_color_yellow, id)

  1155.                 }

  1156.                 else{

  1157.                         DrawLine(maxs[0], maxs[1], maxs[2], mins[0], mins[1], maxs[2], zone_color_yellow, id)

  1158.                         DrawLine(maxs[0], mins[1], maxs[2], mins[0], maxs[1], maxs[2], zone_color_yellow, id)

  1159.                         DrawLine(maxs[0], maxs[1], mins[2], mins[0], mins[1], mins[2], zone_color_red, id)

  1160.                         DrawLine(maxs[0], mins[1], mins[2], mins[0], maxs[1], mins[2], zone_color_red, id)

  1161.                 }

  1162.         }

  1163. }

  1164.  

  1165. public show_all_zones(){

  1166.         new num=1

  1167.         while(num<=zones_edit){

  1168.                 ar_zone(num,map_editor)

  1169.                 num++

  1170.         }

  1171.         if(zone_editing>0){

  1172.                 new origins[3], origins2[3]

  1173.                 get_user_origin(map_editor,origins)

  1174.                 new Float: range_line

  1175.                 new Float: range_origins[6]

  1176.                 for(new i=0;i<6;i++) range_origins[i] = (map_cors_edit[i+6*(zone_editing-1)])*1.0

  1177.                 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]))

  1178.                 if(range_line>20000) for(new i=0;i<3;i++){

  1179.                         origins2[i]=((map_cors_edit[i*2+6*(zone_editing-1)] + map_cors_edit[i*2+1+6*(zone_editing-1)])/2)/6

  1180.                 }

  1181.                 else if(range_line>15000) 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)/5

  1183.                 }

  1184.                 else if(range_line>10000) 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)/3

  1186.                 }

  1187.                 else 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)

  1189.                 }

  1190.                 FX_Line(origins, origins2, zone_color_red,200,map_editor)

  1191.         }

  1192. }

  1193.  

  1194. public zone_warn(id,zone,direction,origins[3]){

  1195.         new start[3],stop[3]

  1196.         start[2]=origins[2]-110

  1197.         stop[2]=origins[2]-110

  1198.        

  1199.         switch(direction){

  1200.                 case 0:{

  1201.                         start[0]=map_cors_origin[zone*6]+5

  1202.                         stop[0]=map_cors_origin[zone*6]+5

  1203.                         start[1]=map_cors_origin[zone*6+2]

  1204.                         stop[1]=map_cors_origin[zone*6+3]

  1205.                 }

  1206.                 case 1:{

  1207.                         start[0]=map_cors_origin[zone*6+1]-5

  1208.                         stop[0]=map_cors_origin[zone*6+1]-5

  1209.                         start[1]=map_cors_origin[zone*6+2]

  1210.                         stop[1]=map_cors_origin[zone*6+3]

  1211.                 }

  1212.                 case 2:{

  1213.                         start[0]=map_cors_origin[zone*6+0]

  1214.                         stop[0]=map_cors_origin[zone*6+1]

  1215.                         start[1]=map_cors_origin[zone*6+2]+5

  1216.                         stop[1]=map_cors_origin[zone*6+2]+5

  1217.                 }

  1218.                 case 3:{

  1219.                         start[0]=map_cors_origin[zone*6+0]

  1220.                         stop[0]=map_cors_origin[zone*6+1]

  1221.                         start[1]=map_cors_origin[zone*6+3]-5

  1222.                         stop[1]=map_cors_origin[zone*6+3]-5

  1223.                 }

  1224.         }

  1225.         for(new i=0;i<9;i++){

  1226.                 start[2]+=30

  1227.                 stop[2]+=30

  1228.                 FX_Line(start, stop, zone_color_red, 60, id)

  1229.         }

  1230. }

  1231.  

  1232. ///////////////////////////////////////////////////////////////////////////

  1233. /////////                 M_Antirusher Save to file               /////////

  1234. ///////////////////////////////////////////////////////////////////////////

  1235.  

  1236. public write_to_file(){

  1237.         new text[512],text2[64]

  1238.         new currentmap[32]

  1239.         get_mapname(currentmap,31)

  1240.         format(text,511,"%s %s ", g_team, currentmap)

  1241.         new x0[6],x1[6],y0[6],y1[6],z0[6],z1[6]

  1242.         for(new i=0;i<zones;i++){

  1243.                 num_to_str(map_cors_origin[0+i*6],x0,5)

  1244.                 num_to_str(map_cors_origin[1+i*6],x1,5)

  1245.                 num_to_str(map_cors_origin[2+i*6],y0,5)

  1246.                 num_to_str(map_cors_origin[3+i*6],y1,5)

  1247.                 num_to_str(map_cors_origin[4+i*6],z0,5)

  1248.                 num_to_str(map_cors_origin[5+i*6],z1,5)

  1249.                 format(text2,63,"%s %s %s %s %s %s ",x0,x1,y0,y1,z0,z1)

  1250.                 add(text,511,text2)

  1251.         }

  1252.        

  1253.         if(is_linux_server()){

  1254.                 new zonefile[256]

  1255.                 get_configsdir(zonefile, 255)

  1256.                 format(zonefile, 255, "%s/antirusher/rush.cor", zonefile)

  1257.                 if((write_file ( zonefile, text, map_cors_file_line ))==0) log_amx("<<Blad przy nadpisywaniu rush.cor>>")              

  1258.         }

  1259.         else{  

  1260.                 if((write_file ( "addons\amxmodx\configs\antirusher\rush.cor", text, map_cors_file_line ))==0) log_amx("<<Blad przy nadpisywaniu rush.cor>>")

  1261.         }

  1262. }

  1263.  

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Antirush kicsit másképp
HozzászólásElküldve: 2012.05.17. 14:28 
Offline
Signore Senior
Avatar

Csatlakozott: 2011.09.09. 17:39
Hozzászólások: 4020
Megköszönt másnak: 12 alkalommal
Megköszönték neki: 139 alkalommal
Lagg ellen:

Kód:
  1.  

  2. new Float : TEST_TIME = 0.1

  3.  


valami nagyobb értékre. pl.: 1.0


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Antirush kicsit másképp
HozzászólásElküldve: 2012.05.17. 14:42 
Offline
Őstag
Avatar

Csatlakozott: 2010.04.16. 16:50
Hozzászólások: 1342
Megköszönt másnak: 42 alkalommal
Megköszönték neki: 58 alkalommal
azt tudom mert nekem 0.20 ra van állitva!! De ha nagyobra állítom akkor van amikor átmennek rajta mert ritkábban ellenőrzi !! De hol kell a háló sűrűségét állítani ??

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Antirush kicsit másképp
HozzászólásElküldve: 2012.05.21. 09:08 
Offline
Imperátor
Avatar

Csatlakozott: 2009.04.21. 09:33
Hozzászólások: 3991
Megköszönt másnak: 5 alkalommal
Megköszönték neki: 135 alkalommal
Hiába állítod sűrűbbre, ugyanúgy csekkolja az áthaladást rajta

_________________
Kód:
I'm back

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


Ki van itt

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