Проверка флага каждый раунд для Knife Menu

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
18
Реакции
0
Ошибка
нож остается даже когда вип игрок сменяет ник, а другой заходить под его ником
ОС
Windows
Amx Mod X
AMX Mod X 1.9.0.5271 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Jun 24 2020 13:53:37
Built from: https://github.com/alliedmodders/amxmodx/commit/5eea3e5b
Build ID: 5271:5eea3e5b
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.8.0.711-dev
Build date: 13:13:38 Feb 6 2021 (2492)
Build from: https://github.com/dreamstalker/rehlds/commit/722e19d
ReGamedll
ReGameDLL version: 5.20.0.492-dev
Build date: 15:26:35 Jan 4 2021
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/aae507c
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 15:47:38 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
Список метамодулей
не вижу смысла
Список плагинов
не вижу смысла
Автор плагина
#define AUTHOR "CaNiBaL"
Версия плагина
#define VERSION "0.2"
Исходный код
/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < fakemeta_util >
#include < hamsandwich >

#define PLUGIN "Knife Mod"
#define VERSION "0.2"
#define AUTHOR "CaNiBaL"

#define al(%1) is_user_alive(%1)
#define MAX_CHAR 512

#define KnifeVModel1 "models/knife_mod/v_knife_grav.mdl"
#define KnifeVModel2 "models/knife_mod/v_knife_speed.mdl"
#define KnifeVModel3 "models/knife_mod/v_knife_ezee.mdl"
#define KnifeVModel4 "models/knife_mod/v_knife_danger.mdl"
#define KnifeVModel5 "models/knife_mod/v_knife_speed_grav.mdl"
#define KnifePModel1 "models/knife_mod/p_knife_grav.mdl"
#define KnifePModel2 "models/knife_mod/p_knife_speed.mdl"
#define KnifePModel3 "models/knife_mod/p_knife_ezee.mdl"
#define KnifePModel4 "models/knife_mod/p_knife_danger.mdl"
#define KnifePModel5 "models/knife_mod/p_knife_speed_grav.mdl"

new iKey = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0

new cvar[33][7], onknife[33]

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

register_event("CurWeapon", "onActiveWeapon", "be", "1=1")
register_forward(FM_EmitSound, "sound_emit")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")

register_menu("Menu Shop Player", iKey, "menu_shopmenu")
register_clcmd("knife", "knife_menu")
}

public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
if (victim != attacker && is_user_connected(attacker))
{
if(get_user_weapon(attacker) == CSW_KNIFE && cvar[attacker][4] || cvar[attacker][5])
{
SetHamParamFloat(4, damage * 2)
}
}
}

public plugin_precache()
{
precache_model(KnifeVModel1)
precache_model(KnifePModel1)
precache_model(KnifeVModel2)
precache_model(KnifePModel2)
precache_model(KnifeVModel3)
precache_model(KnifePModel3)
precache_model(KnifeVModel4)
precache_model(KnifePModel4)
precache_model(KnifeVModel5)
precache_model(KnifePModel5)
precache_model("models/v_knife.mdl")
precache_model("models/p_knife.mdl")
precache_sound("knife_mod/knife1/1.wav")
precache_sound("knife_mod/knife1/2.wav")
precache_sound("knife_mod/knife1/3.wav")
precache_sound("knife_mod/knife1/4.wav")
precache_sound("knife_mod/knife1/draw.wav")
precache_sound("knife_mod/knife2/1.wav")
precache_sound("knife_mod/knife2/2.wav")
precache_sound("knife_mod/knife2/3.wav")
precache_sound("knife_mod/knife2/4.wav")
precache_sound("knife_mod/knife2/draw.wav")
precache_sound("knife_mod/knife3/1.wav")
precache_sound("knife_mod/knife3/2.wav")
precache_sound("knife_mod/knife3/3.wav")
precache_sound("knife_mod/knife3/4.wav")
precache_sound("knife_mod/knife3/draw.wav")
precache_sound("knife_mod/knife4/1.wav")
precache_sound("knife_mod/knife4/2.wav")
precache_sound("knife_mod/knife4/3.wav")
precache_sound("knife_mod/knife4/4.wav")
precache_sound("knife_mod/knife4/draw.wav")
precache_sound("knife_mod/knife5/1.wav")
precache_sound("knife_mod/knife5/2.wav")
precache_sound("knife_mod/knife5/3.wav")
precache_sound("knife_mod/knife5/4.wav")
precache_sound("knife_mod/knife5/draw.wav")
}

