Помогите исправить ошибку в плагине HOOK
|
|
Hnki | Дата: Воскресенье, 11.10.2015, 23:31 | Сообщение # 1 |
- Сообщения: 6
- Награды: 0
- Замечания:
|
#include <amxmodx> #include <cstrike> #include <amxmisc> #include <engine> #include <fun> #include <fakemeta> #include <hamsandwich> #include <colorchat>
#define HOOK_LEVEL ADMIN_LEVEL_H // Уровен доступа
#define TRAIL_LIFE 10 // Жизнь полосы #define TRAIL_WIDTH 10 // Ширина полосы #define TRAIL_RED 255 // Цвет: Красный #define TRAIL_GREEN 0 // Цвет: Зелёный #define TRAIL_BLUE 0 // Цвет: Голубой #define TRAIL_BRIGTHNESS 220 // Яркость
#define TRAIL_LIF 10 // Жизнь полосы #define TRAIL_WIDT 10 // Ширина полосы #define TRAIL_RE 0 // Цвет: Красный #define TRAIL_GREE 0 // Цвет: Зелёный #define TRAIL_BLU 255 // Цвет: Голубой #define TRAIL_BRIGTHNES 220 // Яркость
#pragma tabsize 0
new bool:canusehook[32] new bool:ishooked[32] new hookorigin[32][3]
new Enable new Glow, GlowRandom, GlowR, GlowG, GlowB new Fade, FadeRandom, fadeR, fadeG, fadeB new model_gibs, gTrail new HookSpeed new g_iBeamSprite new g_speed[33]
public plugin_init() { register_plugin(" [MG]Hook by Nickron","2.0","LLInH9rA, Remake Nickron") register_clcmd("+hook","hook_on",HOOK_LEVEL) register_clcmd("-hook","hook_off",HOOK_LEVEL) register_clcmd("hook_speed","Menu_hook") register_clcmd("hook_give","give_hook",HOOK_LEVEL,"<name|#userid|steamid|@ALL> <on/off>") // Дать/отнять хук Enable = register_cvar( "hook_enable", "1" ) // Вкл./Выкл. Плагин (По умолчанию Вкл) Glow = register_cvar( "hook_glow", "1" ) // Аура при полете Вкл./Выкл. (По умолчанию Вкл) GlowRandom = register_cvar( "hook_glow_random", "1" ) // Рандомная подсветка GlowR = register_cvar( "hook_glow_r", "255" ) // Цвет свечения(красный) GlowG = register_cvar( "hook_glow_g", "255" ) // Цвет свечения(зеленый) GlowB = register_cvar( "hook_glow_b", "255" ) // Цвет свечения(синий) Fade = register_cvar( "hook_screenfade", "0" ) // Затемнение экрана при полете Вкл./Выкл. (По умолчанию Вкл) FadeRandom = register_cvar( "hook_screenfade_random", "1" ) // Использовать рандомный цвет (1 - да, 2 -нет)(По умолчанию 1) fadeR = register_cvar( "hook_fade_r", "255" ) // Цвет затемнения экрана при полете(красный) fadeG = register_cvar( "hook_fade_g", "255" ) // Цвет затемнения экрана при полете(зеленый) fadeB = register_cvar( "hook_fade_b", "255" ) // Цвет затемнения экрана при полете(синий) HookSpeed = register_cvar( "hook_speed", "450" ) // Скорость (По умолчанию: 350) }
public plugin_precache() {
g_iBeamSprite = precache_model("sprites/csjump_lejkee18/lgtning.spr"); model_gibs = precache_model("sprites/csjump_lejkee18/pink.spr") gTrail = precache_model("sprites/csjump_lejkee18/speed.spr") precache_sound("csjump_lejkee18/exparrow_shoot1.wav") }
public Menu_hook(id) { if(get_user_flags(id) & ADMIN_LEVEL_H || get_user_flags(id) & ADMIN_LEVEL_H) { new menu = menu_create("\y [CJ]\wСкорость паутинки \y:3:","menu_hook") if(g_speed [id]== 0) { menu_additem(menu,"Низкая \y[Вкл]", "1", 0) }else{ menu_additem(menu,"Низкая \r[Выкл]", "1", 0) } if(g_speed [id]== 1) { menu_additem(menu,"Стандартная \y[Вкл]", "2", 0) }else{ menu_additem(menu,"Стандартная \r[Выкл]", "2", 0) } if(g_speed [id]== 2) { menu_additem(menu,"Высокая \y[Вкл]", "3", 0) }else{ menu_additem(menu,"Высокая \r[Выкл]", "3", 0) } menu_setprop(menu , MPROP_NEXTNAME, "Далее") menu_setprop(menu , MPROP_BACKNAME, "Назад") menu_setprop(menu , MPROP_EXITNAME, "\rВыход") menu_setprop(menu , MPROP_EXIT, MEXIT_ALL) menu_display(id, menu) }else{ ColorChat(id,BLUE,"^4[.:Cs-Jump:.] ^3У тебя нет паутины. Хотите купить ? Skype: ^4LeJkee18") } return PLUGIN_HANDLED } public menu_hook(id, menu, key) { if(key == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } new accss, clbck, data[6], name[64], itm menu_item_getinfo(menu, key, accss, data, 5, name, 63, clbck) itm = str_to_num(data) switch(itm) { case 1: { if(g_speed [id]== 0) { ColorChat(id,BLUE,"^3[.:Cs-Jump:.] ^4Уже установлено.") Menu_hook(id) }else{ g_speed [id]= 0 ColorChat(id,BLUE,"^3[.:Cs-Jump:.] ^4Вы выбрали скорость паутины: ^3низкая.") } } case 2: { if(g_speed [id]== 1) { ColorChat(id,BLUE,"^3[.:Cs-Jump:.] ^4Уже установлено.") Menu_hook(id) }else{ g_speed [id]= 1 ColorChat(id,BLUE,"^3[.:Cs-Jump:.] ^4Вы выбрали скорость паутины: ^3стандартная.") } } case 3: { if(g_speed [id]== 2) { ColorChat(id,BLUE,"^3[.:Cs-Jump:.] ^4Уже установлено.") Menu_hook(id) }else{ g_speed [id]= 2 ColorChat(id,BLUE,"^3[.:Cs-Jump:.] ^4Вы выбрали скорость паутины: ^3высокая.") } } } return PLUGIN_HANDLED }
public client_disconnect(id) { remove_hook(id) g_speed [id]= 1 }
public client_putinserver(id) { remove_hook(id) g_speed [id]= 1 }
// =================================================================================================
public give_hook(id,level,cid) { if(!cmd_access(id,level,cid,3)) return PLUGIN_HANDLED new name[32] get_user_name(id,name,32) new szarg1[32], szarg2[8], bool:mode read_argv(1,szarg1,32) read_argv(2,szarg2,32) if(equal(szarg2,"on")) mode = true if(equal(szarg1,"@ALL")) { for(new i=1;i<=get_maxplayers();i++) { if(is_user_connected(i) && is_user_alive(i)) { canusehook[i-1] = mode if(mode) { client_print(i,print_chat,"[.:Cs-Jump:.] Админ %s дал возможность возможность использовать hook",name) client_print(i,print_chat,"[.:Cs-Jump:.] Забиндите '+hook' на кнопку") } else client_print(i,print_chat,"[.:Cs-Jump:.] Админ %s отнял возможность возможность использовать hook",name) } } } else { new pid = cmd_target(id,szarg1,2) if(pid > 0) { canusehook[pid-1] = mode if(mode) { client_print(pid,print_chat,"[.:Cs-Jump:.] Админ %s дал возможность возможность использовать hook",name) client_print(pid,print_chat,"[.:Cs-Jump:.] Забиндите '+hook' на кнопку") } else client_print(pid,print_chat,"[.:Cs-Jump:.] Админ %s отнял возможность возможность использовать hook",name) } } return PLUGIN_HANDLED }
// =================================================================================================
public hook_on(id,level,cid) { if( get_pcvar_num( Enable ) ) { if(!canusehook[id-1] && !cmd_access(id,level,cid,1)) return PLUGIN_HANDLED if(get_user_flags(id) & ADMIN_BAN) { get_user_origin(id,hookorigin[id-1],3) if(callfunc_begin("detect_cheat","prokreedz.amxx") == 1) { callfunc_push_int(id) callfunc_push_str("Hook") callfunc_end() } ishooked[id-1] = true emit_sound(id,CHAN_STATIC,"csjump_lejkee18/exparrow_shoot1.wav",1.0,ATTN_NORM,0,PITCH_NORM) set_task(0.1,"hook_task",id,"",0,"ab") hook_task(id) func_break(id) } if( is_user_alive( id ) && get_pcvar_num( Glow ) ) { if( is_user_alive( id ) && get_pcvar_num( GlowRandom ) ) { set_user_rendering(id, kRenderFxGlowShell, random_num( 0,255 ), random_num( 0,255 ), random_num( 0,255 ), kRenderNormal, 16 ) } else { set_user_rendering(id, kRenderFxGlowShell, ( get_pcvar_num( GlowR ) ), ( get_pcvar_num( GlowG ) ), ( get_pcvar_num( GlowB ) ), kRenderNormal, 16 ) } } } else { ColorChat(id, RED,"[.:Cs-Jump:.] ^4Функция отключена!") } if( get_pcvar_num( Fade ) ) { if( get_pcvar_num( FadeRandom ) ) { message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0}, id) write_short( 10<<12 ) write_short( 10<<16 ) write_short( 1<<1 ) write_byte random_num( 0,255 ) write_byte random_num( 0,255 ) write_byte random_num( 0,255 ) write_byte( 255 ) message_end() } else { message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0}, id) write_short( 10<<12 ) write_short( 10<<16 ) write_short( 1<<1 ) write_byte ( get_pcvar_num( fadeR ) ) write_byte ( get_pcvar_num( fadeG ) ) write_byte ( get_pcvar_num( fadeB ) ) write_byte( 255 ) message_end() } } return PLUGIN_HANDLED }
// =================================================================================================
public is_hooked(id) { return ishooked[id-1] }
// =================================================================================================
public hook_off(id) {
remove_hook(id) if( is_user_alive( id ) && get_pcvar_num( Glow ) ) { set_user_rendering(id, kRenderFxGlowShell, random_num( 0,0 ), random_num( 0,0 ), random_num( 0,0 ), kRenderNormal, 16 ) } if( get_pcvar_num( Fade ) ) { message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0}, id) write_short( 10<<12 ) write_short( 10<<16 ) write_short( 1<<1 ) write_byte ( 255 ) write_byte ( 255 ) write_byte ( 255 ) write_byte( 255 ) message_end() } return PLUGIN_HANDLED }
// =================================================================================================
public hook_task(id) { if(!is_user_connected(id) || !is_user_alive(id)) remove_hook(id) remove_beam(id) f(id) func_trail(id) func_trail_ct(id) new origin[3], Float:velocity[3] get_user_origin(id,origin) new distance = get_distance(hookorigin[id-1],origin) new Float:HSpeed = get_pcvar_float(HookSpeed) if(distance > 25) { if(g_speed [id]== 0) { velocity[0] = (hookorigin[id-1][0] - origin[0]) * (4.0 * 100 / distance) velocity[1] = (hookorigin[id-1][1] - origin[1]) * (4.0 * 100 / distance) velocity[2] = (hookorigin[id-1][2] - origin[2]) * (4.0 * 100 / distance) }else if(g_speed [id]== 1){ velocity[0] = (hookorigin[id-1][0] - origin[0]) * (4.0 * 200 / distance) velocity[1] = (hookorigin[id-1][1] - origin[1]) * (4.0 * 200 / distance) velocity[2] = (hookorigin[id-1][2] - origin[2]) * (4.0 * 200 / distance) }else if(g_speed [id]== 2){ velocity[0] = (hookorigin[id-1][0] - origin[0]) * (4.0 * 300 / distance) velocity[1] = (hookorigin[id-1][1] - origin[1]) * (4.0 * 300 / distance) velocity[2] = (hookorigin[id-1][2] - origin[2]) * (4.0 * 300 / distance) } entity_set_vector(id,EV_VEC_velocity,velocity) } else { entity_set_vector(id,EV_VEC_velocity,Float:{0.0,0.0,0.0}) remove_hook(id) } }
// =================================================================================================
public f(id) { message_begin(MSG_BROADCAST, SVC_TEMPENTITY); write_byte(TE_BEAMENTPOINT); write_short(id); //Индекс entity write_coord(hookorigin[id-1][0]); //Конечная точка x write_coord(hookorigin[id-1][1]); //Конечная точка y write_coord(hookorigin[id-1][2]); //Конечная точка z write_short(g_iBeamSprite); //Индекс спрайта write_byte(0) //Стартовый кадр write_byte(1); //Скорость анимации write_byte(1); //Врмея существования write_byte(40); //Толщина луча write_byte(10); //Искажение switch(random(2)) { case 0: { write_byte(255); //Цвет красный write_byte(0); //Цвеи зеленый write_byte(0); //Цвет синий } case 1: { write_byte(0); //Цвет красный write_byte(255); //Цвеи зеленый write_byte(0); //Цвет синий } } write_byte(2000); //Яркость write_byte(0); //... message_end(); }
// =================================================================================================
public func_break(id) { new origin[3] get_user_origin(id,origin,3) message_begin(MSG_ALL,SVC_TEMPENTITY,{0,0,0},id) write_byte(TE_SPRITETRAIL) //Спрайт захвата write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]+20) write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]+80) write_short(model_gibs) write_byte(20) write_byte(20) write_byte(4) write_byte(20) write_byte(10) message_end() }
// =================================================================================================
public func_trail(id)
if(cs_get_user_team(id) == CS_TEAM_T)
{ { { message_begin (MSG_BROADCAST,SVC_TEMPENTITY) write_byte (TE_BEAMFOLLOW) write_short (id) write_short (gTrail) write_byte (TRAIL_LIFE) write_byte (TRAIL_WIDTH) write_byte (TRAIL_RED) write_byte (TRAIL_GREEN) write_byte (TRAIL_BLUE) write_byte (TRAIL_BRIGTHNESS) message_end() } } }
public func_trail_ct(id)
if(cs_get_user_team(id) == CS_TEAM_CT)
{ { { message_begin (MSG_BROADCAST,SVC_TEMPENTITY) write_byte (TE_BEAMFOLLOW) write_short (id) write_short (gTrail) write_byte (TRAIL_LIF) write_byte (TRAIL_WIDT) write_byte (TRAIL_RE) write_byte (TRAIL_GREE) write_byte (TRAIL_BLU) write_byte (TRAIL_BRIGTHNES) message_end() } } }
// =================================================================================================
public remove_hook(id) { if(task_exists(id)) remove_task(id) remove_beam(id) ishooked[id-1] = false }
// =================================================================================================
public remove_beam(id) { message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(99) // TE_KILLBEAM write_short(id) message_end() }
Сообщение отредактировал Hnki - Среда, 14.10.2015, 04:23 |
|
| |
NaSok | Дата: Вторник, 13.10.2015, 15:03 | Сообщение # 2 |
- Сообщения: 80
- Награды: 1
- Замечания:
|
Во-первых: код вставляйте в тэг "код" Во-вторых: это не ошибка, а предупреждение! Просто удалите new HSpeed
|
|
| |
Hnki | Дата: Среда, 14.10.2015, 04:15 | Сообщение # 3 |
- Сообщения: 6
- Награды: 0
- Замечания:
|
NaSok, Удалил new HSpeed
|
|
| |
NaSok | Дата: Среда, 14.10.2015, 15:32 | Сообщение # 4 |
- Сообщения: 80
- Награды: 1
- Замечания:
|
Цитата Hnki ( ) NaSok, Удалил new HSpeed Код #include <amxmodx> #include <cstrike> #include <amxmisc> #include <engine> #include <fun> #include <fakemeta> #include <hamsandwich> #include <colorchat>
#define HOOK_LEVEL ADMIN_LEVEL_H // Уровен доступа
#define TRAIL_LIFE 10 // Жизнь полосы #define TRAIL_WIDTH 10 // Ширина полосы #define TRAIL_RED 255 // Цвет: Красный #define TRAIL_GREEN 0 // Цвет: Зелёный #define TRAIL_BLUE 0 // Цвет: Голубой #define TRAIL_BRIGTHNESS 220 // Яркость
#define TRAIL_LIF 10 // Жизнь полосы #define TRAIL_WIDT 10 // Ширина полосы #define TRAIL_RE 0 // Цвет: Красный #define TRAIL_GREE 0 // Цвет: Зелёный #define TRAIL_BLU 255 // Цвет: Голубой #define TRAIL_BRIGTHNES 220 // Яркость
#pragma tabsize 0
new bool:canusehook[32] new bool:ishooked[32] new hookorigin[32][3]
new Enable new Glow, GlowRandom, GlowR, GlowG, GlowB new Fade, FadeRandom, fadeR, fadeG, fadeB new model_gibs, gTrail new g_iBeamSprite new g_speed[33]
public plugin_init() { register_plugin(" [MG]Hook by Nickron","2.0","LLInH9rA, Remake Nickron")
register_clcmd("+hook","hook_on",HOOK_LEVEL) register_clcmd("-hook","hook_off",HOOK_LEVEL) register_clcmd("hook_speed","Menu_hook") register_clcmd("hook_give","give_hook",HOOK_LEVEL,"<name|#userid|steamid|@ALL> <on/off>") // Дать/отнять хук
Enable = register_cvar( "hook_enable", "1" ) // Вкл./Выкл. Плагин (По умолчанию Вкл) Glow = register_cvar( "hook_glow", "1" ) // Аура при полете Вкл./Выкл. (По умолчанию Вкл) GlowRandom = register_cvar( "hook_glow_random", "1" ) // Рандомная подсветка GlowR = register_cvar( "hook_glow_r", "255" ) // Цвет свечения(красный) GlowG = register_cvar( "hook_glow_g", "255" ) // Цвет свечения(зеленый) GlowB = register_cvar( "hook_glow_b", "255" ) // Цвет свечения(синий) Fade = register_cvar( "hook_screenfade", "0" ) // Затемнение экрана при полете Вкл./Выкл. (По умолчанию Вкл) FadeRandom = register_cvar( "hook_screenfade_random", "1" ) // Использовать рандомный цвет (1 - да, 2 -нет)(По умолчанию 1) fadeR = register_cvar( "hook_fade_r", "255" ) // Цвет затемнения экрана при полете(красный) fadeG = register_cvar( "hook_fade_g", "255" ) // Цвет затемнения экрана при полете(зеленый) fadeB = register_cvar( "hook_fade_b", "255" ) // Цвет затемнения экрана при полете(синий) }
public plugin_precache() {
g_iBeamSprite = precache_model("sprites/csjump_lejkee18/lgtning.spr"); model_gibs = precache_model("sprites/csjump_lejkee18/pink.spr") gTrail = precache_model("sprites/csjump_lejkee18/speed.spr") precache_sound("csjump_lejkee18/exparrow_shoot1.wav")
}
public Menu_hook(id) { if(get_user_flags(id) & ADMIN_LEVEL_H || get_user_flags(id) & ADMIN_LEVEL_H) { new menu = menu_create("\y [CJ]\wСкорость паутинки \y:3:","menu_hook") if(g_speed [id]== 0) { menu_additem(menu,"Низкая \y[Вкл]", "1", 0) }else{ menu_additem(menu,"Низкая \r[Выкл]", "1", 0) } if(g_speed [id]== 1) { menu_additem(menu,"Стандартная \y[Вкл]", "2", 0) }else{ menu_additem(menu,"Стандартная \r[Выкл]", "2", 0) } if(g_speed [id]== 2) { menu_additem(menu,"Высокая \y[Вкл]", "3", 0) }else{ menu_additem(menu,"Высокая \r[Выкл]", "3", 0) } menu_setprop(menu , MPROP_NEXTNAME, "Далее") menu_setprop(menu , MPROP_BACKNAME, "Назад") menu_setprop(menu , MPROP_EXITNAME, "\rВыход") menu_setprop(menu , MPROP_EXIT, MEXIT_ALL) menu_display(id, menu) }else{ ColorChat(id,BLUE,"^4[.:Cs-Jump:.] ^3У тебя нет паутины. Хотите купить ? Skype: ^4LeJkee18") } return PLUGIN_HANDLED } public menu_hook(id, menu, key) { if(key == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } new accss, clbck, data[6], name[64], itm menu_item_getinfo(menu, key, accss, data, 5, name, 63, clbck) itm = str_to_num(data)
switch(itm) { case 1: { if(g_speed [id]== 0) { ColorChat(id,BLUE,"^3[.:Cs-Jump:.] ^4Уже установлено.") Menu_hook(id) }else{ g_speed [id]= 0 ColorChat(id,BLUE,"^3[.:Cs-Jump:.] ^4Вы выбрали скорость паутины: ^3низкая.") } } case 2: { if(g_speed [id]== 1) { ColorChat(id,BLUE,"^3[.:Cs-Jump:.] ^4Уже установлено.") Menu_hook(id) }else{ g_speed [id]= 1 ColorChat(id,BLUE,"^3[.:Cs-Jump:.] ^4Вы выбрали скорость паутины: ^3стандартная.") } } case 3: { if(g_speed [id]== 2) { ColorChat(id,BLUE,"^3[.:Cs-Jump:.] ^4Уже установлено.") Menu_hook(id) }else{ g_speed [id]= 2 ColorChat(id,BLUE,"^3[.:Cs-Jump:.] ^4Вы выбрали скорость паутины: ^3высокая.") } } } return PLUGIN_HANDLED }
public client_disconnect(id) { remove_hook(id) g_speed [id]= 1 }
public client_putinserver(id) { remove_hook(id) g_speed [id]= 1 }
// =================================================================================================
public give_hook(id,level,cid) { if(!cmd_access(id,level,cid,3)) return PLUGIN_HANDLED
new name[32] get_user_name(id,name,32)
new szarg1[32], szarg2[8], bool:mode read_argv(1,szarg1,32) read_argv(2,szarg2,32) if(equal(szarg2,"on")) mode = true
if(equal(szarg1,"@ALL")) { for(new i=1;i<=get_maxplayers();i++) { if(is_user_connected(i) && is_user_alive(i)) { canusehook[i-1] = mode if(mode) { client_print(i,print_chat,"[.:Cs-Jump:.] Админ %s дал возможность возможность использовать hook",name) client_print(i,print_chat,"[.:Cs-Jump:.] Забиндите '+hook' на кнопку") } else client_print(i,print_chat,"[.:Cs-Jump:.] Админ %s отнял возможность возможность использовать hook",name) } } } else { new pid = cmd_target(id,szarg1,2) if(pid > 0) { canusehook[pid-1] = mode if(mode) { client_print(pid,print_chat,"[.:Cs-Jump:.] Админ %s дал возможность возможность использовать hook",name) client_print(pid,print_chat,"[.:Cs-Jump:.] Забиндите '+hook' на кнопку") } else client_print(pid,print_chat,"[.:Cs-Jump:.] Админ %s отнял возможность возможность использовать hook",name) } }
return PLUGIN_HANDLED }
// =================================================================================================
public hook_on(id,level,cid) { if( get_pcvar_num( Enable ) ) { if(!canusehook[id-1] && !cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
if(get_user_flags(id) & ADMIN_BAN) { get_user_origin(id,hookorigin[id-1],3)
if(callfunc_begin("detect_cheat","prokreedz.amxx") == 1) { callfunc_push_int(id) callfunc_push_str("Hook") callfunc_end() }
ishooked[id-1] = true
emit_sound(id,CHAN_STATIC,"csjump_lejkee18/exparrow_shoot1.wav",1.0,ATTN_NORM,0,PITCH_NORM) set_task(0.1,"hook_task",id,"",0,"ab") hook_task(id) func_break(id) } if( is_user_alive( id ) && get_pcvar_num( Glow ) ) { if( is_user_alive( id ) && get_pcvar_num( GlowRandom ) ) { set_user_rendering(id, kRenderFxGlowShell, random_num( 0,255 ), random_num( 0,255 ), random_num( 0,255 ), kRenderNormal, 16 ) } else { set_user_rendering(id, kRenderFxGlowShell, ( get_pcvar_num( GlowR ) ), ( get_pcvar_num( GlowG ) ), ( get_pcvar_num( GlowB ) ), kRenderNormal, 16 ) } }
} else { ColorChat(id, RED,"[.:Cs-Jump:.] ^4Функция отключена!") }
if( get_pcvar_num( Fade ) ) { if( get_pcvar_num( FadeRandom ) ) { message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0}, id) write_short( 10<<12 ) write_short( 10<<16 ) write_short( 1<<1 ) write_byte random_num( 0,255 ) write_byte random_num( 0,255 ) write_byte random_num( 0,255 ) write_byte( 255 ) message_end() } else { message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0}, id) write_short( 10<<12 ) write_short( 10<<16 ) write_short( 1<<1 ) write_byte ( get_pcvar_num( fadeR ) ) write_byte ( get_pcvar_num( fadeG ) ) write_byte ( get_pcvar_num( fadeB ) ) write_byte( 255 ) message_end() } }
return PLUGIN_HANDLED }
// =================================================================================================
public is_hooked(id) { return ishooked[id-1] }
// =================================================================================================
public hook_off(id) {
remove_hook(id) if( is_user_alive( id ) && get_pcvar_num( Glow ) ) { set_user_rendering(id, kRenderFxGlowShell, random_num( 0,0 ), random_num( 0,0 ), random_num( 0,0 ), kRenderNormal, 16 ) }
if( get_pcvar_num( Fade ) ) { message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0}, id) write_short( 10<<12 ) write_short( 10<<16 ) write_short( 1<<1 ) write_byte ( 255 ) write_byte ( 255 ) write_byte ( 255 ) write_byte( 255 ) message_end() }
return PLUGIN_HANDLED }
// =================================================================================================
public hook_task(id) { if(!is_user_connected(id) || !is_user_alive(id)) remove_hook(id)
remove_beam(id) f(id) func_trail(id) func_trail_ct(id)
new origin[3], Float:velocity[3] get_user_origin(id,origin) new distance = get_distance(hookorigin[id-1],origin)
if(distance > 25) { if(g_speed [id]== 0) { velocity[0] = (hookorigin[id-1][0] - origin[0]) * (4.0 * 100 / distance) velocity[1] = (hookorigin[id-1][1] - origin[1]) * (4.0 * 100 / distance) velocity[2] = (hookorigin[id-1][2] - origin[2]) * (4.0 * 100 / distance) }else if(g_speed [id]== 1){ velocity[0] = (hookorigin[id-1][0] - origin[0]) * (4.0 * 200 / distance) velocity[1] = (hookorigin[id-1][1] - origin[1]) * (4.0 * 200 / distance) velocity[2] = (hookorigin[id-1][2] - origin[2]) * (4.0 * 200 / distance) }else if(g_speed [id]== 2){ velocity[0] = (hookorigin[id-1][0] - origin[0]) * (4.0 * 300 / distance) velocity[1] = (hookorigin[id-1][1] - origin[1]) * (4.0 * 300 / distance) velocity[2] = (hookorigin[id-1][2] - origin[2]) * (4.0 * 300 / distance) }
entity_set_vector(id,EV_VEC_velocity,velocity) } else { entity_set_vector(id,EV_VEC_velocity,Float:{0.0,0.0,0.0}) remove_hook(id) } }
// =================================================================================================
public f(id) { message_begin(MSG_BROADCAST, SVC_TEMPENTITY); write_byte(TE_BEAMENTPOINT); write_short(id); //Индекс entity write_coord(hookorigin[id-1][0]); //Конечная точка x write_coord(hookorigin[id-1][1]); //Конечная точка y write_coord(hookorigin[id-1][2]); //Конечная точка z write_short(g_iBeamSprite); //Индекс спрайта write_byte(0) //Стартовый кадр write_byte(1); //Скорость анимации write_byte(1); //Врмея существования write_byte(40); //Толщина луча write_byte(10); //Искажение switch(random(2)) { case 0: { write_byte(255); //Цвет красный write_byte(0); //Цвеи зеленый write_byte(0); //Цвет синий } case 1: { write_byte(0); //Цвет красный write_byte(255); //Цвеи зеленый write_byte(0); //Цвет синий } } write_byte(2000); //Яркость write_byte(0); //... message_end(); }
// =================================================================================================
public func_break(id) { new origin[3] get_user_origin(id,origin,3) message_begin(MSG_ALL,SVC_TEMPENTITY,{0,0,0},id) write_byte(TE_SPRITETRAIL) //Спрайт захвата write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]+20) write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]+80) write_short(model_gibs) write_byte(20) write_byte(20) write_byte(4) write_byte(20) write_byte(10) message_end() }
// =================================================================================================
public func_trail(id)
if(cs_get_user_team(id) == CS_TEAM_T)
{ { {
message_begin (MSG_BROADCAST,SVC_TEMPENTITY) write_byte (TE_BEAMFOLLOW) write_short (id) write_short (gTrail) write_byte (TRAIL_LIFE) write_byte (TRAIL_WIDTH) write_byte (TRAIL_RED) write_byte (TRAIL_GREEN) write_byte (TRAIL_BLUE) write_byte (TRAIL_BRIGTHNESS) message_end() } } }
public func_trail_ct(id)
if(cs_get_user_team(id) == CS_TEAM_CT)
{ { {
message_begin (MSG_BROADCAST,SVC_TEMPENTITY) write_byte (TE_BEAMFOLLOW) write_short (id) write_short (gTrail) write_byte (TRAIL_LIF) write_byte (TRAIL_WIDT) write_byte (TRAIL_RE) write_byte (TRAIL_GREE) write_byte (TRAIL_BLU) write_byte (TRAIL_BRIGTHNES) message_end() } } }
// =================================================================================================
public remove_hook(id) { if(task_exists(id)) remove_task(id) remove_beam(id) ishooked[id-1] = false }
// =================================================================================================
public remove_beam(id) { message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(99) // TE_KILLBEAM write_short(id) message_end() }
|
|
| |
Phubaxz | Дата: Вторник, 31.01.2017, 13:52 | Сообщение # 5 |
- Сообщения: 10
- Награды: 0
- Замечания:
|
Не вопрос держи Добавлено (31.01.2017, 13:52) --------------------------------------------- #include <amxmodx> #include <cstrike> #include <amxmisc> #include <engine> #include <fun> #include <fakemeta> #include <hamsandwich> #include <colorchat>
#define HOOK_LEVEL ADMIN_LEVEL_A // Уровен доступа
#define TRAIL_LIFE 10 // Жизнь полосы #define TRAIL_WIDTH 10 // Ширина полосы #define TRAIL_RED 255 // Цвет: Красный #define TRAIL_GREEN 0 // Цвет: Зелёный #define TRAIL_BLUE 0 // Цвет: Голубой #define TRAIL_BRIGTHNESS 220 // Яркость
#define TRAIL_LIF 10 // Жизнь полосы #define TRAIL_WIDT 10 // Ширина полосы #define TRAIL_RE 0 // Цвет: Красный #define TRAIL_GREE 0 // Цвет: Зелёный #define TRAIL_BLU 255 // Цвет: Голубой #define TRAIL_BRIGTHNES 220 // Яркость
#pragma tabsize 0
new bool:canusehook[32] new bool:ishooked[32] new hookorigin[32][3]
new Enable new Glow, GlowRandom, GlowR, GlowG, GlowB new Fade, FadeRandom, fadeR, fadeG, fadeB new model_gibs, gTrail new HookSpeed new g_iBeamSprite new g_speed[33]
public plugin_init() { register_plugin(" [MG]Hook by Nickron","2.0","LLInH9rA, Remake Nickron") register_clcmd("+hook","hook_on",HOOK_LEVEL) register_clcmd("-hook","hook_off",HOOK_LEVEL) register_clcmd("hook_speed","Menu_hook") register_clcmd("hook_give","give_hook",HOOK_LEVEL,"<name|#userid|steamid|@ALL> <on/off>") // Дать/отнять хук Enable = register_cvar( "hook_enable", "1" ) // Вкл./Выкл. Плагин (По умолчанию Вкл) Glow = register_cvar( "hook_glow", "1" ) // Аура при полете Вкл./Выкл. (По умолчанию Вкл) GlowRandom = register_cvar( "hook_glow_random", "1" ) // Рандомная подсветка GlowR = register_cvar( "hook_glow_r", "255" ) // Цвет свечения(красный) GlowG = register_cvar( "hook_glow_g", "255" ) // Цвет свечения(зеленый) GlowB = register_cvar( "hook_glow_b", "255" ) // Цвет свечения(синий) Fade = register_cvar( "hook_screenfade", "0" ) // Затемнение экрана при полете Вкл./Выкл. (По умолчанию Вкл) FadeRandom = register_cvar( "hook_screenfade_random", "1" ) // Использовать рандомный цвет (1 - да, 2 -нет)(По умолчанию 1) fadeR = register_cvar( "hook_fade_r", "255" ) // Цвет затемнения экрана при полете(красный) fadeG = register_cvar( "hook_fade_g", "255" ) // Цвет затемнения экрана при полете(зеленый) fadeB = register_cvar( "hook_fade_b", "255" ) // Цвет затемнения экрана при полете(синий) HookSpeed = register_cvar( "hook_speed", "450" ) // Скорость (По умолчанию: 350) }
public plugin_precache() {
g_iBeamSprite = precache_model("sprites/csjump_lejkee18/lgtning.spr"); model_gibs = precache_model("sprites/csjump_lejkee18/pink.spr") gTrail = precache_model("sprites/csjump_lejkee18/speed.spr") precache_sound("csjump_lejkee18/exparrow_shoot1.wav") }
public Menu_hook(id) { if(get_user_flags(id) & ADMIN_BAN) { new menu = menu_create("\wСкорость паутинки \y:3:","menu_hook") if(g_speed [id]== 0) { menu_additem(menu,"Низкая \y[Вкл]", "1", 0) }else{ menu_additem(menu,"Низкая \r[Выкл]", "1", 0) } if(g_speed [id]== 1) { menu_additem(menu,"Стандартная \y[Вкл]", "2", 0) }else{ menu_additem(menu,"Стандартная \r[Выкл]", "2", 0) } if(g_speed [id]== 2) { menu_additem(menu,"Высокая \y[Вкл]", "3", 0) }else{ menu_additem(menu,"Высокая \r[Выкл]", "3", 0) } menu_setprop(menu , MPROP_NEXTNAME, "Далее") menu_setprop(menu , MPROP_BACKNAME, "Назад") menu_setprop(menu , MPROP_EXITNAME, "\rВыход") menu_setprop(menu , MPROP_EXIT, MEXIT_ALL) menu_display(id, menu) }else{ ColorChat(id,BLUE,"^3У тебя нет паутины. Хотите купить ? Skype: ^4bobrik179") } return PLUGIN_HANDLED } public menu_hook(id, menu, key) { if(key == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } new accss, clbck, data[6], name[64], itm menu_item_getinfo(menu, key, accss, data, 5, name, 63, clbck) itm = str_to_num(data) switch(itm) { case 1: { if(g_speed [id]== 0) { ColorChat(id,BLUE,"^3Уже установлено.") Menu_hook(id) }else{ g_speed [id]= 0 ColorChat(id,BLUE,"^3Вы выбрали скорость паутины: ^4низкая.") } } case 2: { if(g_speed [id]== 1) { ColorChat(id,BLUE,"^3Уже установлено.") Menu_hook(id) }else{ g_speed [id]= 1 ColorChat(id,BLUE,"^3Вы выбрали скорость паутины: ^4стандартная.") } } case 3: { if(g_speed [id]== 2) { ColorChat(id,BLUE,"^3Уже установлено.") Menu_hook(id) }else{ g_speed [id]= 2 ColorChat(id,BLUE,"^3Вы выбрали скорость паутины: ^4высокая.") } } } return PLUGIN_HANDLED }
public client_disconnect(id) { remove_hook(id) g_speed [id]= 1 }
public client_putinserver(id) { remove_hook(id) g_speed [id]= 1 }
// =================================================================================================
public give_hook(id,level,cid) { if(!cmd_access(id,level,cid,3)) return PLUGIN_HANDLED new name[32] get_user_name(id,name,32) new szarg1[32], szarg2[8], bool:mode read_argv(1,szarg1,32) read_argv(2,szarg2,32) if(equal(szarg2,"on")) mode = true if(equal(szarg1,"@ALL")) { for(new i=1;i<=get_maxplayers();i++) { if(is_user_connected(i) && is_user_alive(i)) { canusehook[i-1] = mode if(mode) { client_print(i,print_chat,"^3Админ %s дал возможность возможность использовать hook",name) client_print(i,print_chat,"^3Забиндите '+hook' на кнопку") } else client_print(i,print_chat,"^4[Surf :)] ^3Админ %s отнял возможность возможность использовать hook",name) } } } else { new pid = cmd_target(id,szarg1,2) if(pid > 0) { canusehook[pid-1] = mode if(mode) { client_print(pid,print_chat,"^3Админ %s дал возможность возможность использовать hook",name) client_print(pid,print_chat,"^3Забиндите '+hook' на кнопку") } else client_print(pid,print_chat,"^3Админ %s отнял возможность возможность использовать hook",name) } } return PLUGIN_HANDLED }
// =================================================================================================
public hook_on(id,level,cid) { if( get_pcvar_num( Enable ) ) { if(!canusehook[id-1] && !cmd_access(id,level,cid,1)) return PLUGIN_HANDLED if(get_user_flags(id) & ADMIN_BAN) { get_user_origin(id,hookorigin[id-1],3) if(callfunc_begin("detect_cheat","prokreedz.amxx") == 1) { callfunc_push_int(id) callfunc_push_str("Hook") callfunc_end() } ishooked[id-1] = true emit_sound(id,CHAN_STATIC,"csjump_lejkee18/exparrow_shoot1.wav",1.0,ATTN_NORM,0,PITCH_NORM) set_task(0.1,"hook_task",id,"",0,"ab") hook_task(id) func_break(id) } if( is_user_alive( id ) && get_pcvar_num( Glow ) ) { if( is_user_alive( id ) && get_pcvar_num( GlowRandom ) ) { set_user_rendering(id, kRenderFxGlowShell, random_num( 0,255 ), random_num( 0,255 ), random_num( 0,255 ), kRenderNormal, 16 ) } else { set_user_rendering(id, kRenderFxGlowShell, ( get_pcvar_num( GlowR ) ), ( get_pcvar_num( GlowG ) ), ( get_pcvar_num( GlowB ) ), kRenderNormal, 16 ) } } } else { ColorChat(id, RED,"^4[Surf :)] ^3Функция отключена!") } if( get_pcvar_num( Fade ) ) { if( get_pcvar_num( FadeRandom ) ) { message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0}, id) write_short( 10<<12 ) write_short( 10<<16 ) write_short( 1<<1 ) write_byte random_num( 0,255 ) write_byte random_num( 0,255 ) write_byte random_num( 0,255 ) write_byte( 255 ) message_end() } else { message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0}, id) write_short( 10<<12 ) write_short( 10<<16 ) write_short( 1<<1 ) write_byte ( get_pcvar_num( fadeR ) ) write_byte ( get_pcvar_num( fadeG ) ) write_byte ( get_pcvar_num( fadeB ) ) write_byte( 255 ) message_end() } } return PLUGIN_HANDLED }
// =================================================================================================
public is_hooked(id) { return ishooked[id-1] }
// =================================================================================================
public hook_off(id) {
remove_hook(id) if( is_user_alive( id ) && get_pcvar_num( Glow ) ) { set_user_rendering(id, kRenderFxGlowShell, random_num( 0,0 ), random_num( 0,0 ), random_num( 0,0 ), kRenderNormal, 16 ) } if( get_pcvar_num( Fade ) ) { message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0}, id) write_short( 10<<12 ) write_short( 10<<16 ) write_short( 1<<1 ) write_byte ( 255 ) write_byte ( 255 ) write_byte ( 255 ) write_byte( 255 ) message_end() } return PLUGIN_HANDLED }
// =================================================================================================
public hook_task(id) { if(!is_user_connected(id) || !is_user_alive(id)) remove_hook(id) remove_beam(id) f(id) func_trail(id) func_trail_ct(id) new origin[3], Float:velocity[3] get_user_origin(id,origin) new distance = get_distance(hookorigin[id-1],origin) new Float:HSpeed = get_pcvar_float(HookSpeed) if(distance > 25) { if(g_speed [id]== 0) { velocity[0] = (hookorigin[id-1][0] - origin[0]) * (4.0 * 100 / distance) velocity[1] = (hookorigin[id-1][1] - origin[1]) * (4.0 * 100 / distance) velocity[2] = (hookorigin[id-1][2] - origin[2]) * (4.0 * 100 / distance) }else if(g_speed [id]== 1){ velocity[0] = (hookorigin[id-1][0] - origin[0]) * (4.0 * 200 / distance) velocity[1] = (hookorigin[id-1][1] - origin[1]) * (4.0 * 200 / distance) velocity[2] = (hookorigin[id-1][2] - origin[2]) * (4.0 * 200 / distance) }else if(g_speed [id]== 2){ velocity[0] = (hookorigin[id-1][0] - origin[0]) * (4.0 * 300 / distance) velocity[1] = (hookorigin[id-1][1] - origin[1]) * (4.0 * 300 / distance) velocity[2] = (hookorigin[id-1][2] - origin[2]) * (4.0 * 300 / distance) } entity_set_vector(id,EV_VEC_velocity,velocity) } else { entity_set_vector(id,EV_VEC_velocity,Float:{0.0,0.0,0.0}) remove_hook(id) } }
// =================================================================================================
public f(id) { message_begin(MSG_BROADCAST, SVC_TEMPENTITY); write_byte(TE_BEAMENTPOINT); write_short(id); //Индекс entity write_coord(hookorigin[id-1][0]); //Конечная точка x write_coord(hookorigin[id-1][1]); //Конечная точка y write_coord(hookorigin[id-1][2]); //Конечная точка z write_short(g_iBeamSprite); //Индекс спрайта write_byte(0) //Стартовый кадр write_byte(1); //Скорость анимации write_byte(1); //Врмея существования write_byte(40); //Толщина луча write_byte(10); //Искажение switch(random(2)) { case 0: { write_byte(255); //Цвет красный write_byte(0); //Цвеи зеленый write_byte(0); //Цвет синий } case 1: { write_byte(0); //Цвет красный write_byte(255); //Цвеи зеленый write_byte(0); //Цвет синий } } write_byte(2000); //Яркость write_byte(0); //... message_end(); }
// =================================================================================================
public func_break(id) { new origin[3] get_user_origin(id,origin,3) message_begin(MSG_ALL,SVC_TEMPENTITY,{0,0,0},id) write_byte(TE_SPRITETRAIL) //Спрайт захвата write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]+20) write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]+80) write_short(model_gibs) write_byte(20) write_byte(20) write_byte(4) write_byte(20) write_byte(10) message_end() }
// =================================================================================================
public func_trail(id)
if(cs_get_user_team(id) == CS_TEAM_T)
{ { { message_begin (MSG_BROADCAST,SVC_TEMPENTITY) write_byte (TE_BEAMFOLLOW) write_short (id) write_short (gTrail) write_byte (TRAIL_LIFE) write_byte (TRAIL_WIDTH) write_byte (TRAIL_RED) write_byte (TRAIL_GREEN) write_byte (TRAIL_BLUE) write_byte (TRAIL_BRIGTHNESS) message_end() } } }
public func_trail_ct(id)
if(cs_get_user_team(id) == CS_TEAM_CT)
{ { { message_begin (MSG_BROADCAST,SVC_TEMPENTITY) write_byte (TE_BEAMFOLLOW) write_short (id) write_short (gTrail) write_byte (TRAIL_LIF) write_byte (TRAIL_WIDT) write_byte (TRAIL_RE) write_byte (TRAIL_GREE) write_byte (TRAIL_BLU) write_byte (TRAIL_BRIGTHNES) message_end() } } }
// =================================================================================================
public remove_hook(id) { if(task_exists(id)) remove_task(id) remove_beam(id) ishooked[id-1] = false }
// =================================================================================================
public remove_beam(id) { message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(99) // TE_KILLBEAM write_short(id) message_end() }
|
|
| |