DURILKA
Пользователь
- Регистрация
- 2 Сен 2017
- Сообщения
- 131
- Симпатии
- 15
- Пол
- Мужской
Спойлеры используйте
- OS
- Linux
- Amx Mod X
- ReAMXX 1.8.3
- Билд
- Protocol version 48 Exe version 1.1.2.7/Stdio (cstrike) ReHLDS version: 3.7.0.692-dev-mpatch Build date: 18:13:20 Sep 30 2019 (1997) Build from: https://github.com/dreamstalker/rehlds/commit/e7232be
- ReGamedll
- ReGameDLL version: 5.12.0.425-dev Build date: 08:48:23 Nov 2 2019 Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/fd06d65
- Metamod
- Metamod v1.21p37 2013/05/30 (5:13) by Will Day http://www.metamod.org/ Patch: Metamod-P (mm-p) v37 by Jussi Kivilinna http://metamod-p.sourceforge.net/ compiled: May 30 2013, 11:41:16 EET (optimized)
- Meta модули
-
Код:Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] VoiceTranscoder RUN - VoiceTranscoder. v2017RC4 ini ANY ANY
[ 2] AMX Mod X RUN - amxmodx_mm_i386. v1.9.0.5 ini Start ANY
[ 3] SafeNameAndChat RUN - SafeNameAndChat. v1.1 ini ANY ANY
[ 4] Reunion RUN - reunion_mm_i386. v0.1.0.9 ini Start Never
[ 5] ReAuthCheck RUN - reauthcheck_mm_i v0.1.6 ini Start Never
[ 6] Rechecker RUN - rechecker_mm_i38 v2.5 ini Chlvl ANY
[ 7] WHBlocker RUN - whblocker_mm_i38 v1.5.696 ini Chlvl ANY
[ 8] ReSemiclip RUN - resemiclip_mm_i3 v2.3.9 ini Chlvl ANY
[ 9] MySQL RUN - mysql_amxx_i386. v1.9.0.5 pl2 ANY ANY
[10] ReAimDetector RUN - reaimdetector_am v0.2.2 pl2 ANY Never
[11] FakeMeta RUN - fakemeta_amxx_i3 v1.9.0.5 pl2 ANY ANY
[12] ReAPI RUN - reapi_amxx_i386. v5.11.0. pl2 ANY Never
[13] Engine RUN - engine_amxx_i386 v1.9.0.5 pl2 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx v1.9.0.5 pl2 ANY ANY
[15] SxGeo RUN - sxgeo_amxx_i386. v2.2 pl2 ANY Never
[16] CStrike RUN - cstrike_amxx_i38 v1.9.0.5 pl2 ANY ANY
[17] CSX RUN - csx_amxx_i386.so v1.9.0.5 pl2 ANY ANY
[18] Fun RUN - fun_amxx_i386.so v1.9.0.5 pl2 ANY ANY
18 plugins, 18 running
- Плагины
-
Код:Currently loaded plugins:
name version author file status
[ 1] GameCMS_API 5.3.5 zhorzh78 gamecms_api_5.3 running
[ 2] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 3] FreshBans 1.4.2b kanagava fresh_bans_142_ running
[ 4] WebHS 0.1 kanagava fb_web_online.a running
[ 5] GameCMS_GagManager 2.2.3 zhorzh78 gamecms_gagmana running
[ 6] [ReAMX] AdminCmd RBS 19.11.04 SKAJIbnEJIb & AM admincmd_rbs.am running
[ 7] Menus Front-End 18.12.18 AMXX Dev Team & amxmodmenu_rbs. running
[ 8] Map Manager: Core 3.0.4 Mistrick map_manager_cor running
[ 9] Map Manager: Scheduler 0.1.2 Mistrick map_manager_sch running
[ 10] Map Manager: Effects 0.0.8 Mistrick map_manager_eff running
[ 11] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 12] Map Manager: Nominatio 0.1.0 Mistrick map_manager_nom running
[ 13] Map Manager: Rtv 0.1.0 Mistrick map_manager_rtv running
[ 14] Maps Menu 1.4.1 neugomon mapsmenu.amxx running
[ 15] Restrict Weapons 1.9.0.5262 AMXX Dev Team restmenu.amxx running
[ 16] Mockery Of Players 15.07.15 Sanlerus mockery_of_play running
[ 17] Menu System 0.1.2 serfreeman1337 menuSystem.amxx running
[ 18] [SxGeo] Connect Info 1.0 s1lent sxgeo_connect_i running
[ 19] Chat Manager 1.1.2-16 Mistrick chatmanager.amx running
[ 20] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 21] Advanced Experience Sy 0.5 Vega serfreeman1337 aes_main.amxx running
[ 22] AES: CStrike Addon 0.5 Vega serfreeman1337 aes_exp_cstrike running
[ 23] AES: Admin Tools 0.5 Vega serfreeman1337 aes_exp_editor. running
[ 24] AES: Informer 0.5 Vega serfreeman1337 aes_informer.am running
[ 25] AES: StatsX 0.5.9 [REA serfreeman1337/s aes_statsx_cstr running
[ 26] [ReAPI] Info Killer 0.0.6 Jumper Info_Killer.amx running
[ 27] Stats Configuration 1.9.0.5262 AMXX Dev Team statscfg.amxx running
[ 28] Advanced Kill Assists 0.9 Spection next21_kill_ass running
[ 29] [ReAMX] Ultimate Weapo 19.11.02 SKAJIbnEJIb ultimate_weapon running
[ 30] ReTalisman 1.4.2 gyxoBka ReTalisman.amxx running
[ 31] [ReAMX] Ultimate Model 19.09.20 SKAJIbnEJIb ultimate_models running
[ 32] [ReAMX] VIP RBS 19.11.02 SKAJIbnEJIb vip_rbs.amxx running
[ 33] [ReAMX] Stimulation RB 19.11.02 SKAJIbnEJIb stimulation_rbs running
[ 34] [ReAPI] Block 'Fire in 0.0.1 sergrib reapi_block_FIT running
[ 35] [ReAPI] Silly C4 2.0 F@ntoM & Cheap_S reapi_sillyc4.a running
[ 36] Parachute Lite [ReAPI] 11.0 Leo_[BH] parachute_lite. running
[ 37] Mode 2x2 2.5re s1lent mode.amxx running
[ 38] [ReAPI] Damager 1.1 phe damager_1.amxx running
[ 39] AFK Control ReNew 1.2(a) neygomon afk_control.amx running
[ 40] [ReAPI] No Team Flash 0.0.3 Vaqtincha no_team_flash.a running
[ 41] [ReAMX] Snipers RBS 19.09.10 SKAJIbnEJIb snipers_rbs.amx running
[ 42] [ReAPI] Round Balancer 1.1 neygomon round_balancer. running
[ 43] Lite Admin ESP 1.1 neygomon, AcE admin_esp.amxx running
[ 44] C4 Timer on roundtime 0.3.3a neygomon c4timer.amxx running
[ 45] [Re] Reset Score ReFre 0.0.1 wopox1337@Dev-CS ResetScore_ReFr running
[ 46] Reklama 09.07.2019 mx?! reklama.amxx running
[ 47] NY Kill Sprite 1.0 BadMandarin NYKillSprite.am running
[ 48] [ReAMX] Cvar on Map 18.05.29 SKAJIbnEJIb cvar_on_map.amx running
[ 49] Models Replacement 0.0.2 ConnorMcLeod | V models_replacem running
[ 50] Health Grenade 1.2.8 Radius health_grenade. running
[ 51] [ReAPI] Random Weapons 2.4.9 neugomon/h1k3 random_weapons_ stopped
51 plugins, 50 running
- Amxx Модули
-
Код:# :
#
# N
# 1 MySQL 1.9.0.5262 AMX Mod X Dev running
# 2 ReAimDetector 0.2.2 ReHLDS Team running
# 3 FakeMeta 1.9.0.5262 AMX Mod X Dev running
# 4 ReAPI 5.11.0.190-dev Asmodai & s1le running
# 5 Engine 1.9.0.5262 AMX Mod X Dev running
# 6 Ham Sandwich 1.9.0.5262 AMX Mod X Dev running
# 7 SxGeo 2.2 s1lent running
# 8 CStrike 1.9.0.5262 AMX Mod X Dev running
# 9 CSX 1.9.0.5262 AMX Mod X Dev running
# 10 Fun 1.9.0.5262 AMX Mod X Dev running
# 11 nVault 1.9.0.5262 AMX Mod X Dev running
# 12 Sockets2 1.8.1.3746 HLSW Dev Team running
# 13 RegEx 1.9.0.5262 AMX Mod X Dev running
# 14 Sockets 1.9.0.5262 AMX Mod X Dev running
#
# 14
- Ошибка
-
Код:Не выпускет ножи когда амулет у игрока и не наносит ему урон когда в него метают
- Исходник
-
Код:#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <fun>
#include <gamecms5>
new const szPluginInfo[][] = {"Throwing Knives", "1.0", "Autor + ApXuTekToR"};
enum _:KNIFE_MODEL {
MODELS_KNIFE = 1,
}
new g_szModel[KNIFE_MODEL][64];
new bool:knifeout[33];
new bool:roundfreeze;
new Float:tossdelay[33];
new knifeammo[33];
new holdammo[33];
public plugin_init()
{
register_event("ResetHUD","new_spawn","b");
register_event("CurWeapon","check_knife","b","1=1");
register_event("DeathMsg", "player_death", "a");
register_logevent("round_start", 2, "1=Round_Start");
register_logevent("round_end", 2, "1=Round_End");
register_clcmd("throw_knife","throw_knifes"); // Команда для ментания ножей
register_concmd("amx_tknives","admin_tknife"); // Вкл/Выкл для админа
register_clcmd("say /knifehelp", "knife_help"); // Помощь
register_clcmd("say","HandleSay");
register_cvar("amx_throwknives","1"); // включить/выключить плагин
register_cvar("amx_checkaccess", "1"); // Кому будут доступны метательные ножи?
// '0' - Всем.
// '1' - Только по флагу доступа
// '2' - Только по названию услуги
// '3' - По флагу или услуге
register_cvar("amx_checkflags", ""); // Если 'amx_checkaccess' = '1' или '3', то какой флаг должен быть у игрока?
register_cvar("amx_checkservice", "_throw_knife"); // Если 'amx_checkaccess' = '2' или '3', то какое название услуги должно быть?
// (Обязательно в начале услуги должен быть знак '_' - нижнее подчеркивание)
register_cvar("amx_flagaccess", "l"); // Флаг доступа для Включения/Выключения метательных ножей (по умолчанию - l)
register_cvar("amx_knifeammo", "5"); // количество ножей, которые будут даны при старте раунда (по умолчанию - 5)
register_cvar("amx_knifetossforce","1200"); // сила с которую брошен нож; 200 или выше (по умолчанию - 1200)
register_cvar("amx_maxknifeammo","10"); // максимальное количество ножей, которые игрок может носить (по умолчанию - 10)
register_cvar("amx_knifedmg","25"); // урон, наносимый брошенным ножом (по умолчанию - 25)
register_cvar("amx_dropknives","1"); // выбросить или нет ножи после смерти (по умолчанию - 1)
register_cvar("amx_knifeautoswitch","1"); // автоматический переключатель
register_cvar("amx_tknifelog","0"); // устанавливает вид сообщения в логе; 1-брошенным ножом, 0-ножом (по умолчанию - 0)
check_cvars();
}
public plugin_cfg()
{
if(is_plugin_loaded("GameCMS_API") == INVALID_PLUGIN_ID)
{
log_amx("WARNING: gamecms_api.amxx isn't loaded! Plugin Stopped.");
pause("a");
return;
}
}
public plugin_precache()
{
new szConfigsDir[256];
get_localinfo("amxx_configsdir", szConfigsDir, charsmax(szConfigsDir));
server_cmd("exec %s/SevCorp/ThrowingKnives.cfg", szConfigsDir);
server_exec();
register_plugin(szPluginInfo[0], szPluginInfo[1], szPluginInfo[2]);
precache_sound("weapons/knife_hitwall1.wav");
precache_sound("weapons/knife_hit4.wav");
precache_sound("weapons/knife_deploy1.wav");
precache_model("models/w_knifepack.mdl");
LOAD_CONFIGURATION();
}
public knife_help(id) {
static CheckAccess, AccessFlags[16], AccessService[32];
CheckAccess = get_cvar_num("amx_checkaccess");
get_cvar_string("amx_checkflags", AccessFlags, charsmax(AccessFlags));
get_cvar_string("amx_checkservice", AccessService, charsmax(AccessService));
static Array:Services;
Services = cmsapi_get_user_services(id, "", AccessService);
if(CheckAccess == 0) {
client_print_color(id, 0, "^3[^4Knife^3] ^1У вас есть метательные ножи. ^3Кол-во^1: ^4%d^1", knifeammo[id]);
client_print_color(id, 0, "^3[^4Knife^3] ^1Метать ножи, пишите в консоль: ^3bind ^1^"^4Кнопка^1^" ^1^"^4throw_knife^1^"");
} else if(CheckAccess == 1) {
if(checkAccess(id, AccessFlags)) {
client_print_color(id, 0, "^3[^4Knife^3] ^1У вас есть метательные ножи. ^3Кол-во^1: ^4%d^1", knifeammo[id]);
client_print_color(id, 0, "^3[^4Knife^3] ^1Метать ножи, пишите в консоль: ^3bind ^1^"^4Кнопка^1^" ^1^"^4throw_knife^1^"");
}
} else if(CheckAccess == 2) {
if(Services){
client_print_color(id, 0, "^3[^4Knife^3] ^1У вас есть метательные ножи. ^3Кол-во^1: ^4%d^1", knifeammo[id]);
client_print_color(id, 0, "^3[^4Knife^3] ^1Метать ножи, пишите в консоль: ^3bind ^1^"^4Кнопка^1^" ^1^"^4throw_knife^1^"");
}
} else if(CheckAccess == 3) {
if(checkAccess(id, AccessFlags) || Services) {
client_print_color(id, 0, "^3[^4Knife^3] ^1У вас есть метательные ножи. ^3Кол-во^1: ^4%d^1", knifeammo[id]);
client_print_color(id, 0, "^3[^4Knife^3] ^1Метать ножи, пишите в консоль: ^3bind ^1^"^4Кнопка^1^" ^1^"^4throw_knife^1^"");
}
}
}
public check_cvars() {
if (get_cvar_num("amx_knifeammo") > get_cvar_num("amx_maxknifeammo")) {
server_print("[AMXX] 'amx_knifeammo' не может быть больше, чем 'amx_maxknifeammo', устанавливаю 'amx_maxknifeammo' = 'amx_knifeammo'");
set_cvar_num("amx_maxknifeammo", get_cvar_num("amx_knifeammo"));
}
if (get_cvar_num("amx_knifedmg") < 1 ) {
server_print("[AMXX] 'amx_knifedmg' не может быть установлен ниже '1'.Устанавливаю 'amx_knifedmg' = '1'");
set_cvar_num("amx_knifedmg", 1);
}
if (get_cvar_num("amx_knifetossforce") < 200 ) {
server_print("[AMXX] 'amx_knifetossforce' не может быть установлен ниже, чем 200. Устанавливаю '200'");
set_cvar_num("amx_knifetossforce", 200);
}
}
public throw_knifes(id) {
static CheckAccess, AccessFlags[16], AccessService[32];
CheckAccess = get_cvar_num("amx_checkaccess");
get_cvar_string("amx_checkflags", AccessFlags, charsmax(AccessFlags));
get_cvar_string("amx_checkservice", AccessService, charsmax(AccessService));
static Array:Services;
Services = cmsapi_get_user_services(id, "", AccessService);
if(CheckAccess == 0) {
command_knife(id);
} else if(CheckAccess == 1) {
if(checkAccess(id, AccessFlags)) {
command_knife(id);
}
} else if(CheckAccess == 2) {
if(Services){
command_knife(id);
}
} else if(CheckAccess == 3) {
if(checkAccess(id, AccessFlags) || Services) {
command_knife(id);
}
}
}
public player_death() {
new id = read_data(2);
knife_drop(id);
}
public HandleSay(id) {
new Speech[192];
read_args(Speech,192);
remove_quotes(Speech);
if(!equal(Speech, "vote",4) && ((containi(Speech, "knife") != -1) || (containi(Speech, "knives") != -1))) {
if(get_cvar_num("amx_throwknives") == 1) {
client_print_color(id, 0, "^3[^4Knife^3] ^1Метательные ножи ^4Включены^3!");
}
else {
client_print_color(id, 0, "^3[^4Knife^3] ^1Метательные ножи ^4Выключены");
}
}
}
public knife_drop(id) {
if(!get_cvar_num("amx_dropknives") || knifeammo[id] <= 0 || !get_cvar_num("amx_throwknives")) return;
new Float:Origin[3], Float:Velocity[3];
entity_get_vector(id, EV_VEC_origin, Origin);
new knifedrop = create_entity("info_target");
if(!knifedrop) return;
entity_set_string(knifedrop, EV_SZ_classname, "knife_pickup");
entity_set_model(knifedrop, "models/w_knifepack.mdl");
new Float:MinBox[3] = {-1.0, -1.0, -1.0}
new Float:MaxBox[3] = {1.0, 1.0, 1.0}
entity_set_vector(knifedrop, EV_VEC_mins, MinBox);
entity_set_vector(knifedrop, EV_VEC_maxs, MaxBox);
entity_set_origin(knifedrop, Origin);
entity_set_int(knifedrop, EV_INT_effects, 32);
entity_set_int(knifedrop, EV_INT_solid, 1);
entity_set_int(knifedrop, EV_INT_movetype, 6);
entity_set_edict(knifedrop, EV_ENT_owner, id);
VelocityByAim(id, 400 , Velocity);
entity_set_vector(knifedrop, EV_VEC_velocity ,Velocity);
holdammo[id] = knifeammo[id];
knifeammo[id] = 0;
}
public check_knife(id) {
if(!get_cvar_num("amx_throwknives")) return;
new weapon = read_data(2);
static CheckAccess, AccessFlags[16], AccessService[32];
CheckAccess = get_cvar_num("amx_checkaccess");
get_cvar_string("amx_checkflags", AccessFlags, charsmax(AccessFlags));
get_cvar_string("amx_checkservice", AccessService, charsmax(AccessService));
static Array:Services;
Services = cmsapi_get_user_services(id, "", AccessService);
if(CheckAccess == 0) {
if(weapon == CSW_KNIFE) {
knifeout[id] = true;
client_print(id, print_center, "В наличии %d %s", knifeammo[id], knifeammo[id] == 1 ? "нож" : "ножей");
} else {
knifeout[id] = false;
}
} else if(CheckAccess == 1) {
if(checkAccess(id, AccessFlags)) {
if(weapon == CSW_KNIFE) {
knifeout[id] = true;
client_print(id, print_center, "В наличии %d %s", knifeammo[id], knifeammo[id] == 1 ? "нож" : "ножей");
} else {
knifeout[id] = false;
}
}
} else if(CheckAccess == 2) {
if(Services){
if(weapon == CSW_KNIFE) {
knifeout[id] = true;
client_print(id, print_center, "В наличии %d %s", knifeammo[id], knifeammo[id] == 1 ? "нож" : "ножей");
} else {
knifeout[id] = false;
}
}
} else if(CheckAccess == 3) {
if(checkAccess(id, AccessFlags) || Services) {
if(weapon == CSW_KNIFE) {
knifeout[id] = true;
client_print(id, print_center, "В наличии %d %s", knifeammo[id], knifeammo[id] == 1 ? "нож" : "ножей");
} else {
knifeout[id] = false;
}
}
}
}
public kill_all_entity(classname[]) {
new iEnt = find_ent_by_class(-1, classname);
new tEnt;
while(iEnt > 0) {
tEnt = iEnt;
iEnt = find_ent_by_class(iEnt, classname);
remove_entity(tEnt);
}
}
public new_spawn(id) {
static CheckAccess, AccessFlags[16], AccessService[32];
CheckAccess = get_cvar_num("amx_checkaccess");
get_cvar_string("amx_checkflags", AccessFlags, charsmax(AccessFlags));
get_cvar_string("amx_checkservice", AccessService, charsmax(AccessService));
static Array:Services;
Services = cmsapi_get_user_services(id, "", AccessService);
if(CheckAccess == 0) {
if(knifeammo[id] < get_cvar_num("amx_knifeammo")) knifeammo[id] = get_cvar_num("amx_knifeammo");
if(knifeammo[id] > get_cvar_num("amx_maxknifeammo")) knifeammo[id] = get_cvar_num("amx_maxknifeammo");
tossdelay[id] = 0.0;
} else if(CheckAccess == 1) {
if(checkAccess(id, AccessFlags)) {
if(knifeammo[id] < get_cvar_num("amx_knifeammo")) knifeammo[id] = get_cvar_num("amx_knifeammo");
if(knifeammo[id] > get_cvar_num("amx_maxknifeammo")) knifeammo[id] = get_cvar_num("amx_maxknifeammo");
tossdelay[id] = 0.0;
}
} else if(CheckAccess == 2) {
if(Services){
if(knifeammo[id] < get_cvar_num("amx_knifeammo")) knifeammo[id] = get_cvar_num("amx_knifeammo");
if(knifeammo[id] > get_cvar_num("amx_maxknifeammo")) knifeammo[id] = get_cvar_num("amx_maxknifeammo");
tossdelay[id] = 0.0;
}
} else if(CheckAccess == 3) {
if(checkAccess(id, AccessFlags) || Services) {
if(knifeammo[id] < get_cvar_num("amx_knifeammo")) knifeammo[id] = get_cvar_num("amx_knifeammo");
if(knifeammo[id] > get_cvar_num("amx_maxknifeammo")) knifeammo[id] = get_cvar_num("amx_maxknifeammo");
tossdelay[id] = 0.0;
}
}
}
public client_connect(id) {
static CheckAccess, AccessFlags[16], AccessService[32];
CheckAccess = get_cvar_num("amx_checkaccess");
get_cvar_string("amx_checkflags", AccessFlags, charsmax(AccessFlags));
get_cvar_string("amx_checkservice", AccessService, charsmax(AccessService));
static Array:Services;
Services = cmsapi_get_user_services(id, "", AccessService);
if(CheckAccess == 0) {
knifeammo[id] = get_cvar_num("amx_knifeammo");
holdammo[id] = 0;
tossdelay[id] = 0.0;
knifeout[id] = false;
} else if(CheckAccess == 1) {
if(checkAccess(id, AccessFlags)) {
knifeammo[id] = get_cvar_num("amx_knifeammo");
holdammo[id] = 0;
tossdelay[id] = 0.0;
knifeout[id] = false;
}
} else if(CheckAccess == 2) {
if(Services){
knifeammo[id] = get_cvar_num("amx_knifeammo");
holdammo[id] = 0;
tossdelay[id] = 0.0;
knifeout[id] = false;
}
} else if(CheckAccess == 3) {
if(checkAccess(id, AccessFlags) || Services) {
knifeammo[id] = get_cvar_num("amx_knifeammo");
holdammo[id] = 0;
tossdelay[id] = 0.0;
knifeout[id] = false;
}
}
}
public client_disconnected(id) {
knifeammo[id] = 0;
holdammo[id] = 0;
tossdelay[id] = 0.0;
knifeout[id] = false;
}
public round_start() {
roundfreeze = false;
}
public round_end() {
roundfreeze = true;
kill_all_entity("throwing_knife");
kill_all_entity("knife_pickup");
}
public vexd_pfntouch(pToucher, pTouched) {
if (!is_valid_ent(pToucher) || !get_cvar_num("amx_throwknives")) return;
new Classname[32];
entity_get_string(pToucher, EV_SZ_classname, Classname, 31);
new owner = entity_get_edict(pToucher, EV_ENT_owner);
new Float:kOrigin[3]
entity_get_vector(pToucher, EV_VEC_origin, kOrigin);
if(equal(Classname,"knife_pickup")) {
if ( !is_valid_ent(pTouched) ) return;
check_cvars();
new Class2[32];
entity_get_string(pTouched, EV_SZ_classname, Class2, 31);
if(!equal(Class2,"player") || knifeammo[pTouched] >= get_cvar_num("amx_maxknifeammo")) return;
if((knifeammo[pTouched] + holdammo[owner]) > get_cvar_num("amx_maxknifeammo")) {
holdammo[owner] -= get_cvar_num("amx_maxknifeammo") - knifeammo[pTouched];
knifeammo[pTouched] = get_cvar_num("amx_maxknifeammo");
emit_sound(pToucher, CHAN_ITEM, "weapons/knife_deploy1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
}
else {
knifeammo[pTouched] += holdammo[owner];
emit_sound(pToucher, CHAN_ITEM, "weapons/knife_deploy1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
remove_entity(pToucher);
}
client_print(pTouched, print_center, "В наличии: %i ножей",knifeammo[pTouched]);
}
else if(equal(Classname,"throwing_knife")) {
check_cvars();
if(is_user_alive(pTouched)) {
new movetype = entity_get_int(pToucher, EV_INT_movetype);
if(movetype == 0 && knifeammo[pTouched] < get_cvar_num("amx_maxknifeammo")) {
if(knifeammo[pTouched] < get_cvar_num("amx_maxknifeammo")) knifeammo[pTouched] += 1;
client_print(pTouched,print_center,"В наличии: %i ножей",knifeammo[pTouched]);
emit_sound(pToucher, CHAN_ITEM, "weapons/knife_deploy1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
remove_entity(pToucher);
}
else if (movetype != 0) {
if(owner == pTouched) return;
remove_entity(pToucher);
if(get_cvar_num("mp_friendlyfire") == 0 && get_user_team(pTouched) == get_user_team(owner)) return;
new pTdead[33];
entity_set_float(pTouched, EV_FL_dmg_take, get_cvar_num("amx_knifedmg") * 1.0);
if((get_user_health(pTouched) - get_cvar_num("amx_knifedmg")) <= 0) {
pTdead[pTouched] = 1;
}
else {
set_user_health(pTouched, get_user_health(pTouched) - get_cvar_num("amx_knifedmg"));
}
if(get_user_team(pTouched) == get_user_team(owner)) {
new name[33];
get_user_name(owner, name, charsmax(name));
client_print_color(0, 0, "^3[^4Knife^3] ^4%s ^1атаковал товарища^4! ^1Потому что ^3Гнида^1!", name);
}
emit_sound(pTouched, CHAN_ITEM, "weapons/knife_hit4.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
if(pTdead[pTouched]) {
if(get_user_team(pTouched) == get_user_team(owner)) {
set_user_frags(owner, get_user_frags(owner) - 1);
client_print(owner,print_center,"You killed a teammate");
}
else {
set_user_frags(owner, get_user_frags(owner) + 1);
}
new gmsgScoreInfo = get_user_msgid("ScoreInfo");
new gmsgDeathMsg = get_user_msgid("DeathMsg");
set_msg_block(gmsgDeathMsg,BLOCK_ONCE);
set_msg_block(gmsgScoreInfo,BLOCK_ONCE);
user_kill(pTouched,1);
message_begin(MSG_ALL,gmsgScoreInfo);
write_byte(owner);
write_short(get_user_frags(owner));
write_short(get_user_deaths(owner));
write_short(0);
write_short(get_user_team(owner));
message_end();
message_begin(MSG_ALL,gmsgScoreInfo);
write_byte(pTouched);
write_short(get_user_frags(pTouched));
write_short(get_user_deaths(pTouched));
write_short(0);
write_short(get_user_team(pTouched));
message_end();
message_begin(MSG_ALL,gmsgDeathMsg,{0,0,0},0);
write_byte(owner);
write_byte(pTouched);
write_byte(0);
write_string("knife");
message_end();
new tknifelog[16]
if (get_cvar_num("amx_tknifelog")) tknifelog = "throwing_knife";
else tknifelog = "knife";
new namea[32], authida[35], teama[32];
new namev[32], authidv[35], teamv[32];
get_user_name(owner, namea, charsmax(namea));
get_user_authid(owner, authida, charsmax(authida));
get_user_team(owner, teama, charsmax(teama));
get_user_name(pTouched, namev, charsmax(namev));
get_user_authid(pTouched, authidv, charsmax(authidv));
get_user_team(pTouched, teamv, charsmax(teamv));
log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"", namea, get_user_userid(owner), authida, teama, namev, get_user_userid(pTouched), authidv, teamv, tknifelog);
}
}
}
else {
entity_set_int(pToucher, EV_INT_movetype, 0);
emit_sound(pToucher, CHAN_ITEM, "weapons/knife_hitwall1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
}
}
}
public command_knife(id) {
if(!is_user_alive(id) || !get_cvar_num("amx_throwknives") || roundfreeze) return PLUGIN_HANDLED;
if(get_cvar_num("amx_knifeautoswitch")) {
knifeout[id] = true;
client_cmd(id,"weapon_knife");
}
if(!knifeammo[id]) client_print(id,print_center,"У Вас закончились ножи", knifeammo[id]);
if(!knifeout[id] || !knifeammo[id]) return PLUGIN_HANDLED;
if(tossdelay[id] > get_gametime() - 0.5) return PLUGIN_HANDLED;
else tossdelay[id] = get_gametime();
knifeammo[id]--;
if (knifeammo[id] == 1) {
client_print(id, print_center, "В наличии: %i нож",knifeammo[id]);
}
else {
client_print(id, print_center, "В наличии: %i ножей",knifeammo[id]);
}
new Float: Origin[3], Float: Velocity[3], Float: vAngle[3], Ent;
entity_get_vector(id, EV_VEC_origin , Origin);
entity_get_vector(id, EV_VEC_v_angle, vAngle);
Ent = create_entity("info_target");
if (!Ent) return PLUGIN_HANDLED;
entity_set_string(Ent, EV_SZ_classname, "throwing_knife");
entity_set_model(Ent, g_szModel[MODELS_KNIFE]);
new Float:MinBox[3] = {-1.0, -7.0, -1.0};
new Float:MaxBox[3] = {1.0, 7.0, 1.0};
entity_set_vector(Ent, EV_VEC_mins, MinBox);
entity_set_vector(Ent, EV_VEC_maxs, MaxBox);
vAngle[0] -= 90;
entity_set_origin(Ent, Origin);
entity_set_vector(Ent, EV_VEC_angles, vAngle);
entity_set_int(Ent, EV_INT_effects, 2);
entity_set_int(Ent, EV_INT_solid, 1);
entity_set_int(Ent, EV_INT_movetype, 6);
entity_set_edict(Ent, EV_ENT_owner, id);
VelocityByAim(id, get_cvar_num("amx_knifetossforce") , Velocity);
entity_set_vector(Ent, EV_VEC_velocity ,Velocity);
return PLUGIN_HANDLED;
}
public admin_tknife(id,level,cid){
new Access[16];
get_cvar_string("amx_flagaccess", Access, charsmax(Access))
if(!(checkAccess(id, Access))) {
client_print_color(id, 0, "^3[^4Knife^3] ^3У Вас нет доступа к данной команде^4!");
return PLUGIN_HANDLED;
}
new authid[35],name[32];
get_user_authid(id,authid,34);
get_user_name(id,name,31);
if(get_cvar_num("amx_throwknives") == 0){
set_cvar_num("amx_throwknives", 1);
client_print_color(0, 0,"^3[^4Knife^3] ^1Администратор ^4Включил ^1метательные ножи");
console_print(id, "[Knife] Вы Включили метание ножей");
log_amx("Админ: ^"%s<%d><%s>^" Включил метательные ножи", name, get_user_userid(id), authid);
}
else {
set_cvar_num("amx_throwknives", 0);
client_print_color(0, 0,"^3[^4Knife^3] ^1Администратор ^4ВЫключил ^1метательные ножи");
console_print(id,"[Knife] Вы Выключили метание ножей");
log_amx("Админ: ^"%s<%d><%s>^" Выключил метательные ножи", name, get_user_userid(id), authid);
}
return PLUGIN_HANDLED;
}
LOAD_CONFIGURATION()
{
new szCfgDir[128], szCfgFile[128];
get_localinfo("amxx_configsdir", szCfgDir, charsmax(szCfgDir));
formatex(szCfgFile, charsmax(szCfgFile), "%s/SevCorp/ThrowingKnives.cfg", szCfgDir);
if(!file_exists(szCfgFile)) {
new szError[100];
formatex(szError, charsmax(szError), "Отсутсвтует: %s!", szCfgFile);
set_fail_state(szError);
return;
}
new szBuffer[128], szKey[64], szValue[960];
new iFile = fopen(szCfgFile, "rt");
while(iFile && !feof(iFile)) {
fgets(iFile, szBuffer, charsmax(szBuffer));
replace(szBuffer, charsmax(szBuffer), "^n", "");
if(!szBuffer[0] || szBuffer[0] == ';' || szBuffer[0] == '{' || szBuffer[0] == '}' || szBuffer[0] == '#' || szBuffer[0] == '[' || szBuffer[0] == ']') continue;
parse(szBuffer, szKey, charsmax(szKey), szValue, charsmax(szValue));
trim(szKey);
trim(szValue);
if(equal(szKey, "MODELS_KNIFE")) formatex(g_szModel[MODELS_KNIFE], charsmax(g_szModel[]), szValue);
}
fclose(iFile);
PRECACHE_MODELS();
}
PRECACHE_MODELS()
{
new i, szBuffer[64];
for(i = 0; i < sizeof(g_szModel); i++) {
formatex(szBuffer, charsmax(szBuffer), "%s", g_szModel);
engfunc(EngFunc_PrecacheModel, szBuffer);
}
}
checkAccess(id, const flags[]) {
return (get_user_flags(id) & read_flags(flags));
}
Всем доброго времени суток! У меня вот в чем беда. Стоит плагин амулет и когда амулет у игрока, он не дает кидать ножи игроку и когда в него кидают ХП не снимается. Как будто бы ножи застряют в нем. Фиксаните пожалуйста. Если у вас есть минутка свободная или минутки
Ссылка на модель амулета: TpaBA.mdl
Автор плагина талисмана сказал:
Ссылка на модель амулета: TpaBA.mdl
Автор плагина талисмана сказал:
Класснейм талисмана "talisman
Последнее редактирование модератором: