hlmod.hu

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



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: nincs regisztrált felhasználó az elmúlt 5 percben aktív felhasználók alapján

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



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

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 4 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Re: Anti-Rush Color chat
HozzászólásElküldve: 2013.09.04. 19:23 
Offline
Őskövület
Avatar

Csatlakozott: 2012.02.27. 09:42
Hozzászólások: 2588
Megköszönt másnak: 25 alkalommal
Megköszönték neki: 418 alkalommal
küldj sma-t és megnézzük :) (egyébként úgy mint a többi szövegnél..)

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Anti-Rush Color chat
HozzászólásElküldve: 2013.09.04. 19:53 
Offline
Őskövület
Avatar

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

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Anti-Rush Color chat
HozzászólásElküldve: 2013.09.05. 15:10 
Offline
Felfüggesztve
Avatar

Csatlakozott: 2013.06.09. 18:47
Hozzászólások: 2004
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 220 alkalommal
FuckYeah írta:
txt be nem engedi a dolgot :D


Persze hogy nem engedi, mivel nem oda kell :D txt nem tud kiolvasni színt! pl:^x04 stb..

A kódba kell beleírni


pl: ColorChat(arg[0],GREEN,"%L",LANG_PLAYER,^x01"AR_INFO_WARN") stbstb..

_________________
Ha elnyerte valamelyik témában a hozzászólásom a tetszésedet melyet olvastál, akkor egy egyszerű gombnyomással kifejezheted, hogy tetszett.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Anti-Rush Color chat
HozzászólásElküldve: 2013.09.05. 16:11 
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
Anonymous1337 írta:
FuckYeah írta:
txt be nem engedi a dolgot :D


Persze hogy nem engedi, mivel nem oda kell :D txt nem tud kiolvasni színt! pl:^x04 stb..

A kódba kell beleírni


pl: ColorChat(arg[0],GREEN,"%L",LANG_PLAYER,^x01"AR_INFO_WARN") stbstb..


Ezt most komolyan gondoltad?
A fordító erre olyan syntax errort vág, hogy összepisiled magad.
ColorChat(idx, color, "string", other params)

Te:
ColorChat(idx, color, "string", ^x01 param)

Ahogy Metal mondaná, partizán programozó.. De még az se.


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 81 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