public knife_menu( id )
{
static menu[ MAX_CHAR ] , iLen
iLen = 0

new admin = (get_user_flags(id) & ADMIN_LEVEL_H)

if(cvar[id][1])
iLen = formatex( menu[ iLen ] , charsmax( menu ) - iLen , "\yKnife Mod^n\yНож: \rFlay^n\yСпособность: \rНизкая гравитация^n^n")
else if( cvar[id][2])
iLen = formatex( menu[ iLen ] , charsmax( menu ) - iLen , "\yKnife Mod^n\yНож: \rSpeed^n\yСпособность: \rВысокая скорость^n^n")
else if( cvar[id][3] )
iLen = formatex( menu[ iLen ] , charsmax( menu ) - iLen , "\yKnife Mod^n\yНож: \rEzee^n\yСпособность: \rТихий бег^n^n")
else if( cvar[id][4] )
iLen = formatex( menu[ iLen ] , charsmax( menu ) - iLen , "\yKnife Mod^n\yНож: \rDanger^n\yСпособность: \rДвойной урон^n^n")
else if( cvar[id][5] )
iLen = formatex( menu[ iLen ] , charsmax( menu ) - iLen , "\yKnife Mod^n\yНож:\r Normal^n\yСпособность: \rRegeneration^n^n")
else if( cvar[id][6] )
iLen = formatex( menu[ iLen ] , charsmax( menu ) - iLen , "\yKnife Mod^n\yНож:\r Extra^n\yСпособность: \rВсе параметры^n^n")
else
iLen = formatex( menu[ iLen ] , charsmax( menu ) - iLen , "\yKnife Mod^n\yНож: \rЕщо не выбран^n\yСпособность: \rНету^n^n")

iLen += formatex( menu[ iLen ] , charsmax( menu ) - iLen , "\r1. %s Flay \d[\rГравитация\d]^n" , !cvar[id][1] && al( id ) ? "\w" : "\d")
iLen += formatex( menu[ iLen ] , charsmax( menu ) - iLen , "\r2. %s Speed \d[\rСкорость\d]^n" , !cvar[id][2] && al( id )? "\w" : "\d")
iLen += formatex( menu[ iLen ] , charsmax( menu ) - iLen , "\r3. %s Ezee \d[\rТихий бег\d]^n" , !cvar[id][3] && al( id ) ? "\w" : "\d")
iLen += formatex( menu[ iLen ] , charsmax( menu ) - iLen , "\r4. %s Danger \d[\rДвойной урон\d]^n" , !cvar[id][4] && al( id ) ? "\w" : "\d")
iLen += formatex( menu[ iLen ] , charsmax( menu ) - iLen , "\r5. %s Normal \d[\rRegeneration\d]^n^n" ,!cvar[id][5] && al( id ) ? "\w" : "\d")
iLen += formatex( menu[ iLen ] , charsmax( menu ) - iLen , "\r6. %s Extra \d[\rADMIN\d]^n^n" ,admin && !cvar[id][6] && al( id ) ? "\w" : "\d")

iLen += formatex( menu[ iLen ] , charsmax( menu ) - iLen , "^n\r0. \wЗакрыть" )

//Блокируем нажатия на клавиш.
!cvar[id][1] && al( id ) ? ( iKey |= MENU_KEY_1 ) : ( iKey &= ~MENU_KEY_1 )
!cvar[id][2] && al( id ) ? ( iKey |= MENU_KEY_2 ) : ( iKey &= ~MENU_KEY_2 )
!cvar[id][3] && al( id ) ? ( iKey |= MENU_KEY_3 ) : ( iKey &= ~MENU_KEY_3 )
!cvar[id][4] && al( id ) ? ( iKey |= MENU_KEY_4 ) : ( iKey &= ~MENU_KEY_4 )
!cvar[id][5] && al( id ) ? ( iKey |= MENU_KEY_5 ) : ( iKey &= ~MENU_KEY_5 )
admin && !cvar[id][6] && al( id ) ? ( iKey |= MENU_KEY_6 ) : ( iKey &= ~MENU_KEY_6 )
al( id ) ? ( iKey |= MENU_KEY_9 ) : ( iKey &= ~MENU_KEY_9 )

show_menu( id , iKey , menu , -1 , "Menu Shop Player" )
return PLUGIN_CONTINUE
}

