Этот раздел, как вы могли заметить по названию, предназначен для решения вопросов по поводу уже существующих модов и плагинов. Пожалуйста, если у вас проблема с написанием плагина, не путайте этот раздел с разделом по скриптингу. Для поиска плагинов и модов существует соответствующий раздел.
Название темы должно соответствовать содержанию. Темы с названием типа "Помогите", "Вопрос", "парни подскажите..." - будут удалены. Все темы, не относящиеся к "Вопросам по модам и плагинам", будут удалены или перемещены в соответствующий раздел.
Правила оформления темы: 1. Помимо заголовка не забудьте верно сформулировать свой вопрос. 2. Выложите исходник (в тег кода + ) или ссылку на плагин который вызывает у вас вопросы. 3. Выложите лог с ошибками (если имеется) под спойлер
// How dose plugin works // 0 = no top and no colorchat // 1 = prints good/pro/leet jumps // 2 = enables top10 // 3 = prints good/pro/leet jumps and enables top10 kz_ljs_tops "3"
// Do you want to save ljtop after mapchange? kz_ljs_topsave "1"
// How ranking will work? // 0 = names // 1 = steam ids // 2 = ips kz_ljs_rank_by "0"
// Kz jumping color chat: // 0 = normal // 1 = red // 2 = green // 3 = blue // 4 = silver // 5 = team color
// Is your server fast? // 0 = slow // 1 = normal // 2 = realy good ( >10mb/s or localhost/lan server ) kz_ljs_fastserver "2"
// Enables auto-setting 4 kz_ljs_fastserver cvar if it is 2 kz_ljs_autoserver "1"
// What is enabled on client when he connects to a server? // 0 = nothing // a = colorchat // b = ljstats // c = speed kz_ljs_connectenabler "abc"
// Do you want cmds like /speed to be visible in the chat? kz_ljs_viscmds "1"
// Speedometer type // 0 = show real speed and horizontal speed // 1 = show real speed // 2 = show horizontal speed kz_ljs_speedtype "0"
.-==========================================-.
Admin commands:
==-
amx_resetljrec - resets ljrec and ljtop amx_resetljtop - resets ljrec and ljtop
.-==========================================-.
Client commands:
==-
say /colorchat - enables/disables colorchat say /lj10 - display tops menu say /ljrec - display records menu say /ljsmenu - display ljs menu say /ljstats - enables/disables longjump stats say /ljsversion - prints plugin version say /speed - enables/disables visible speed
.-==========================================-.
Installation:
==-
1. Extract all files and overwrite your cstrike folder 2. Add kz_ljs_xm.amxx in addons/amxmodx/configs/plugins.ini list 3. Restart your server/Change map !!! WARNING !!! To get better gocheck and hook protection write kz_ljs_xm.amxx in plugins.ini BEFORE your checkpoint and hook plugins! Good e.x. of plugins.ini -> kz_ljs_xm.amxx -> ProKreedz.amxx -> ProKreedz_Hook.amxx Bad e.x. of plugins.ini -> ProKreedz.amxx -> ProKreedz_Hook.amxx -> kz_ljs_xm.amxx
// Ints & strings new server_settings[34][27][16]; new plugin_id; new plugin_file_name[64]; new pluginstatus; new gBeam; new strafes[33]; new goodsync[33]; new badsync[33]; new ljsDir[64]; new pre_type[33][32]; new top_names[10][33]; new top_authid[10][33]; new top_distance[10]; new top_maxspeed[10]; new top_prestrafe[10]; new top_strafes[10]; new top_sync[10]; new top_type[10][5]; new top_pretype[10][32]; new cj_names[10][33]; new cj_authid[10][33]; new cj_distance[10]; new cj_maxspeed[10]; new cj_prestrafe[10]; new cj_strafes[10]; new cj_sync[10]; new cj_pretype[10][32]; new lj_names[10][33]; new lj_authid[10][33]; new lj_distance[10]; new lj_maxspeed[10]; new lj_prestrafe[10]; new lj_strafes[10]; new lj_sync[10]; new lj_pretype[10][32]; new view_names[33][10][33]; new view_distance[33][10]; new view_maxspeed[33][10]; new view_prestrafe[33][10]; new view_strafes[33][10]; new view_sync[33][10]; new view_type[33][10][5]; new view_pretype[33][10][32]; new full_top_stats_selected_type[33]; new full_top_stats_selected_page[33];
// Bools new bool:possible_lj_script[33][2]; new bool:tops_save; new bool:gHasColorChat[33]; new bool:gHasSpeed[33]; new bool:gHasLjStats[33]; new bool:gInAir[33]; new bool:cjumped[33]; new bool:doubleducked[33]; new bool:cducked[33]; new bool:induck[33]; new bool:OnGround[33]; new bool:turning_right[33]; new bool:turning_left[33]; new bool:strafing_aw[33]; new bool:strafing_sd[33];
// Floats new Float:vBeamPos[33][129][3]; new Float:vBeamPosStatus[33][129]; new Float:vBeamTime[33][129]; new Float:old_angle1[33]; new Float:angle[3]; new Float:vFramePos[33][2][3]; new Float:vFrameSpeed[33][2][3]; new Float:vDuckedAt[33][3]; new Float:vJumpedAt[33][3]; new Float:vJumpedAt2[3]; new Float:xDistance; new Float:yDistance; new Float:fDistance; new Float:fDistance1; new Float:fDistance2; new Float:rDistance[2]; new Float:rLandPos[3]; new Float:vOrigin[3]; new Float:vOldOrigin[33][3]; new Float:vTraceEnd[3]; new Float:fMaxAirSpeed[33]; new Float:fMaxGroundSpeed[33]; new Float:vVelocity[3]; new Float:fSpeed; new Float:gSpeed; new Float:OldSpeed[33]; new Float:frame2time; new Float:jumptime[33]; new Float:lasttime[33]; new Float:beam_jump_off_time[33];
// Plugin strings new const gPLUGIN[] = "LjS - eXtreme Mod - Terorists only"; new const gVERSION[] = "2.2b7"; new const gVERSION_NUM[] = "22007"; new const gAUTHOR[] = "Fatalis & Numb";
// Cvars new kz_ljs_enabled; new kz_good_lj; new kz_pro_lj; new kz_leet_lj; new kz_min_lj; new kz_max_lj; new kz_cj_dif; new kz_lj_sounds; new kz_leet_lj_clr; new kz_pro_lj_clr; new kz_good_lj_clr; new kz_leet_cj_clr; new kz_pro_cj_clr; new kz_good_cj_clr; new kz_ljstats_red; new kz_ljstats_green; new kz_ljstats_blue; new kz_ljs_beam; new kz_legal_settings; new kz_ljs_fastserver; new kz_ljs_autoserver; new kz_ljs_speedtype; new kz_ljs_connectenabler; new kz_ljs_viscmds; new kz_ljs_tops; new kz_ljs_topsave; new kz_ljs_rank_by; new edgefriction; new sv_cheats; new sv_gravity; new sv_maxspeed; new sv_stepsize; new sv_maxvelocity; new sv_lan;
public plugin_init() { if( tops_save ) read_tops();
kz_ljs_enabled = register_cvar("kz_ljs_enabled", "1"); // enables/disables the plugin kz_good_lj = register_cvar("kz_good_lj", "240.0"); // good longjumps kz_pro_lj = register_cvar("kz_pro_lj", "245.0"); // professional longjumps kz_leet_lj = register_cvar("kz_leet_lj", "250.0"); // leet longjump kz_min_lj = register_cvar("kz_min_lj", "215.0"); // minimal longjump kz_max_lj = register_cvar("kz_max_lj", "260.0"); // maximal longjump kz_cj_dif = register_cvar("kz_cj_dif", "10.0"); // difrence between lj and cj kz_lj_sounds = register_cvar("kz_lj_sounds", "1"); // enables leet/pro/good lj/cj sounds kz_leet_lj_clr = register_cvar("kz_leet_lj_clr", "1"); // color of leet lj (1=red, 2=green, 3=blue, 4=gray, 5=team, 0=default) kz_pro_lj_clr = register_cvar("kz_pro_lj_clr", "2"); // color of pro lj kz_good_lj_clr = register_cvar("kz_good_lj_clr", "4"); // color of good lj kz_leet_cj_clr = register_cvar("kz_leet_cj_clr", "1"); // color of leet lj kz_pro_cj_clr = register_cvar("kz_pro_cj_clr", "2"); // color of pro lj kz_good_cj_clr = register_cvar("kz_good_cj_clr", "4"); // color of good lj kz_ljstats_red = register_cvar("kz_ljstats_red", "0"); // red color of /ljstats kz_ljstats_green = register_cvar("kz_ljstats_green", "255"); // green color of /ljstats kz_ljstats_blue = register_cvar("kz_ljstats_blue", "159"); // blue color of /ljstats kz_ljs_beam = register_cvar("kz_ljs_beam", "2"); // 0=beam off, 1=normal beam, 2=uber beam kz_legal_settings = register_cvar("kz_legal_settings", "1"); // enables protection 4 legal kreedz settings kz_ljs_fastserver = register_cvar("kz_ljs_fastserver", "2"); // Is your server fast? (0=slow, 1=normal, 2=good) kz_ljs_autoserver = register_cvar("kz_ljs_autoserver", "1"); // Authomaticaly detect what cvar of kz_ljs_fastserver shold be? kz_ljs_speedtype = register_cvar("kz_ljs_speedtype", "0"); // Speedometer type kz_ljs_connectenabler = register_cvar("kz_ljs_connectenabler", "abc"); // What is enabled at connect (0=nothing, a=colorchat, b=ljstats, c=speed) kz_ljs_viscmds = register_cvar("kz_ljs_viscmds", "1"); // Do you want say commands to be apeard on the chat? kz_ljs_tops = register_cvar("kz_ljs_tops", "3"); // LongJump top (0=Nothing, 1=ColorChat, 2=top, 3=top+ColorChat) kz_ljs_topsave = register_cvar("kz_ljs_topsave", "1"); // Do you want to save ljtop after mapchange? kz_ljs_rank_by = register_cvar("kz_ljs_rank_by", "0"); // How ranking will work? 0=name, 1=steam, 2=ip
if( !file_exists(filename) ) { log_amx("LjS: Error: Configuration file <^"%s^"> not found!", filename); log_amx("LjS: Creating file..."); write_file(filename, "; .-==========================================-."); write_file(filename, "; |~~ Long Jump Stats - eXtreme Modification ~~|"); write_file(filename, "; .-==========================================-."); write_file(filename, ""); write_file(filename, ""); write_file(filename, "; Enabled/Disables the plugin"); write_file(filename, "; 0 = disabled"); write_file(filename, "; 1 = enabled"); write_file(filename, "; Cvar kz_ljs_enabled (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; Maximum possible lj (not 4 cj)"); write_file(filename, "; Cvar kz_max_lj (default ^"260.0^")"); write_file(filename, "260.0"); write_file(filename, ""); write_file(filename, "; 1337 lj (prints to all players)"); write_file(filename, "; To disable, set it to -1"); write_file(filename, "; Cvar kz_leet_lj (default ^"250.0^")"); write_file(filename, "250.0"); write_file(filename, ""); write_file(filename, "; Professional lj (prints to all players)"); write_file(filename, "; To disable, set it to -1"); write_file(filename, "; Cvar kz_pro_lj (default ^"245.0^")"); write_file(filename, "245.0"); write_file(filename, ""); write_file(filename, "; Good lj (prints to all players)"); write_file(filename, "; To disable, set it to -1"); write_file(filename, "; Cvar kz_good_lj (default ^"240.0^")"); write_file(filename, "240.0"); write_file(filename, ""); write_file(filename, "; Minimal lj distance"); write_file(filename, "; Cvar kz_min_lj (default ^"215.0^")"); write_file(filename, "215.0"); write_file(filename, ""); write_file(filename, "; Difrence between longjump and countjump for good/pro/leet/max jump"); write_file(filename, "; Cvar kz_cj_dif (default ^"10.0^")"); write_file(filename, "10.0"); write_file(filename, ""); write_file(filename, "; Enables lj sounds"); write_file(filename, "; 0 = disabled"); write_file(filename, "; 1 = ultimate sounds"); write_file(filename, "; 2 = distance in voice"); write_file(filename, "; Cvar kz_lj_sounds (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; How dose plugin works"); write_file(filename, "; 0 = no top and no colorchat"); write_file(filename, "; 1 = prints good/pro/leet jumps"); write_file(filename, "; 2 = enables top10"); write_file(filename, "; 3 = prints good/pro/leet jumps and enables top10"); write_file(filename, "; Cvar kz_lj_top (default ^"3^")"); write_file(filename, "3"); write_file(filename, ""); write_file(filename, "; Do you want to save ljtop after mapchange?"); write_file(filename, "; Cvar kz_ljs_topsave (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; How ranking will work?"); write_file(filename, "; 0 = names"); write_file(filename, "; 1 = steam ids"); write_file(filename, "; 2 = ips"); write_file(filename, "; Cvar kz_ljs_rank_by (default ^"0^")"); write_file(filename, "0"); write_file(filename, ""); write_file(filename, "; Kz jumping color chat:"); write_file(filename, "; 0 = normal"); write_file(filename, "; 1 = red"); write_file(filename, "; 2 = green"); write_file(filename, "; 3 = blue"); write_file(filename, "; 4 = silver"); write_file(filename, "; 5 = team color"); write_file(filename, ""); write_file(filename, "; Cvar kz_leet_lj_clr (default ^"1^")"); write_file(filename, "1"); write_file(filename, "; Cvar kz_pro_lj_clr (default ^"2^")"); write_file(filename, "2"); write_file(filename, "; Cvar kz_good_lj_clr (default ^"4^")"); write_file(filename, "4"); write_file(filename, ""); write_file(filename, "; Cvar kz_leet_cj_clr (default ^"1^")"); write_file(filename, "1"); write_file(filename, "; Cvar kz_pro_cj_clr (default ^"2^")"); write_file(filename, "2"); write_file(filename, "; Cvar kz_good_cj_clr (default ^"4^")"); write_file(filename, "4"); write_file(filename, ""); write_file(filename, "; Colors of /ljstats (rrr ggg bbb)"); write_file(filename, "; Cvar kz_ljstats_red (default ^"0^")"); write_file(filename, "0"); write_file(filename, "; Cvar kz_ljstats_green (default ^"255^")"); write_file(filename, "255"); write_file(filename, "; Cvar kz_ljstats_blue (^"159^")"); write_file(filename, "159"); write_file(filename, ""); write_file(filename, "; LongJump Stats Laser Beam"); write_file(filename, "; 0 = off"); write_file(filename, "; 1 = normal"); write_file(filename, "; 2 = uber beam"); write_file(filename, "; Cvar kz_ljs_beam (default ^"2^")"); write_file(filename, "2"); write_file(filename, ""); write_file(filename, "; Enables protection 4 legal kreedz settings"); write_file(filename, "; Cvar kz_legal_settings (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; Is your server fast?"); write_file(filename, "; 0 = slow"); write_file(filename, "; 1 = normal"); write_file(filename, "; 2 = realy good ( >10mb/s or localhost/lan server )"); write_file(filename, "; Cvar kz_ljs_fastserver (default ^"2^")"); write_file(filename, "2"); write_file(filename, ""); write_file(filename, "; Enables auto-setting 4 kz_ljs_fastserver cvar if it is 2"); write_file(filename, "; Cvar kz_ljs_autoserver (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; What is enabled on client when he connects to a server?"); write_file(filename, "; 0 = nothing"); write_file(filename, "; a = colorchat"); write_file(filename, "; b = ljstats"); write_file(filename, "; c = speed"); write_file(filename, "; Cvar kz_ljs_connectenabler (default ^"abc^")"); write_file(filename, "abc"); write_file(filename, ""); write_file(filename, "; Do you want cmds like /speed to be visible in the chat?"); write_file(filename, "; Cvar kz_ljs_viscmds (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; Speedometer type"); write_file(filename, "; 0 = show real speed and horizontal speed"); write_file(filename, "; 1 = show real speed"); write_file(filename, "; 2 = show horizontal speed"); write_file(filename, "; Cvar kz_ljs_speedtype (default ^"0^")"); write_file(filename, "0"); if( file_exists(filename) ) { log_amx("LjS: File <^"%s^"> successfully created.", filename); log_amx("LjS: All settings are setted by default."); } else { log_amx("LjS: Fatal-Error: Creation of <^"%s^"> file failed!", filename); log_amx("LjS: Disabeling plugin..."); set_cvar_string("kz_ljs_enabled", "0"); if( get_cvar_num("kz_ljs_enabled") ) { if( !plugin_file_name[0] ) return 0;
log_amx("LjS: Fatal-Error: Omg, plugin cannot be disabled by cvar... Check your amxx!!!"); log_amx("LjS: Disabeling plugin by turning off the code."); pause("ac", plugin_file_name); } return 0; } }
if( !(fix_since < 2) ) { log_amx("LjS: Error: Settings that gows before #%d in <^"%s^"> cold be incurrent!", (fix_since+1), filename); log_amx("LjS: All other settings are setted by default. Please check the config file!"); } else { log_amx("LjS: Error: Configuration file <^"%s^"> is not currect!", filename); log_amx("LjS: All settings are setted by default.");
len += format(MenuBody[len], 511-len, "^n\r2. \dDisplay lj top (no ljs)");
if( cj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r3. \wDisplay cj top"); keys |= (1<<2); } else len += format(MenuBody[len], 511-len, "^n\r3. \dDisplay cj top (no cjs)");
len += format(MenuBody[len], 511-len, "^n^n^n\yTops full stats^n"); len += format(MenuBody[len], 511-len, "^n\r4. \wTotal top stats"); keys |= (1<<3);
if( lj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r5. \wLj top stats"); keys |= (1<<4); } else len += format(MenuBody[len], 511-len, "^n\r5. \dLj top stats (no ljs)");
if( cj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r6. \wCj top stats"); keys |= (1<<5); } else len += format(MenuBody[len], 511-len, "^n\r6. \dCj top stats (no cjs)");
len += format(MenuBody[len], 511-len, "^n^n\r0. \wExit"); keys |= (1<<9);
show_menu(id, keys, MenuBody, -1, "Top 10 Menu"); } else client_print(id, print_chat, "[XJ] Tops are not valid. No jumps were made."); } else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Tops are not valid. Plugin has been disabled."); else client_print(id, print_chat, "[XJ] Tops are not valid. Tops have been disabled.");
if( nofirstjump ) { if( jumptype == 2 ) client_print(id, print_chat, "[XJ] Cj top is not valid. Jumps have been reseted (no cjs)."); else if( jumptype ) client_print(id, print_chat, "[XJ] Lj top is not valid. Jumps have been reseted (no ljs)."); else client_print(id, print_chat, "[XJ] Tops are not valid. Jumps have been reseted (no jumps)."); menu_continue = INFO_ZERO; } else if( page && key == 9 ) { if( page == 2 ) full_top_stats_selected_page[id] = 0; else if( jumpschanged ) { if( jumptype == 2 ) client_print(id, print_chat, "[XJ] First 5 cjs have been changed. You are redirected to menu start."); else if( jumptype ) client_print(id, print_chat, "[XJ] First 5 ljs have been changed. You are redirected to menu start."); else client_print(id, print_chat, "[XJ] First 5 jumps have been changed. You are redirected to menu start."); full_top_stats_selected_page[id] = 0; } else { if( jumptype == 2 && cj_distance[9] ) full_top_stats_selected_page[id] = 2; else if( jumptype && lj_distance[9] ) full_top_stats_selected_page[id] = 2; else if( !jumptype && top_distance[9] ) full_top_stats_selected_page[id] = 2; else { client_print(id, print_chat, "[XJ] All jumps have been changed. You are redirected to menu start."); full_top_stats_selected_page[id] = 0; } } } else { if( jumpschanged && page == 2 ) { if( jumptype == 2 ) client_print(id, print_chat, "[XJ] First 5 cjs have been changed. You are redirected to menu start."); else if( jumptype ) client_print(id, print_chat, "[XJ] First 5 ljs have been changed. You are redirected to menu start."); else client_print(id, print_chat, "[XJ] First 5 jumps have been changed. You are redirected to menu start."); full_top_stats_selected_page[id] = 0; } else if( page == 2 ) { if( jumptype == 2 && cj_distance[9] ) full_top_stats_selected_page[id] = 2; else if( jumptype && lj_distance[9] ) full_top_stats_selected_page[id] = 2; else if( !jumptype && top_distance[9] ) full_top_stats_selected_page[id] = 2; else { client_print(id, print_chat, "[XJ] All jumps have been changed. You are redirected to menu start."); full_top_stats_selected_page[id] = 0; } } else full_top_stats_selected_page[id] = 0; }
len += format(buffer[len], 2367-len, "</table></body>");
show_motd(id, buffer, motdname); }
public cmdLjsMenu(id) { new plugin_cvar = get_pcvar_num(kz_ljs_enabled); new ljtop_cvar = get_pcvar_num(kz_ljs_tops); new MenuBody[512], len, keys; len = format(MenuBody, 511, "\yLongJump Stats Menu^n");
public show_leet_ljumper(id) { new plugin_cvar = get_pcvar_num(kz_ljs_enabled); new ljtop_cvar = get_pcvar_num(kz_ljs_tops); if( plugin_cvar && (ljtop_cvar == 2 || ljtop_cvar == 3) ) { if( top_distance[0] ) { new MenuBody[512], len, keys; len = format(MenuBody, 511, "\yShow best longjumper^n"); len += format(MenuBody[len], 511-len, "^n\r1. \wTotal jump record"); keys = (1<<0);
if( lj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r2. \wLongJump record"); keys |= (1<<1); } else len += format(MenuBody[len], 511-len, "^n\r2. \dLongJump record (no ljs)");
if( cj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r3. \wContJump record"); keys |= (1<<2); } else len += format(MenuBody[len], 511-len, "^n\r3. \dContJump record (no cjs)");
len += format(MenuBody[len], 511-len, "^n^n\r0. \wExit"); keys |= (1<<9);
show_menu(id, keys, MenuBody, -1, "Show best longjumper"); } else client_print(id, print_chat, "[XJ] No jump records are setted!"); } else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin is disabled."); else client_print(id, print_chat, "[XJ] Records are not valid. Tops are disabled.");
public LeetJumpMenu_Select(id, key) { new plugin_cvar = get_pcvar_num(kz_ljs_enabled); new ljtops = get_pcvar_num(kz_ljs_tops); if( ljtops == 2 || ljtops == 3 ) ljtops = 1; else ljtops = 0; switch((key+1)) { case 1: { if( top_distance[0] && ljtops && plugin_cvar ) client_print(id, print_chat, "[XJ] %s has the total %d.%06d %s record!", top_names[0], top_distance[0]/1000000, top_distance[0]%1000000, top_type[0]); else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled."); else if( !ljtops ) client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled."); else client_print(id, print_chat, "[XJ] Records are not valid. Tops have been reseted."); } case 2: { if( lj_distance[0] && ljtops && plugin_cvar ) client_print(id, print_chat, "[XJ] %s has the %d.%06d lj record!", lj_names[0], lj_distance[0]/1000000, lj_distance[0]%1000000); else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled."); else if( !ljtops ) client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled."); else client_print(id, print_chat, "[XJ] Lj records are not valid. Tops have been reseted."); } case 3: { if( cj_distance[0] && ljtops && plugin_cvar ) client_print(id, print_chat, "[XJ] %s has the %d.%06d cj record!", cj_names[0], cj_distance[0]/1000000, cj_distance[0]%1000000); else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled."); else if( !ljtops ) client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled."); else client_print(id, print_chat, "[XJ] Cj records are not valid. Tops have been reseted."); } } return PLUGIN_HANDLED; }
public show_top(id, toptype) { static buffer[2368], name[64], len, i;
// How dose plugin works // 0 = no top and no colorchat // 1 = prints good/pro/leet jumps // 2 = enables top10 // 3 = prints good/pro/leet jumps and enables top10 kz_ljs_tops "3"
// Do you want to save ljtop after mapchange? kz_ljs_topsave "1"
// How ranking will work? // 0 = names // 1 = steam ids // 2 = ips kz_ljs_rank_by "0"
// Kz jumping color chat: // 0 = normal // 1 = red // 2 = green // 3 = blue // 4 = silver // 5 = team color
// Is your server fast? // 0 = slow // 1 = normal // 2 = realy good ( >10mb/s or localhost/lan server ) kz_ljs_fastserver "2"
// Enables auto-setting 4 kz_ljs_fastserver cvar if it is 2 kz_ljs_autoserver "1"
// What is enabled on client when he connects to a server? // 0 = nothing // a = colorchat // b = ljstats // c = speed kz_ljs_connectenabler "abc"
// Do you want cmds like /speed to be visible in the chat? kz_ljs_viscmds "1"
// Speedometer type // 0 = show real speed and horizontal speed // 1 = show real speed // 2 = show horizontal speed kz_ljs_speedtype "0"
.-==========================================-.
Admin commands:
==-
amx_resetljrec - resets ljrec and ljtop amx_resetljtop - resets ljrec and ljtop
.-==========================================-.
Client commands:
==-
say /colorchat - enables/disables colorchat say /lj10 - display tops menu say /ljrec - display records menu say /ljsmenu - display ljs menu say /ljstats - enables/disables longjump stats say /ljsversion - prints plugin version say /speed - enables/disables visible speed
.-==========================================-.
Installation:
==-
1. Extract all files and overwrite your cstrike folder 2. Add kz_ljs_xm.amxx in addons/amxmodx/configs/plugins.ini list 3. Restart your server/Change map !!! WARNING !!! To get better gocheck and hook protection write kz_ljs_xm.amxx in plugins.ini BEFORE your checkpoint and hook plugins! Good e.x. of plugins.ini -> kz_ljs_xm.amxx -> ProKreedz.amxx -> ProKreedz_Hook.amxx Bad e.x. of plugins.ini -> ProKreedz.amxx -> ProKreedz_Hook.amxx -> kz_ljs_xm.amxx
// Ints & strings new server_settings[34][27][16]; new plugin_id; new plugin_file_name[64]; new pluginstatus; new gBeam; new strafes[33]; new goodsync[33]; new badsync[33]; new ljsDir[64]; new pre_type[33][32]; new top_names[10][33]; new top_authid[10][33]; new top_distance[10]; new top_maxspeed[10]; new top_prestrafe[10]; new top_strafes[10]; new top_sync[10]; new top_type[10][5]; new top_pretype[10][32]; new cj_names[10][33]; new cj_authid[10][33]; new cj_distance[10]; new cj_maxspeed[10]; new cj_prestrafe[10]; new cj_strafes[10]; new cj_sync[10]; new cj_pretype[10][32]; new lj_names[10][33]; new lj_authid[10][33]; new lj_distance[10]; new lj_maxspeed[10]; new lj_prestrafe[10]; new lj_strafes[10]; new lj_sync[10]; new lj_pretype[10][32]; new view_names[33][10][33]; new view_distance[33][10]; new view_maxspeed[33][10]; new view_prestrafe[33][10]; new view_strafes[33][10]; new view_sync[33][10]; new view_type[33][10][5]; new view_pretype[33][10][32]; new full_top_stats_selected_type[33]; new full_top_stats_selected_page[33];
// Bools new bool:possible_lj_script[33][2]; new bool:tops_save; new bool:gHasColorChat[33]; new bool:gHasSpeed[33]; new bool:gHasLjStats[33]; new bool:gInAir[33]; new bool:cjumped[33]; new bool:doubleducked[33]; new bool:cducked[33]; new bool:induck[33]; new bool:OnGround[33]; new bool:turning_right[33]; new bool:turning_left[33]; new bool:strafing_aw[33]; new bool:strafing_sd[33];
// Floats new Float:vBeamPos[33][129][3]; new Float:vBeamPosStatus[33][129]; new Float:vBeamTime[33][129]; new Float:old_angle1[33]; new Float:angle[3]; new Float:vFramePos[33][2][3]; new Float:vFrameSpeed[33][2][3]; new Float:vDuckedAt[33][3]; new Float:vJumpedAt[33][3]; new Float:vJumpedAt2[3]; new Float:xDistance; new Float:yDistance; new Float:fDistance; new Float:fDistance1; new Float:fDistance2; new Float:rDistance[2]; new Float:rLandPos[3]; new Float:vOrigin[3]; new Float:vOldOrigin[33][3]; new Float:vTraceEnd[3]; new Float:fMaxAirSpeed[33]; new Float:fMaxGroundSpeed[33]; new Float:vVelocity[3]; new Float:fSpeed; new Float:gSpeed; new Float:OldSpeed[33]; new Float:frame2time; new Float:jumptime[33]; new Float:lasttime[33]; new Float:beam_jump_off_time[33];
// Plugin strings new const gPLUGIN[] = "LjS - eXtreme Mod - Terorists only"; new const gVERSION[] = "2.2b7"; new const gVERSION_NUM[] = "22007"; new const gAUTHOR[] = "Fatalis & Numb";
// Cvars new kz_ljs_enabled; new kz_good_lj; new kz_pro_lj; new kz_leet_lj; new kz_min_lj; new kz_max_lj; new kz_cj_dif; new kz_lj_sounds; new kz_leet_lj_clr; new kz_pro_lj_clr; new kz_good_lj_clr; new kz_leet_cj_clr; new kz_pro_cj_clr; new kz_good_cj_clr; new kz_ljstats_red; new kz_ljstats_green; new kz_ljstats_blue; new kz_ljs_beam; new kz_legal_settings; new kz_ljs_fastserver; new kz_ljs_autoserver; new kz_ljs_speedtype; new kz_ljs_connectenabler; new kz_ljs_viscmds; new kz_ljs_tops; new kz_ljs_topsave; new kz_ljs_rank_by; new edgefriction; new sv_cheats; new sv_gravity; new sv_maxspeed; new sv_stepsize; new sv_maxvelocity; new sv_lan;
public plugin_init() { if( tops_save ) read_tops();
kz_ljs_enabled = register_cvar("kz_ljs_enabled", "1"); // enables/disables the plugin kz_good_lj = register_cvar("kz_good_lj", "240.0"); // good longjumps kz_pro_lj = register_cvar("kz_pro_lj", "245.0"); // professional longjumps kz_leet_lj = register_cvar("kz_leet_lj", "250.0"); // leet longjump kz_min_lj = register_cvar("kz_min_lj", "215.0"); // minimal longjump kz_max_lj = register_cvar("kz_max_lj", "260.0"); // maximal longjump kz_cj_dif = register_cvar("kz_cj_dif", "10.0"); // difrence between lj and cj kz_lj_sounds = register_cvar("kz_lj_sounds", "1"); // enables leet/pro/good lj/cj sounds kz_leet_lj_clr = register_cvar("kz_leet_lj_clr", "1"); // color of leet lj (1=red, 2=green, 3=blue, 4=gray, 5=team, 0=default) kz_pro_lj_clr = register_cvar("kz_pro_lj_clr", "2"); // color of pro lj kz_good_lj_clr = register_cvar("kz_good_lj_clr", "4"); // color of good lj kz_leet_cj_clr = register_cvar("kz_leet_cj_clr", "1"); // color of leet lj kz_pro_cj_clr = register_cvar("kz_pro_cj_clr", "2"); // color of pro lj kz_good_cj_clr = register_cvar("kz_good_cj_clr", "4"); // color of good lj kz_ljstats_red = register_cvar("kz_ljstats_red", "0"); // red color of /ljstats kz_ljstats_green = register_cvar("kz_ljstats_green", "255"); // green color of /ljstats kz_ljstats_blue = register_cvar("kz_ljstats_blue", "159"); // blue color of /ljstats kz_ljs_beam = register_cvar("kz_ljs_beam", "2"); // 0=beam off, 1=normal beam, 2=uber beam kz_legal_settings = register_cvar("kz_legal_settings", "1"); // enables protection 4 legal kreedz settings kz_ljs_fastserver = register_cvar("kz_ljs_fastserver", "1"); // Is your server fast? (0=slow, 1=normal, 2=good) kz_ljs_autoserver = register_cvar("kz_ljs_autoserver", "1"); // Authomaticaly detect what cvar of kz_ljs_fastserver shold be? kz_ljs_speedtype = register_cvar("kz_ljs_speedtype", "0"); // Speedometer type kz_ljs_connectenabler = register_cvar("kz_ljs_connectenabler", "abc"); // What is enabled at connect (0=nothing, a=colorchat, b=ljstats, c=speed) kz_ljs_viscmds = register_cvar("kz_ljs_viscmds", "1"); // Do you want say commands to be apeard on the chat? kz_ljs_tops = register_cvar("kz_ljs_tops", "3"); // LongJump top (0=Nothing, 1=ColorChat, 2=top, 3=top+ColorChat) kz_ljs_topsave = register_cvar("kz_ljs_topsave", "1"); // Do you want to save ljtop after mapchange? kz_ljs_rank_by = register_cvar("kz_ljs_rank_by", "0"); // How ranking will work? 0=name, 1=steam, 2=ip
if( !file_exists(filename) ) { log_amx("LjS: Error: Configuration file <^"%s^"> not found!", filename); log_amx("LjS: Creating file..."); write_file(filename, "; .-==========================================-."); write_file(filename, "; |~~ Long Jump Stats - eXtreme Modification ~~|"); write_file(filename, "; .-==========================================-."); write_file(filename, ""); write_file(filename, ""); write_file(filename, "; Enabled/Disables the plugin"); write_file(filename, "; 0 = disabled"); write_file(filename, "; 1 = enabled"); write_file(filename, "; Cvar kz_ljs_enabled (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; Maximum possible lj (not 4 cj)"); write_file(filename, "; Cvar kz_max_lj (default ^"260.0^")"); write_file(filename, "260.0"); write_file(filename, ""); write_file(filename, "; 1337 lj (prints to all players)"); write_file(filename, "; To disable, set it to -1"); write_file(filename, "; Cvar kz_leet_lj (default ^"250.0^")"); write_file(filename, "250.0"); write_file(filename, ""); write_file(filename, "; Professional lj (prints to all players)"); write_file(filename, "; To disable, set it to -1"); write_file(filename, "; Cvar kz_pro_lj (default ^"245.0^")"); write_file(filename, "245.0"); write_file(filename, ""); write_file(filename, "; Good lj (prints to all players)"); write_file(filename, "; To disable, set it to -1"); write_file(filename, "; Cvar kz_good_lj (default ^"240.0^")"); write_file(filename, "240.0"); write_file(filename, ""); write_file(filename, "; Minimal lj distance"); write_file(filename, "; Cvar kz_min_lj (default ^"215.0^")"); write_file(filename, "215.0"); write_file(filename, ""); write_file(filename, "; Difrence between longjump and countjump for good/pro/leet/max jump"); write_file(filename, "; Cvar kz_cj_dif (default ^"10.0^")"); write_file(filename, "10.0"); write_file(filename, ""); write_file(filename, "; Enables lj sounds"); write_file(filename, "; 0 = disabled"); write_file(filename, "; 1 = ultimate sounds"); write_file(filename, "; 2 = distance in voice"); write_file(filename, "; Cvar kz_lj_sounds (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; How dose plugin works"); write_file(filename, "; 0 = no top and no colorchat"); write_file(filename, "; 1 = prints good/pro/leet jumps"); write_file(filename, "; 2 = enables top10"); write_file(filename, "; 3 = prints good/pro/leet jumps and enables top10"); write_file(filename, "; Cvar kz_lj_top (default ^"3^")"); write_file(filename, "3"); write_file(filename, ""); write_file(filename, "; Do you want to save ljtop after mapchange?"); write_file(filename, "; Cvar kz_ljs_topsave (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; How ranking will work?"); write_file(filename, "; 0 = names"); write_file(filename, "; 1 = steam ids"); write_file(filename, "; 2 = ips"); write_file(filename, "; Cvar kz_ljs_rank_by (default ^"0^")"); write_file(filename, "0"); write_file(filename, ""); write_file(filename, "; Kz jumping color chat:"); write_file(filename, "; 0 = normal"); write_file(filename, "; 1 = red"); write_file(filename, "; 2 = green"); write_file(filename, "; 3 = blue"); write_file(filename, "; 4 = silver"); write_file(filename, "; 5 = team color"); write_file(filename, ""); write_file(filename, "; Cvar kz_leet_lj_clr (default ^"1^")"); write_file(filename, "1"); write_file(filename, "; Cvar kz_pro_lj_clr (default ^"2^")"); write_file(filename, "2"); write_file(filename, "; Cvar kz_good_lj_clr (default ^"4^")"); write_file(filename, "4"); write_file(filename, ""); write_file(filename, "; Cvar kz_leet_cj_clr (default ^"1^")"); write_file(filename, "1"); write_file(filename, "; Cvar kz_pro_cj_clr (default ^"2^")"); write_file(filename, "2"); write_file(filename, "; Cvar kz_good_cj_clr (default ^"4^")"); write_file(filename, "4"); write_file(filename, ""); write_file(filename, "; Colors of /ljstats (rrr ggg bbb)"); write_file(filename, "; Cvar kz_ljstats_red (default ^"0^")"); write_file(filename, "0"); write_file(filename, "; Cvar kz_ljstats_green (default ^"255^")"); write_file(filename, "255"); write_file(filename, "; Cvar kz_ljstats_blue (^"159^")"); write_file(filename, "159"); write_file(filename, ""); write_file(filename, "; LongJump Stats Laser Beam"); write_file(filename, "; 0 = off"); write_file(filename, "; 1 = normal"); write_file(filename, "; 2 = uber beam"); write_file(filename, "; Cvar kz_ljs_beam (default ^"2^")"); write_file(filename, "2"); write_file(filename, ""); write_file(filename, "; Enables protection 4 legal kreedz settings"); write_file(filename, "; Cvar kz_legal_settings (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; Is your server fast?"); write_file(filename, "; 0 = slow"); write_file(filename, "; 1 = normal"); write_file(filename, "; 2 = realy good ( >10mb/s or localhost/lan server )"); write_file(filename, "; Cvar kz_ljs_fastserver (default ^"2^")"); write_file(filename, "2"); write_file(filename, ""); write_file(filename, "; Enables auto-setting 4 kz_ljs_fastserver cvar if it is 2"); write_file(filename, "; Cvar kz_ljs_autoserver (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; What is enabled on client when he connects to a server?"); write_file(filename, "; 0 = nothing"); write_file(filename, "; a = colorchat"); write_file(filename, "; b = ljstats"); write_file(filename, "; c = speed"); write_file(filename, "; Cvar kz_ljs_connectenabler (default ^"abc^")"); write_file(filename, "abc"); write_file(filename, ""); write_file(filename, "; Do you want cmds like /speed to be visible in the chat?"); write_file(filename, "; Cvar kz_ljs_viscmds (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; Speedometer type"); write_file(filename, "; 0 = show real speed and horizontal speed"); write_file(filename, "; 1 = show real speed"); write_file(filename, "; 2 = show horizontal speed"); write_file(filename, "; Cvar kz_ljs_speedtype (default ^"0^")"); write_file(filename, "0"); if( file_exists(filename) ) { log_amx("LjS: File <^"%s^"> successfully created.", filename); log_amx("LjS: All settings are setted by default."); } else { log_amx("LjS: Fatal-Error: Creation of <^"%s^"> file failed!", filename); log_amx("LjS: Disabeling plugin..."); set_cvar_string("kz_ljs_enabled", "0"); if( get_cvar_num("kz_ljs_enabled") ) { if( !plugin_file_name[0] ) return 0;
log_amx("LjS: Fatal-Error: Omg, plugin cannot be disabled by cvar... Check your amxx!!!"); log_amx("LjS: Disabeling plugin by turning off the code."); pause("ac", plugin_file_name); } return 0; } }
if( !(fix_since < 2) ) { log_amx("LjS: Error: Settings that gows before #%d in <^"%s^"> cold be incurrent!", (fix_since+1), filename); log_amx("LjS: All other settings are setted by default. Please check the config file!"); } else { log_amx("LjS: Error: Configuration file <^"%s^"> is not currect!", filename); log_amx("LjS: All settings are setted by default.");
len += format(MenuBody[len], 511-len, "^n\r2. \dDisplay lj top (no ljs)");
if( cj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r3. \wDisplay cj top"); keys |= (1<<2); } else len += format(MenuBody[len], 511-len, "^n\r3. \dDisplay cj top (no cjs)");
len += format(MenuBody[len], 511-len, "^n^n^n\yTops full stats^n"); len += format(MenuBody[len], 511-len, "^n\r4. \wTotal top stats"); keys |= (1<<3);
if( lj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r5. \wLj top stats"); keys |= (1<<4); } else len += format(MenuBody[len], 511-len, "^n\r5. \dLj top stats (no ljs)");
if( cj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r6. \wCj top stats"); keys |= (1<<5); } else len += format(MenuBody[len], 511-len, "^n\r6. \dCj top stats (no cjs)");
len += format(MenuBody[len], 511-len, "^n^n\r0. \wExit"); keys |= (1<<9);
show_menu(id, keys, MenuBody, -1, "Top 10 Menu"); } else client_print(id, print_chat, "[XJ] Tops are not valid. No jumps were made."); } else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Tops are not valid. Plugin has been disabled."); else client_print(id, print_chat, "[XJ] Tops are not valid. Tops have been disabled.");
if( nofirstjump ) { if( jumptype == 2 ) client_print(id, print_chat, "[XJ] Cj top is not valid. Jumps have been reseted (no cjs)."); else if( jumptype ) client_print(id, print_chat, "[XJ] Lj top is not valid. Jumps have been reseted (no ljs)."); else client_print(id, print_chat, "[XJ] Tops are not valid. Jumps have been reseted (no jumps)."); menu_continue = INFO_ZERO; } else if( page && key == 9 ) { if( page == 2 ) full_top_stats_selected_page[id] = 0; else if( jumpschanged ) { if( jumptype == 2 ) client_print(id, print_chat, "[XJ] First 5 cjs have been changed. You are redirected to menu start."); else if( jumptype ) client_print(id, print_chat, "[XJ] First 5 ljs have been changed. You are redirected to menu start."); else client_print(id, print_chat, "[XJ] First 5 jumps have been changed. You are redirected to menu start."); full_top_stats_selected_page[id] = 0; } else { if( jumptype == 2 && cj_distance[9] ) full_top_stats_selected_page[id] = 2; else if( jumptype && lj_distance[9] ) full_top_stats_selected_page[id] = 2; else if( !jumptype && top_distance[9] ) full_top_stats_selected_page[id] = 2; else { client_print(id, print_chat, "[XJ] All jumps have been changed. You are redirected to menu start."); full_top_stats_selected_page[id] = 0; } } } else { if( jumpschanged && page == 2 ) { if( jumptype == 2 ) client_print(id, print_chat, "[XJ] First 5 cjs have been changed. You are redirected to menu start."); else if( jumptype ) client_print(id, print_chat, "[XJ] First 5 ljs have been changed. You are redirected to menu start."); else client_print(id, print_chat, "[XJ] First 5 jumps have been changed. You are redirected to menu start."); full_top_stats_selected_page[id] = 0; } else if( page == 2 ) { if( jumptype == 2 && cj_distance[9] ) full_top_stats_selected_page[id] = 2; else if( jumptype && lj_distance[9] ) full_top_stats_selected_page[id] = 2; else if( !jumptype && top_distance[9] ) full_top_stats_selected_page[id] = 2; else { client_print(id, print_chat, "[XJ] All jumps have been changed. You are redirected to menu start."); full_top_stats_selected_page[id] = 0; } } else full_top_stats_selected_page[id] = 0; }
len += format(buffer[len], 2367-len, "</table></body>");
show_motd(id, buffer, motdname); }
public cmdLjsMenu(id) { new plugin_cvar = get_pcvar_num(kz_ljs_enabled); new ljtop_cvar = get_pcvar_num(kz_ljs_tops); new MenuBody[512], len, keys; len = format(MenuBody, 511, "\yLongJump Stats Menu^n");
public show_leet_ljumper(id) { new plugin_cvar = get_pcvar_num(kz_ljs_enabled); new ljtop_cvar = get_pcvar_num(kz_ljs_tops); if( plugin_cvar && (ljtop_cvar == 2 || ljtop_cvar == 3) ) { if( top_distance[0] ) { new MenuBody[512], len, keys; len = format(MenuBody, 511, "\yShow best longjumper^n"); len += format(MenuBody[len], 511-len, "^n\r1. \wTotal jump record"); keys = (1<<0);
if( lj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r2. \wLongJump record"); keys |= (1<<1); } else len += format(MenuBody[len], 511-len, "^n\r2. \dLongJump record (no ljs)");
if( cj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r3. \wContJump record"); keys |= (1<<2); } else len += format(MenuBody[len], 511-len, "^n\r3. \dContJump record (no cjs)");
len += format(MenuBody[len], 511-len, "^n^n\r0. \wExit"); keys |= (1<<9);
show_menu(id, keys, MenuBody, -1, "Show best longjumper"); } else client_print(id, print_chat, "[XJ] No jump records are setted!"); } else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin is disabled."); else client_print(id, print_chat, "[XJ] Records are not valid. Tops are disabled.");
public LeetJumpMenu_Select(id, key) { new plugin_cvar = get_pcvar_num(kz_ljs_enabled); new ljtops = get_pcvar_num(kz_ljs_tops); if( ljtops == 2 || ljtops == 3 ) ljtops = 1; else ljtops = 0; switch((key+1)) { case 1: { if( top_distance[0] && ljtops && plugin_cvar ) client_print(id, print_chat, "[XJ] %s has the total %d.%06d %s record!", top_names[0], top_distance[0]/1000000, top_distance[0]%1000000, top_type[0]); else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled."); else if( !ljtops ) client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled."); else client_print(id, print_chat, "[XJ] Records are not valid. Tops have been reseted."); } case 2: { if( lj_distance[0] && ljtops && plugin_cvar ) client_print(id, print_chat, "[XJ] %s has the %d.%06d lj record!", lj_names[0], lj_distance[0]/1000000, lj_distance[0]%1000000); else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled."); else if( !ljtops ) client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled."); else client_print(id, print_chat, "[XJ] Lj records are not valid. Tops have been reseted."); } case 3: { if( cj_distance[0] && ljtops && plugin_cvar ) client_print(id, print_chat, "[XJ] %s has the %d.%06d cj record!", cj_names[0], cj_distance[0]/1000000, cj_distance[0]%1000000); else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled."); else if( !ljtops ) client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled."); else client_print(id, print_chat, "[XJ] Cj records are not valid. Tops have been reseted."); } } return PLUGIN_HANDLED; }
public show_top(id, toptype) { static buffer[2368], name[64], len, i;
^1 - Стандартный (желтый) цвет ^3 - Цвет команды за которую играешь (или указанный после строки колорчата "RED,BLUE") ^4 - Зеленый цвет чтобы в чате работал знак % (попустим как в примере после Sync) нужно ставить 2 символа "%%"
Но так как в плагине каждая строка под каждый цвет отдельно, и каждый вид прыжка, то придется много лазить и менять.
Поблагодарили 0 раз Поблагодарили 0 раз
adokf
26.2.2015, 17:42
Сообщение
Стаж: 11 лет
Сообщений: 64
Благодарностей: 1
Полезность: < 0
i
Уведомление: Не нужно цитировать большие посты целиком
//For PreThink new Float:weapSpeed[33]; new Float:weapSpeedOld[33]; new strLen; new strMess[40*NSTRAFES]; new strMessBuf[40*NSTRAFES]; new goodSyncTemp; new badSyncTemp; new Float:time_; new Float:maxPreSpeedWeapon; new Float:maxBhopPreSpeedWeap; new Float:Fulltime; new ljStatsRed; new ljStatsGreen; new ljStatsBlue; new ljs_beam; new sync_;
// Ints & strings new server_settings[34][27][16]; new plugin_id; new plugin_file_name[64]; new pluginstatus; new gBeam; new jumptype[33]; //new vJumpedAtEnt[33]; new strafes[33]; new ljsDir[64]; new pre_type[33][32];
new top_names[NTOP][129]; //new top_authid[NTOP][33]; new top_distance[NTOP]; new top_maxspeed[NTOP]; new top_prestrafe[NTOP]; new top_strafes[NTOP]; new top_sync[NTOP]; new top_type[NTOP][5]; new top_pretype[NTOP][32];
new map_names[NSHOW][129]; new map_authid[NSHOW][33]; new map_distance[NSHOW]; new map_maxspeed[NSHOW]; new map_prestrafe[NSHOW]; new map_strafes[NSHOW]; new map_sync[NSHOW]; new map_type[NSHOW][5]; new map_pretype[NSHOW][32];
new cj_names[NTOP][129]; new cj_authid[NTOP][33]; new cj_distance[NTOP]; new cj_maxspeed[NTOP]; new cj_prestrafe[NTOP]; new cj_strafes[NTOP]; new cj_sync[NTOP]; new cj_pretype[NTOP][32];
new bj_names[NTOP][129]; new bj_authid[NTOP][33]; new bj_distance[NTOP]; new bj_maxspeed[NTOP]; new bj_prestrafe[NTOP]; new bj_strafes[NTOP]; new bj_sync[NTOP]; new bj_pretype[NTOP][32];
new sbj_names[NTOP][129]; new sbj_authid[NTOP][33]; new sbj_distance[NTOP]; new sbj_maxspeed[NTOP]; new sbj_prestrafe[NTOP]; new sbj_strafes[NTOP]; new sbj_sync[NTOP]; new sbj_pretype[NTOP][32];
new wj_names[NTOP][129]; new wj_authid[NTOP][33]; new wj_distance[NTOP]; new wj_maxspeed[NTOP]; new wj_prestrafe[NTOP]; new wj_strafes[NTOP]; new wj_sync[NTOP]; new wj_pretype[NTOP][32];
new lj_names[NTOP][129]; new lj_authid[NTOP][33]; new lj_distance[NTOP]; new lj_maxspeed[NTOP]; new lj_prestrafe[NTOP]; new lj_strafes[NTOP]; new lj_sync[NTOP]; new lj_pretype[NTOP][32];
new view_names[33][NSHOW][129]; new view_distance[33][NSHOW]; new view_maxspeed[33][NSHOW]; new view_prestrafe[33][NSHOW]; new view_strafes[33][NSHOW]; new view_sync[33][NSHOW]; new view_type[33][NSHOW][5]; new view_pretype[33][NSHOW][32]; new full_top_stats_selected_type[33]; new full_top_stats_selected_page[33]; new strafe_stat_sync[33][NSTRAFES][2]; // 0=good 1=bad new buttons; new strafecounter_oldbuttons[33];
// Bools new bool:bljhelp[33]; new bool:StrafeStat[33]; new bool:fallDown[33]; new bool:possible_lj_script[33][2]; new bool:tops_save; new bool:gHasColorChat[33]; new bool:gHasSpeed[33]; new bool:gHasLjStats[33]; new bool:testBhop[33]; new bool:gInAir[33]; new bool:isBhop[33]; new bool:cjumped[33]; new bool:doubleducked[33]; new bool:cducked[33]; new bool:induck[33]; new bool:OnGround[33]; new bool:turning_right[33]; new bool:turning_left[33]; new bool:strafing_aw[33]; new bool:strafing_sd[33]; new bool:bljbeam[33];
// Floats new Float:fMaxGroundBhopSpeed[33]; new Float:ljhel[33][3]; new Float:strafe_stat_time[33][NSTRAFES]; //[id][#of strafes for stat][goodStat/Badstat] (of speed) new Float:strafe_stat_speed[33][NSTRAFES][2]; //[id][#of strafes for stat][goodStat/Badstat] (of speed) new Float:TempSpeed[33]; new Float:vBeamPos[33][129][3]; new Float:vBeamPosStatus[33][129]; new Float:vBeamTime[33][129]; new Float:vBeamLastTime[33]; new Float:old_angle1[33]; new Float:angle[3]; new Float:vFramePos[33][2][3]; new Float:vFrameSpeed[33][2][3]; new Float:vDuckedAt[33][3]; new Float:vFallAt[33][3]; new Float:vJumpedAt[33][3]; new Float:vJumpedAt2[3]; new Float:xDistance; new Float:yDistance; new Float:fDistance; new Float:fDistance1; new Float:fDistance2; new Float:rDistance[3]; new Float:rLandPos[3]; new Float:vOrigin[3]; new Float:vLastFrameOrigin[33][3]; //new Float:vLastFrameVelocity[33][3]; new Float:vOldOrigin[33][3]; //new Float:vOldOrigin2[33]; new Float:vTraceEnd[3]; new Float:fMaxAirSpeed[33]; new Float:fMaxGroundSpeed[33]; new Float:fCjPreSpeed[33]; new Float:vVelocity[3]; //new Float:realDist[33]; new Float:fSpeed; new Float:gSpeed; //new Float:OldOldSpeed[33]; //new Float:OldSpeed[33]; new Float:frame2time; new Float:jumptime[33]; new Float:lasttime[33]; new Float:beam_jump_off_time[33];
// Plugin strings new const gPLUGIN[] = "Kreedz Stats"; new const gVERSION[] = "0.0.1"; new const gVERSION_NUM[] = "22007"; new const gAUTHOR[] = "by tvix, edited modified by mohawk";
// Cvars new kz_ljs_enabled; //new kz_good_lj; //new kz_pro_lj; //new kz_leet_lj; new kz_min_lj; new kz_min_lj_c; new kz_max_lj; new kz_cj_dif; new kz_lj_sounds; new kz_leet_lj_clr; new kz_pro_lj_clr; new kz_good_lj_clr; new kz_leet_cj_clr; new kz_pro_cj_clr; new kz_good_cj_clr; new kz_ljstats_red; new kz_ljstats_green; new kz_ljstats_blue; new kz_ljs_beam; new kz_legal_settings; new kz_ljs_fastserver; //new kz_ljs_autoserver; new kz_ljs_speedtype; new kz_ljs_connectenabler; new kz_ljs_viscmds; new kz_ljs_tops; new kz_ljs_topsave; new kz_ljs_rank_by; new kz_ljs_maptop; new kz_min_bhop; new kz_min_bhop_c; new edgefriction; new mp_footsteps; new sv_cheats; new sv_gravity; new sv_maxspeed; new sv_stepsize; new sv_maxvelocity;
//new sv_lan;
public plugin_init() { if( tops_save ) read_tops();
if( !file_exists(filename) ) { log_amx("LjS: Error: Configuration file <^"%s^"> not found!", filename); log_amx("LjS: Creating file..."); write_file(filename, "; Enabled/Disables the plugin"); write_file(filename, "; 0 = disabled"); write_file(filename, "; 1 = enabled"); write_file(filename, "; Cvar kz_ljs_enabled (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; Maximum possible lj (not 4 cj)"); write_file(filename, "; Cvar kz_max_lj (default ^"260.0^")"); write_file(filename, "260.0"); write_file(filename, ""); write_file(filename, "; 1337 lj (prints to all players)"); write_file(filename, "; To disable, set it to -1"); write_file(filename, "; Cvar kz_leet_lj (default ^"250.0^")"); write_file(filename, "250.0"); write_file(filename, ""); write_file(filename, "; Professional lj (prints to all players)"); write_file(filename, "; To disable, set it to -1"); write_file(filename, "; Cvar kz_pro_lj (default ^"245.0^")"); write_file(filename, "245.0"); write_file(filename, ""); write_file(filename, "; Good lj (prints to all players)"); write_file(filename, "; To disable, set it to -1"); write_file(filename, "; Cvar kz_good_lj (default ^"240.0^")"); write_file(filename, "240.0"); write_file(filename, ""); write_file(filename, "; Minimal lj distance"); write_file(filename, "; Cvar kz_min_lj (default ^"215.0^")"); write_file(filename, "215.0"); write_file(filename, ""); write_file(filename, "; Difrence between longjump and countjump for good/pro/leet/max jump"); write_file(filename, "; Cvar kz_cj_dif (default ^"10.0^")"); write_file(filename, "10.0"); write_file(filename, ""); write_file(filename, "; Enables lj sounds"); write_file(filename, "; 0 = disabled"); write_file(filename, "; 1 = ultimate sounds"); write_file(filename, "; 2 = distance in voice"); write_file(filename, "; Cvar kz_lj_sounds (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; How dose plugin works"); write_file(filename, "; 0 = no top and no colorchat"); write_file(filename, "; 1 = prints good/pro/leet jumps"); write_file(filename, "; 2 = enables top10"); write_file(filename, "; 3 = prints good/pro/leet jumps and enables top10"); write_file(filename, "; Cvar kz_lj_top (default ^"3^")"); write_file(filename, "3"); write_file(filename, ""); write_file(filename, "; Do you want to save ljtop after mapchange?"); write_file(filename, "; Cvar kz_ljs_topsave (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; How ranking will work?"); write_file(filename, "; 0 = names"); write_file(filename, "; 1 = steam ids"); write_file(filename, "; 2 = ips"); write_file(filename, "; Cvar kz_ljs_rank_by (default ^"0^")"); write_file(filename, "0"); write_file(filename, ""); write_file(filename, "; Kz jumping color chat:"); write_file(filename, "; 0 = normal"); write_file(filename, "; 1 = red"); write_file(filename, "; 2 = green"); write_file(filename, "; 3 = blue"); write_file(filename, "; 4 = silver"); write_file(filename, "; 5 = team color"); write_file(filename, ""); write_file(filename, "; Cvar kz_leet_lj_clr (default ^"1^")"); write_file(filename, "1"); write_file(filename, "; Cvar kz_pro_lj_clr (default ^"2^")"); write_file(filename, "2"); write_file(filename, "; Cvar kz_good_lj_clr (default ^"4^")"); write_file(filename, "4"); write_file(filename, ""); write_file(filename, "; Cvar kz_leet_cj_clr (default ^"1^")"); write_file(filename, "1"); write_file(filename, "; Cvar kz_pro_cj_clr (default ^"2^")"); write_file(filename, "2"); write_file(filename, "; Cvar kz_good_cj_clr (default ^"4^")"); write_file(filename, "4"); write_file(filename, ""); write_file(filename, "; Colors of /ljstats (rrr ggg bbb)"); write_file(filename, "; Cvar kz_ljstats_red (default ^"0^")"); write_file(filename, "0"); write_file(filename, "; Cvar kz_ljstats_green (default ^"255^")"); write_file(filename, "255"); write_file(filename, "; Cvar kz_ljstats_blue (^"159^")"); write_file(filename, "159"); write_file(filename, ""); write_file(filename, "; LongJump Stats Laser Beam"); write_file(filename, "; 0 = off"); write_file(filename, "; 1 = normal"); write_file(filename, "; 2 = uber beam"); write_file(filename, "; Cvar kz_ljs_beam (default ^"2^")"); write_file(filename, "2"); write_file(filename, ""); write_file(filename, "; Enables protection 4 legal kreedz settings"); write_file(filename, "; Cvar kz_legal_settings (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; Is your server fast?"); write_file(filename, "; 0 = slow"); write_file(filename, "; 1 = normal"); write_file(filename, "; 2 = realy good ( >10mb/s or localhost/lan server )"); write_file(filename, "; Cvar kz_ljs_fastserver (default ^"2^")"); write_file(filename, "2"); write_file(filename, ""); write_file(filename, "; Enables auto-setting 4 kz_ljs_fastserver cvar if it is 2"); write_file(filename, "; Cvar kz_ljs_autoserver (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; What is enabled on client when he connects to a server?"); write_file(filename, "; 0 = nothing"); write_file(filename, "; a = colorchat"); write_file(filename, "; b = ljstats"); write_file(filename, "; c = speed"); write_file(filename, "; Cvar kz_ljs_connectenabler (default ^"abc^")"); write_file(filename, "abc"); write_file(filename, ""); write_file(filename, "; Do you want cmds like /speed to be visible in the chat?"); write_file(filename, "; Cvar kz_ljs_viscmds (default ^"1^")"); write_file(filename, "1"); write_file(filename, ""); write_file(filename, "; Speedometer type"); write_file(filename, "; 0 = show real speed and horizontal speed"); write_file(filename, "; 1 = show real speed"); write_file(filename, "; 2 = show horizontal speed"); write_file(filename, "; Cvar kz_ljs_speedtype (default ^"0^")"); write_file(filename, "0"); if( file_exists(filename) ) { log_amx("LjS: File <^"%s^"> successfully created.", filename); log_amx("LjS: All settings are setted by default."); } else { log_amx("LjS: Fatal-Error: Creation of <^"%s^"> file failed!", filename); log_amx("LjS: Disabeling plugin..."); set_cvar_string("kz_ljs_enabled", "0"); if( get_cvar_num("kz_ljs_enabled") ) { if( !plugin_file_name[0] ) return 0;
log_amx("LjS: Fatal-Error: Omg, plugin cannot be disabled by cvar... Check your amxx!!!"); log_amx("LjS: Disabeling plugin by turning off the code."); pause("ac", plugin_file_name); } return 0; } }
if( !(fix_since < 2) ) { log_amx("LjS: Error: Settings that gows before #%d in <^"%s^"> cold be incurrent!", (fix_since+1), filename); log_amx("LjS: All other settings are setted by default. Please check the config file!"); } else { log_amx("LjS: Error: Configuration file <^"%s^"> is not currect!", filename); log_amx("LjS: All settings are setted by default.");
len += format(MenuBody[len], 511-len, "^n^n\r0. \wExit"); keys |= (1<<9);
/* len += format(MenuBody[len], 511-len, "^n^n^n\yTops full stats^n"); len += format(MenuBody[len], 511-len, "^n\r5. \wTotal top stats"); keys |= (1<<4);
if( lj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r6. \wLj top stats"); keys |= (1<<5); } else len += format(MenuBody[len], 511-len, "^n\r6. \dLj top stats (no ljs)");
if( cj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r7. \wCj top stats"); keys |= (1<<6); } else len += format(MenuBody[len], 511-len, "^n\r7. \dCj top stats (no cjs)");
if( bj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r8. \wBj top stats"); keys |= (1<<7); } else len += format(MenuBody[len], 511-len, "^n\r8. \dBj top stats (no bjs)");
len += format(MenuBody[len], 511-len, "^n^n\r0. \wExit"); keys |= (1<<9); */ show_menu(id, keys, MenuBody, -1, "Top 10 Menu"); } else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Tops are not valid. Plugin has been disabled."); else client_print(id, print_chat, "[XJ] Tops are not valid. Tops have been disabled.");
if( nofirstjump ) { if( jumptype == 3 ) client_print(id, print_chat, "[XJ] Bj top is not valid. Jumps have been reseted (no bjs)."); else if( jumptype == 2 ) client_print(id, print_chat, "[XJ] Cj top is not valid. Jumps have been reseted (no cjs)."); else if( jumptype ) client_print(id, print_chat, "[XJ] Lj top is not valid. Jumps have been reseted (no ljs)."); else client_print(id, print_chat, "[XJ] Tops are not valid. Jumps have been reseted (no jumps)."); menu_continue = INFO_ZERO; } else if( page && key == 9 ) { if( page == 2 ) full_top_stats_selected_page[id] = 0; else if( jumpschanged ) { if( jumptype == 3 ) client_print(id, print_chat, "[XJ] First 5 bjs have been changed. You are redirected to menu start."); else if( jumptype == 2 ) client_print(id, print_chat, "[XJ] First 5 cjs have been changed. You are redirected to menu start."); else if( jumptype ) client_print(id, print_chat, "[XJ] First 5 ljs have been changed. You are redirected to menu start."); else client_print(id, print_chat, "[XJ] First 5 jumps have been changed. You are redirected to menu start."); full_top_stats_selected_page[id] = 0; } else { if( jumptype == 3 && bj_distance[9] ) full_top_stats_selected_page[id] = 2; else if( jumptype == 2 && cj_distance[9] ) full_top_stats_selected_page[id] = 2; else if( jumptype && lj_distance[9] ) full_top_stats_selected_page[id] = 2; else if( !jumptype && top_distance[9] ) full_top_stats_selected_page[id] = 2; else { client_print(id, print_chat, "[XJ] All jumps have been changed. You are redirected to menu start."); full_top_stats_selected_page[id] = 0; } } } else { if( jumpschanged && page == 2 ) { if( jumptype == 3 ) client_print(id, print_chat, "[XJ] First 5 bjs have been changed. You are redirected to menu start."); else if( jumptype == 2 ) client_print(id, print_chat, "[XJ] First 5 cjs have been changed. You are redirected to menu start."); else if( jumptype ) client_print(id, print_chat, "[XJ] First 5 ljs have been changed. You are redirected to menu start."); else client_print(id, print_chat, "[XJ] First 5 jumps have been changed. You are redirected to menu start."); full_top_stats_selected_page[id] = 0; } else if( page == 2 ) { if( jumptype == 3 && bj_distance[9] ) full_top_stats_selected_page[id] = 2; else if( jumptype == 2 && cj_distance[9] ) full_top_stats_selected_page[id] = 2; else if( jumptype && lj_distance[9] ) full_top_stats_selected_page[id] = 2; else if( !jumptype && top_distance[9] ) full_top_stats_selected_page[id] = 2; else { client_print(id, print_chat, "[XJ] All jumps have been changed. You are redirected to menu start."); full_top_stats_selected_page[id] = 0; } } else full_top_stats_selected_page[id] = 0; }
len += format(buffer[len], 2367-len, "</table></body>");
show_motd(id, buffer, motdname); }
public cmdLjsMenu(id) { new plugin_cvar = get_pcvar_num(kz_ljs_enabled); new ljtop_cvar = get_pcvar_num(kz_ljs_tops); new MenuBody[512], len, keys; len = format(MenuBody, 511, "\yLongJump Stats Menu^n");
public show_leet_ljumper(id) { new plugin_cvar = get_pcvar_num(kz_ljs_enabled); new ljtop_cvar = get_pcvar_num(kz_ljs_tops); if( plugin_cvar && (ljtop_cvar == 2 || ljtop_cvar == 3) ) { new MenuBody[512], len, keys; len = format(MenuBody, 511, "\yShow best longjumper^n");
if( map_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r1. \wMap record"); keys = (1<<0); } else len += format(MenuBody[len], 511-len, "^n\r1. \dMap record (no jumps)");
if( lj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r2. \wLongJump record"); keys |= (1<<1); } else len += format(MenuBody[len], 511-len, "^n\r2. \dLongJump record (no ljs)");
if( cj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r3. \wContJump record"); keys |= (1<<2); } else len += format(MenuBody[len], 511-len, "^n\r3. \dContJump record (no cjs)");
if( bj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r4. \wBhopJump record"); keys |= (1<<3); } else len += format(MenuBody[len], 511-len, "^n\r4. \dBhopJump record (no bjs)");
if( sbj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r5. \wStand-up BhopJump record"); keys |= (1<<4); } else len += format(MenuBody[len], 511-len, "^n\r5. \dStand-up BhopJump record (no sbjs)");
if( wj_distance[0] ) { len += format(MenuBody[len], 511-len, "^n\r6. \wWeirdJump record"); keys |= (1<<5); } else len += format(MenuBody[len], 511-len, "^n\r6. \dWeirdJump record (no wjs)");
len += format(MenuBody[len], 511-len, "^n^n\r0. \wExit"); keys |= (1<<9);
show_menu(id, keys, MenuBody, -1, "Show best longjumper"); } else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin is disabled."); else client_print(id, print_chat, "[XJ] Records are not valid. Tops are disabled.");
switch((key+1)) { case 1: { if( map_distance[0] && ljtops && plugin_cvar ) client_print(id, print_chat, "[XJ] %s has the total %d.%06d %s record!", map_names[0], map_distance[0]/1000000, map_distance[0]%1000000, map_type[0]); else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled."); else if( !ljtops ) client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled."); else client_print(id, print_chat, "[XJ] Records are not valid. Tops have been reseted."); } case 2: { if( lj_distance[0] && ljtops && plugin_cvar ) client_print(id, print_chat, "[XJ] %s has the %d.%06d lj record!", lj_names[0], lj_distance[0]/1000000, lj_distance[0]%1000000); else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled."); else if( !ljtops ) client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled."); else client_print(id, print_chat, "[XJ] Lj records are not valid. Tops have been reseted."); } case 3: { if( cj_distance[0] && ljtops && plugin_cvar ) client_print(id, print_chat, "[XJ] %s has the %d.%06d cj record!", cj_names[0], cj_distance[0]/1000000, cj_distance[0]%1000000); else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled."); else if( !ljtops ) client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled."); else client_print(id, print_chat, "[XJ] Cj records are not valid. Tops have been reseted."); } case 4: { if( bj_distance[0] && ljtops && plugin_cvar ) client_print(id, print_chat, "[XJ] %s has the %d.%06d bj record!", bj_names[0], bj_distance[0]/1000000, bj_distance[0]%1000000); else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled."); else if( !ljtops ) client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled."); else client_print(id, print_chat, "[XJ] Bj records are not valid. Tops have been reseted."); } case 5: { if( sbj_distance[0] && ljtops && plugin_cvar ) client_print(id, print_chat, "[XJ] %s has the %d.%06d sbj record!", sbj_names[0], sbj_distance[0]/1000000, sbj_distance[0]%1000000); else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled."); else if( !ljtops ) client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled."); else client_print(id, print_chat, "[XJ] Sbj records are not valid. Tops have been reseted."); } case 6: { if( wj_distance[0] && ljtops && plugin_cvar ) client_print(id, print_chat, "[XJ] %s has the %d.%06d wj record!", wj_names[0], wj_distance[0]/1000000, wj_distance[0]%1000000); else if( !plugin_cvar ) client_print(id, print_chat, "[XJ] Records are not valid. Plugin has been disabled."); else if( !ljtops ) client_print(id, print_chat, "[XJ] Records are not valid. Tops have been disabled."); else client_print(id, print_chat, "[XJ] Wj records are not valid. Tops have been reseted."); } } return PLUGIN_HANDLED; }
public show_top(id, toptype) { static buffer[2368], name[131], len, i;
//strafecounter_oldbuttons[id] = 0; //TODO is such IF is right? i think that isBhop[id] is useless if (!isBhop[id] && !testBhop[id]) { //vOldOrigin2[id] = vOrigin[2]; fMaxGroundSpeed[id] = fSpeed; fMaxAirSpeed[id] = fSpeed; vJumpedAt[id][2] = vOrigin[2];
if( (flags&FL_ONGROUND) && (gInAir[id] == true || OnGround[id] == false || isBhop[id])) //dont need @OnGround[id] == false@ here i think { fwdPlayerPreThink(id); }
//maxBhopPreSpeedWeap = weapSpeed[id]*1.2;
//Linear loss of speed can be calcilated like speed = (WeaponSpeed*1.2)*0.8 if ( isBhop[id] && (gSpeed > maxBhopPreSpeedWeap) && (fSpeed < gSpeed - 30.0) && gInAir[id] ) ///w00t that gInAir here rulezz { fMaxAirSpeed[id] = fSpeed; fMaxGroundBhopSpeed[id] += (fSpeed - gSpeed);//(gSpeed - fMaxGroundSpeed[id]); //is it right? fMaxGroundSpeed[id] = fSpeed; //client_print(id, print_console, "gSpeed %f fSpeed %f",gSpeed, fSpeed); set_hudmessage(255,255, 200, -1.0, 0.70, 0, 0.0, 0.7, 0.1, 0.1, 3); for( i = INFO_ONE; i < 33; i++ ) { if( (i == id || is_user_spectating_player(i, id)) && gHasLjStats[i]) { show_hudmessage(i, "Prestrafe: %f (%.3f)^nYour Maxspeed was too high %.3f^nMaxspeed have to be under %.3f", fMaxGroundSpeed[id], fMaxGroundBhopSpeed[id], gSpeed, maxBhopPreSpeedWeap); //client_print(i, print_console, "Prestrafe: %f (%.3f)^nYour Maxspeed was too high %.3f^nMaxspeed have to be under %.3f", fMaxGroundSpeed[id], fMaxGroundBhopSpeed[id], gSpeed, maxBhopPreSpeedWeap); } } }
//BUG?? plr can touch smth illegal on last frame... //There is No bug, because: PreThink - Engine - Touch - PostThink, but if u uncomment upper lines we will get that bug if( equal(ClassName, "func_train") || equal(ClassName, "func_conveyor") || equal(ClassName, "trigger_push") || equal(ClassName, "trigger_gravity")) { gocheck(id); set_task(0.4,"gocheck", id); gocheckbhop(id); set_task(0.4,"gocheckbhop", id); } //IF we need protection from func_door and func_door_rotating uncomment lines //else if(equal(ClassName, "func_door") || equal(ClassName, "func_door_rotating") ) //{ // gocheck(id); // set_task(0.4,"gocheck", id); //} } }
return false; }*/ stock Float:fm_distance_to_floor2(index,const Float:start[3], ignoremonsters = 1) { // nerekomendyy ispolzovat tk probivaet raznie i neskolko textyr za raz v opredelennih sly4aiah //(dont use it if u dont know how it works)
vStart[0] = vStop[0] = vOrigin[0] + vVel[0]/speed*16.03125; vStart[1] = vStop[1] = vOrigin[1] + vVel[1]/speed*16.03125; vStart[2] = vOrigin[2];// + vMins[2]; // get origin of player's feet vStop[2] = vStart[2] - 69.0; // Changed from 34 to 70 for CS? Or am i doing something wrong..?
if( engfunc(EngFunc_PointContents, vStart) == CONTENTS_SOLID ) // make sure start origin isn't in void space, this happens on hills. not sure if it really applies edgefriction here { return false; }
engfunc(EngFunc_TraceLine, vStart, vStop, 1, index); // trace a line from player feet to 70 units below that //beam(index, vStart, vStop); global_get(glb_trace_fraction, fraction); if( fraction == 1.0 ) return true; return false; }
stock DrawBeam(id, _ljs_beam, type) { //predvaritelno nado podgotovit vJumpedAt2 vTraceEnd vBeamPos vOrigin gBeam vBeamTime dl9 type == 1 = lj = bj // CJ - type ==2 static i;
//TODO za4em takie yslovi9 ???? //why we need such if //pohorowemy (i == id || is_user_spectating_player(i, id)) nenado // pohorowemy voobshe bgo a ne yslovi9