public menu_shopmenu(id, key)
{
switch(key)
{
case 0:
{
if( cvar[id][2] || cvar[id][5] || cvar[id][3] || cvar[id][4] || cvar[id][6])
{
cvar[id][2] = false
cvar[id][5] = false
cvar[id][3] = false
cvar[id][4] = false
cvar[id][6] = false
fm_set_user_maxspeed(id, 250.0)
set_user_footsteps(id, 0)
}
cvar[id][1] = true
onknife[id] = true
if(get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, KnifeVModel1)
set_pev(id, pev_weaponmodel2, KnifePModel1)
fm_set_user_gravity(id, 0.4)
onActiveWeapon(id)
}
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(200)
write_byte(0)
write_byte(75)
message_end()
}
case 1:
{
if( cvar[id][1] || cvar[id][5] || cvar[id][3] || cvar[id][4] || cvar[id][6])
{
cvar[id][1] = false
cvar[id][5] = false
cvar[id][3] = false
cvar[id][4] = false
cvar[id][6] = false
set_user_footsteps(id, 0)
fm_set_user_gravity(id, 1.0)
}
cvar[id][2] = true
onknife[id] = true
if(get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, KnifeVModel2)
set_pev(id, pev_weaponmodel2, KnifePModel2)
fm_set_user_maxspeed(id, 550.0)
onActiveWeapon(id)
}
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(200)
write_byte(50)
write_byte(75)
message_end()
}
case 2:
{
if( cvar[id][1] || cvar[id][5] || cvar[id][2] || cvar[id][4] || cvar[id][6])
{
cvar[id][1] = false
cvar[id][5] = false
cvar[id][2] = false
cvar[id][4] = false
cvar[id][6] = false
fm_set_user_maxspeed(id, 250.0)
fm_set_user_gravity(id, 1.0)
}
cvar[id][3] = true
onknife[id] = true
if(get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, KnifeVModel3)
set_pev(id, pev_weaponmodel2, KnifePModel3)
set_user_footsteps(id, 1)
onActiveWeapon(id)
}
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(0)
write_byte(250)
write_byte(200)
message_end()
}
case 3:
{
if( cvar[id][1] || cvar[id][5] || cvar[id][3] || cvar[id][4] || cvar[id][6])
{
cvar[id][1] = false
cvar[id][5] = false
cvar[id][3] = false
cvar[id][2] = false
cvar[id][6] = false
set_user_footsteps(id, 0)
fm_set_user_maxspeed(id, 250.0)
fm_set_user_gravity(id, 1.0)
}
cvar[id][4] = true
onknife[id] = true
if(get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, KnifeVModel3)
set_pev(id, pev_weaponmodel2, KnifePModel3)
fm_set_user_maxspeed(id, 200.0)
onActiveWeapon(id)
}
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(10)
write_byte(110)
write_byte(255)
message_end()
}
case 4:
{
if( cvar[id][1] || cvar[id][2] || cvar[id][3] || cvar[id][4] || cvar[id][6])
{
cvar[id][1] = false
cvar[id][2] = false
cvar[id][3] = false
cvar[id][4] = false
cvar[id][6] = false
}
cvar[id][5] = true
onknife[id] = false
if(get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/v_knife.mdl")
set_pev(id, pev_weaponmodel2, "models/p_knife.mdl")
set_task(1.0, "regen", id, _, _, "b")
onActiveWeapon(id)
}
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(110)
write_byte(10)
write_byte(255)
message_end()
}
case 5:
{
if( cvar[id][1] || cvar[id][2] || cvar[id][3] || cvar[id][4] || cvar[id][5])
{
cvar[id][1] = false
cvar[id][2] = false
cvar[id][3] = false
cvar[id][4] = false
cvar[id][5] = false
}
cvar[id][6] = true
onknife[id] = true
if(get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, KnifeVModel3)
set_pev(id, pev_weaponmodel2, KnifePModel3)
set_task(1.0, "regen", id, _, _, "b")
fm_set_user_gravity(id, 0.4)
fm_set_user_maxspeed(id, 550.0)
set_user_footsteps(id, 1)
onActiveWeapon(id)
}
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(90)
write_byte(90)
write_byte(0)
message_end()
}
}
}

public onActiveWeapon(id)
{
if(!is_user_alive(id))
return

if(cvar[id][1] && get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, KnifeVModel1)
set_pev(id, pev_weaponmodel2, KnifePModel1)
fm_set_user_gravity(id, 0.4)
}
else if(cvar[id][2] && get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, KnifeVModel2)
set_pev(id, pev_weaponmodel2, KnifePModel2)
fm_set_user_maxspeed(id, 550.0)
}
else if(cvar[id][3] && get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, KnifeVModel3)
set_pev(id, pev_weaponmodel2, KnifePModel3)
set_user_footsteps(id, 1)
}
else if(cvar[id][4] && get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, KnifeVModel4)
set_pev(id, pev_weaponmodel2, KnifePModel4)
fm_set_user_maxspeed(id, 200.0)
}
else if(cvar[id][5] && get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/v_knife.mdl")
set_pev(id, pev_weaponmodel2, "models/p_knife.mdl")
set_task(1.0, "regen", id, _, _, "b")
fm_set_user_maxspeed(id, 250.0)
fm_set_user_gravity(id, 1.0)
set_user_footsteps(id, 0)
}
else if(cvar[id][6] && get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, KnifeVModel5)
set_pev(id, pev_weaponmodel2, KnifePModel5)
fm_set_user_maxspeed(id, 550.0)
fm_set_user_gravity(id, 0.4)
set_user_footsteps(id, 1)
set_task(1.0, "regen", id, _, _, "b")
}
else
{
fm_set_user_maxspeed(id, 250.0)
fm_set_user_gravity(id, 1.0)
set_user_footsteps(id, 0)
remove_task(id)
}
}

public regen(id)
if(is_user_alive(id) && get_user_health(id) < 100)
fm_set_user_health(id, get_user_health(id) +2)

public sound_emit(id, channel, sample[])
{
new mode[33];
get_cvar_string("deathrun_mode", mode, 32);
if(equal(mode, "DUEL") || !is_user_alive(id) || !onknife[id] )
return PLUGIN_HANDLED

if (sample[8] == 'k' && sample[9] == 'n' && sample[10] == 'i')
{
if (sample[14] == 'd')
{
if(cvar[id][1])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife1/draw.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][2])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife2/draw.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][3])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife3/draw.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][4])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife4/draw.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][6])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife5/draw.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
}
else if (sample[14] == 'h')
{
if (sample[17] == 'w')
{
if(cvar[id][1])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife1/3.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][2])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife2/3.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][3])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife3/3.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][4])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife4/3.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][6])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife5/3.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
}
else
{
if(cvar[id][1])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife1/1.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][2])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife2/1.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][3])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife3/1.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][4])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife4/1.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][6])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife5/1.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
}
}
else
{
if (sample[15] == 'l')
{
if(cvar[id][1])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife1/4.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][2])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife2/4.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][3])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife3/4.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][4])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife4/4.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][6])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife5/4.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
}
else if(sample[17] == 'b')
{
if(cvar[id][1])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife1/2.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][2])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife2/2.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][3])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife3/2.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][4])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife4/2.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
if(cvar[id][6])
emit_sound(id, CHAN_WEAPON, "knife_mod/knife5/2.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
}
}
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}
Здравствуйте, помогите пожалуйста поставить в плагин проверка флага каждый раунд чтобы игроки не смогли использовать нож когда они сменили ник. Например игрок под ников Player купил вип и он раздает всем свой пароль и в итоге на сервере многие заходят под его ником берут нож и меняют ник свой ник.
И поэтому можно ли сделать проверка флага каждый раунд если вип игрок сменил ник то его нож со следующего раунда менялся на дефолтный. заранее спасибо за помощь
 
Сообщения
18
Реакции
0
Jumper, игроки играют в клубе поэтому продажа по нику. Если кто может могу и заплатить или это невозможно?

Поставил блокировку смени ника но та не полностью блокирует
 

Ayk

Сообщения
763
Реакции
478
Помог
19 раз(а)
uHTePaKTuB,
Напоминаем Вам, что темы с проблемами в работе сервера или плагинов, в первую очередь нужны Вам и Вы заинтересованы в том, чтобы предоставить всю необходимую информацию для решения Вашей проблемы.
Для хотелок есть раздел Покупка.
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу