Не компелит плагин))

Статус
В этой теме нельзя размещать новые ответы.
D

DJ_A1

Основная информация

Проблема: Не компелит плагин))

Ошибка:
AMX Mod X Compiler 1.8.3
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

zona_mod_v44.sma(1) : error 010: invalid function or declaration
zona_mod_v44.sma(657) : warning 225: unreachable code

1 Error.
Could not locate output file zona_mod_v44.amx (compile failed).
Дополнительная информация

Amx Mod X: ReAMXX

Компилятор: Локальный

Исходник:
Код:
#pragma tabsize 0
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#include <dhudmessage>

native jb_user_member_gang(id)
native jb_gang_skin()
native jb_gang()
native jb_gang_name()

native jb_moto(id)
native jb_kogti(id)
native jb_lom(id)
native jb_machete(id)
native jb_hands(id)

native jb_set_money(amount)
native jb_get_money()

native jb_set_chay();
native jb_get_chay();

#define PLUGIN_NAME "JailBreak Extreme"
#define PLUGIN_AUTHOR "JoRoPiTo"
#define PLUGIN_VERSION "2.7"
#define PLUGIN_CVAR "jbextreme"

#define TASK_STATUS 2487000
#define TASK_FREEDAY 2487100
#define TASK_ROUND 2487200
#define TASK_SAFETIME 2487400
#define TASK_FREEEND 2487500

#define TASK_HNS_DAY 51129
#define TASK_GAME_OVER 51149

#define TEAM_MENU "#Team_Select_Spect"
#define TEAM_MENU2 "#Team_Select_Spect"
#define HUD_DELAY Float:4.0
#define CELL_RADIUS Float:200.0

#define get_bit(%1,%2) ( %1 & 1 << ( %2 & 31 ) )
#define set_bit(%1,%2) %1 |= ( 1 << ( %2 & 31 ) )
#define clear_bit(%1,%2) %1 &= ~( 1 << ( %2 & 31 ) )

#define vec_len(%1) floatsqroot(%1[0] * %1[0] + %1[1] * %1[1] + %1[2] * %1[2])
#define vec_mul(%1,%2) ( %1[0] *= %2, %1[1] *= %2, %1[2] *= %2)
#define vec_copy(%1,%2) ( %2[0] = %1[0], %2[1] = %1[1],%2[2] = %1[2])

#define m_iPrimaryWeapon 116
#define m_iVGUI 510
#define m_fGameHUDInitialized 349
#define m_fNextHudTextArgsGameTime 198
#define ID_SHOWHUD (taskid - TASK_SHOWHUD)

enum _hud { _hudsync, Float:_x, Float:_y, Float:_time }
enum _lastrequest { _knife, _deagle, _freeday, _weapon }
enum _duel { _name[16], _csw, _entname[32], _opt[32], _sel[32] }
enum (+= 100) { TASK_SHOWHUD }

new gp_PrecacheSpawn
new gp_PrecacheKeyValue

new gp_CrowbarMax
new gp_CrowbarMul
new gp_TeamRatio
new gp_CtMax
new gp_BoxMax
new gp_TalkMode
new gp_VoiceBlock
new gp_RetryTime
new gp_RoundMax
new gp_ButtonShoot
new gp_SimonSteps
new gp_SimonRandom
new gp_GlowModels
new gp_AutoLastresquest
new gp_RestartRaund
new gp_Motd
new gp_AutoOpen
new gp_TeamChange

new g_MaxClients
new g_MsgStatusText
new g_MsgStatusIcon
new g_MsgVGUIMenu
new g_MsgShowMenu
new g_MsgClCorpse
new g_MsgMOTD

new gc_TalkMode
new gc_VoiceBlock
new gc_SimonSteps
new gc_ButtonShoot
new Float:gc_CrowbarMul

new bool:g_Translate[33]
new bool:g_ak47Gold[33]

#define ZOMBIE_SPEED Float:230.0

new const server_model[] = {"zono4ka"}

new const endsounds[][] =
{
"zonka55/1.mp3",
"zonka55/2.mp3",
"zonka55/3.mp3",
"zonka55/4.mp3",
"zonka55/5.mp3",
"zonka55/6.mp3",
"zonka55/7.mp3",
"zonka55/12.mp3",
"zonka55/13.mp3",
"zonka55/14.mp3",
"zonka55/15.mp3"
}

new const _p_Moto[] = { "models/p_moto.mdl" }
new const _v_Moto[] = { "models/chainsaw_new3.mdl" }

new const _p_Moto1[] = { "models/p_kogti55.mdl" }
new const _v_Moto1[] = { "models/v_kogti55.mdl" }

new const _p_Moto2[] = { "models/p_lom55.mdl" }
new const _v_Moto2[] = { "models/v_lom55.mdl" }

new const _p_Mahete[] = { "models/p_Mahete.mdl" }
new const _v_Mahete[] = { "models/v_Mahete.mdl" }

new const _p_Hands[] = { "models/p_Hands.mdl" }
new const _v_Hands[] = { "models/v_Hands.mdl" }

//Game Sound
new const g_Game_2[] = {"sound/GameSound/sparta.mp3"}
new const g_Game_3[] = {"sound/GameSound/galaxy55.mp3"}
new const g_Game_4[] = {"sound/GameSound/pryatki.mp3"}
new const g_Game_7[] = {"sound/GameSound/speed.mp3"}

new const _Ak47_weaponmodel[] = { "models/ak47zona/p_akv1.mdl" }
new const _Ak47_viewmodel[] = { "models/ak47zona/v_akv1.mdl" }
new const _FistModels[][] = { "models/p_bknuckles.mdl", "models/z0na55VS/jbhands.mdl" }
new const _BOXFistModels[][] = { "models/p_boxing_z.mdl", "models/v_boxing_z.mdl" }
new const _CTFistModels[][] = { "models/p_baton55.mdl", "models/v_baton55.mdl" }
new const _CrowbarModels[][] = { "models/z0na55VS/p_balrog91.mdl", "models/z0na55VS/v_balrog91.mdl" }
new const _FistSounds[][] = { "weapons/cbar_hitbod2.wav", "weapons/cbar_hitbod1.wav", "weapons/bullet_hit1.wav", "weapons/bullet_hit2.wav" }
new const _RemoveEntities[][] = {"func_hostage_rescue", "info_hostage_rescue", "func_bomb_target", "info_bomb_target","hostage_entity", "info_vip_start", "func_vip_safetyzone", "func_escapezone"}

new const _WeaponsFree[][] = { "weapon_scout", "weapon_deagle", "weapon_mac10", "weapon_elite", "weapon_ak47", "weapon_m4a1", "weapon_mp5navy" }
new const _WeaponsFreeCSW[] = { CSW_SCOUT, CSW_DEAGLE, CSW_MAC10, CSW_ELITE, CSW_AK47, CSW_M4A1, CSW_MP5NAVY }
new const _WeaponsFreeAmmo[] = { 90, 35, 100, 120, 90, 90, 120 }

new const _Duel[][_duel] =
{
{ "Deagle", CSW_DEAGLE, "weapon_deagle", "JBE_MENU_LASTREQ_OPT4", "JBE_MENU_LASTREQ_SEL4" },
{ "Scout", CSW_SCOUT, "weapon_scout", "JBE_MENU_LASTREQ_OPT5", "JBE_MENU_LASTREQ_SEL5" },
{ "Grenades", CSW_HEGRENADE, "weapon_hegrenade", "JBE_MENU_LASTREQ_OPT6", "JBE_MENU_LASTREQ_SEL6" },
{ "Awp", CSW_AWP, "weapon_awp", "JBE_MENU_LASTREQ_OPT7", "JBE_MENU_LASTREQ_SEL7" },
{ "M3", CSW_M3,"weapon_m3", "JBE_MENU_LASTREQ_OPT8", "JBE_MENU_LASTREQ_SEL8" }
}

new const sounds[][] =
{
"jbe_count/10.mp3",
"jbe_count/11.mp3",
"jbe_count/12.mp3",
"jbe_count/13.mp3",
"jbe_count/14.mp3",
"jbe_count/15.mp3",
"jbe_count/16.mp3",
"jbe_count/17.mp3",
"jbe_count/18.mp3",
"jbe_count/19.mp3",
"jbe_count/110.mp3"
}

// HudSync: 0=ttinfo / 1=info / 2=simon / 3=ctinfo / 4=player / 5=day / 6=center / 7=help / 8=timer
new const g_HudSync[][_hud] =
{
{0, 0.6, 0.2, 2.0},
{0, -1.0, 0.7, 5.0},
{0, 0.1, 0.2, 2.0},
{0, 0.1, 0.3, 2.0},
{0, -1.0, 0.9, 3.0},
{0, 0.6, 0.1, 3.0},
{0, -1.0, 0.6, 3.0},
{0, 0.8, 0.3, 20.0},
{0, -1.0, 0.4, 3.0}
}

// Colors: 0:Simon / 1:Freeday / 2:CT Duel / 3:TT Duel
new const g_Colors[][3] = { {0, 255, 0}, {255, 140, 0}, {0, 0, 255}, {255, 0, 0} }

new g_PlayerSpect[33]
new g_PlayerSimon[33]
new g_GameBox[33]
new g_SpeedPlayer[33]
new g_SpeedPlayerZombie[33]

// MoneyTranslite
new g_TransferMoney[33]
new PlayerCredit[33]

// Game
new g_TimerOver
new g_TimeHide
new g_GameMode = 0
new zsMaxPlayers

new g_BackToCT = 0

new CsTeams:g_PlayerTeam[33]
new Float:g_SimonRandom
new Trie:g_CellManagers
new g_JailDay
new g_PlayerJoin
new g_PlayerNomic
new g_HaveVoice
new g_PlayerWanted
new g_PlayerCrowbar
new g_PlayerCrowbar2
new g_PlayerRevolt
new g_PlayerFreeday
new g_FreedayBlock
new g_PlayerLast
new g_FreedayAuto
new g_FreedayNext
new g_TeamCount[CsTeams]
new g_TeamAlive[CsTeams]
new g_BoxStarted
new g_RoundDay
new g_CrowbarCount
new g_Simon
new g_Count
new g_Counted
new g_SimonAllowed
new g_SimonTalking
new g_SimonVoice
new g_RoundStarted
new g_LastDenied
new g_Freeday
new g_Restart_Timer
new g_BlockWeapons
new g_RoundEnd
new g_Duel
new g_DuelA
new g_DuelB
new g_SafeTime
new g_Weekday[64]
new g_Buttons[10]

public plugin_init()
{
unregister_forward(FM_Spawn, gp_PrecacheSpawn)
unregister_forward(FM_KeyValue, gp_PrecacheKeyValue)

register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_cvar(PLUGIN_CVAR, PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY)

register_dictionary("jbextreme.txt")

g_MsgStatusText = get_user_msgid("StatusText")
g_MsgStatusIcon = get_user_msgid("StatusIcon")
g_MsgVGUIMenu = get_user_msgid("VGUIMenu")
g_MsgShowMenu = get_user_msgid("ShowMenu")
g_MsgMOTD = get_user_msgid("MOTD")
g_MsgClCorpse = get_user_msgid("ClCorpse")

register_message(g_MsgStatusText, "msg_statustext")
register_message(g_MsgStatusIcon, "msg_statusicon")
register_message(g_MsgVGUIMenu, "msg_vguimenu")
register_message(g_MsgShowMenu, "msg_showmenu")
register_message(g_MsgMOTD, "msg_motd")
register_message(g_MsgClCorpse, "msg_clcorpse")

register_event("CurWeapon", "current_weapon", "be", "1=1", "2=29")
register_event("CurWeapon", "current_weapon_two", "be", "1=1")
register_event("StatusValue", "player_status", "be", "1=2", "2!0")
register_event("StatusValue", "player_status", "be", "1=1", "2=0")

register_impulse(100, "impulse_100")

RegisterHam(Ham_Spawn, "player", "player_spawn", 1)
RegisterHam(Ham_TakeDamage, "player", "player_damage")
RegisterHam(Ham_TraceAttack, "player", "player_attack")
RegisterHam(Ham_TraceAttack, "func_button", "button_attack")
RegisterHam(Ham_Killed, "player", "player_killed", 1)
RegisterHam(Ham_Touch, "weapon_hegrenade", "player_touchweapon")
RegisterHam(Ham_Touch, "weaponbox", "player_touchweapon")
RegisterHam(Ham_Touch, "armoury_entity", "player_touchweapon")

register_forward(FM_SetClientKeyValue, "set_client_kv")
register_forward(FM_EmitSound, "sound_emit")
register_forward(FM_Voice_SetClientListening, "voice_listening")
register_forward(FM_CmdStart, "player_cmdstart", 1)

register_logevent("round_end", 2, "1=Round_End")
register_logevent("round_first", 2, "0=World triggered", "1&Restart_Round_")
register_logevent("round_first", 2, "0=World triggered", "1=Game_Commencing")
register_logevent("round_start", 2, "0=World triggered", "1=Round_Start")

register_menucmd(register_menuid(TEAM_MENU), 51, "team_select")
register_menucmd(register_menuid(TEAM_MENU2), 51, "team_select")


register_menu("MenuT", 1023, "cmd_server_menu_t")
register_menu("MenuCT", 1023, "cmd_server_menu_ct")

register_clcmd("jointeam", "cmd_jointeam")
register_clcmd("joinclass", "cmd_joinclass")
register_clcmd("+simonvoice", "cmd_voiceon")
register_clcmd("-simonvoice", "cmd_voiceoff")

register_clcmd("say /fd", "cmd_freeday", ADMIN_BAN)
register_clcmd("say /voice", "cmd_voice", ADMIN_BAN)
register_clcmd("say /open", "adm_open", ADMIN_BAN)

register_clcmd("say /fd", "cmd_freeday")
register_clcmd("say /lr", "cmd_lastrequest")
register_clcmd("say /duel", "cmd_lastrequest")
register_clcmd("say /simon", "cmd_simon")
register_clcmd("simon", "cmd_simon")
register_clcmd("say /smenu", "cmd_simonmenu")
register_clcmd("say /box", "cmd_box")

register_clcmd("nightvision", "check_menu")
register_clcmd("say /menu", "check_menu")
register_clcmd("say /MENU", "check_menu")
register_clcmd("Menu", "check_menu")

register_clcmd("jbe_freeday", "adm_freeday", ADMIN_KICK)
register_concmd("jbe_open", "adm_open", ADMIN_KICK)
register_concmd("jbe_box", "adm_box", ADMIN_KICK)

gp_GlowModels = register_cvar("jbe_glowmodels", "0")
gp_SimonSteps = register_cvar("jbe_simonsteps", "0")
gp_CrowbarMul = register_cvar("jbe_crowbarmultiplier", "25.0")
gp_CrowbarMax = register_cvar("jbe_maxcrowbar", "1")
gp_TeamRatio = register_cvar("jbe_teamratio", "3")
gp_TeamChange = register_cvar("jbe_teamchange", "0")
gp_CtMax = register_cvar("jbe_maxct", "3")
gp_BoxMax = register_cvar("jbe_boxmax", "28")
gp_RetryTime = register_cvar("jbe_retrytime", "10.0")
gp_RoundMax = register_cvar("jbe_freedayround", "240.0")
gp_AutoLastresquest = register_cvar("jbe_autolastrequest", "1")
gp_Motd = register_cvar("jbe_motd", "1")
gp_SimonRandom = register_cvar("jbe_randomsimon", "0")
gp_AutoOpen = register_cvar("jbe_autoopen", "1")
gp_TalkMode = register_cvar("jbe_talkmode", "2")
gp_VoiceBlock = register_cvar("jbe_blockvoice", "0")
gp_ButtonShoot = register_cvar("jbe_buttonshoot", "1")
gp_RestartRaund = register_cvar("jbe_auto_rr_time","30.0")

g_Restart_Timer = floatround(get_pcvar_float(gp_RestartRaund))

zsMaxPlayers = get_maxplayers()
g_MaxClients = get_global_int(GL_maxClients)
set_task(1.0, "hud_Informer", 734382, _, _, "b")
set_task(1.0, "start_rr_timer", _, _, _, "a", floatround(get_pcvar_float(gp_RestartRaund)))

for(new i = 0; i < sizeof(g_HudSync); i++)
g_HudSync[_hudsync] = CreateHudSyncObj()

setup_buttons()
}

public plugin_precache()
{
new fastdl2[128]

static i

format(fastdl2, 127, "models/player/%s/%s.mdl", server_model, server_model)
precache_model(fastdl2)


for(i = 0; i < sizeof(_FistModels); i++)
precache_model(_FistModels)

for(i = 0; i < sizeof(_BOXFistModels); i++)
precache_model(_BOXFistModels)

for(i = 0; i < sizeof(_CTFistModels); i++)
precache_model(_CTFistModels)

for(i = 0; i < sizeof(_CrowbarModels); i++)
precache_model(_CrowbarModels)

for(i = 0; i < sizeof(_FistSounds); i++)
precache_sound(_FistSounds)

for(new i = 1; i <= 10; i++)
precache_sound(sounds)

for(new i = 1; i <= 10; i++)
precache_sound(endsounds)

precache_model( "models/p_moto.mdl" )
precache_model( "models/chainsaw_new3.mdl" )

precache_model( "models/p_kogti55.mdl" )
precache_model( "models/v_kogti55.mdl" )

precache_model( "models/p_lom55.mdl" )
precache_model( "models/v_lom55.mdl" )

precache_model( "models/p_Mahete.mdl" )
precache_model( "models/v_Mahete.mdl" )

precache_model( "models/p_Hands.mdl" )
precache_model( "models/v_Hands.mdl" )

//Game Sound
precache_generic(g_Game_2)
precache_generic(g_Game_3)
precache_generic(g_Game_4)
precache_generic(g_Game_7)

precache_sound("JBprogame/task_complete.wav")
precache_sound("JBprogame/timepass_ac.wav")
precache_sound("alien_alarm.wav")
precache_sound("JBprogame/jail_mode/duels1.wav")
precache_sound("JBprogame/jail_mode/bell.wav")

precache_model("models/ak47zona/v_akv1.mdl")
precache_model("models/ak47zona/p_akv1.mdl")

precache_model("models/v_crowbar.mdl")
precache_model("models/p_crowbar.mdl")

precache_model("models/v_roundhand.mdl")

g_CellManagers = TrieCreate()
gp_PrecacheSpawn = register_forward(FM_Spawn, "precache_spawn", 1)
gp_PrecacheKeyValue = register_forward(FM_KeyValue, "precache_keyvalue", 1)
}

public precache_spawn(ent)
{
if(is_valid_ent(ent))
{
static szClass[33]
entity_get_string(ent, EV_SZ_classname, szClass, sizeof(szClass))
for(new i = 0; i < sizeof(_RemoveEntities); i++)
if(equal(szClass, _RemoveEntities))
remove_entity(ent)
}
}

public precache_keyvalue(ent, kvd_handle)
{
static info[32]
if(!is_valid_ent(ent))
return FMRES_IGNORED

get_kvd(kvd_handle, KV_ClassName, info, charsmax(info))
if(!equal(info, "multi_manager"))
return FMRES_IGNORED

get_kvd(kvd_handle, KV_KeyName, info, charsmax(info))
TrieSetCell(g_CellManagers, info, ent)
return FMRES_IGNORED
}

public client_putinserver(id)
{
clear_bit(g_PlayerJoin, id)
clear_bit(g_PlayerCrowbar, id)
clear_bit(g_PlayerCrowbar2, id)
clear_bit(g_PlayerNomic, id)
clear_bit(g_PlayerWanted, id)
clear_bit(g_SimonTalking, id)
clear_bit(g_SimonVoice, id)
g_PlayerSpect[id] = 0
g_PlayerSimon[id] = 0

client_cmd(id, "stopsound")

g_ak47Gold[id] = false
}

public client_disconnect(id)
{
if(g_Simon == id)
{
g_Simon = 0
ClearSyncHud(0, g_HudSync[2][_hudsync])
player_hudmessage(0, 2, 5.0, _, "%L", LANG_SERVER, "JBE_SIMON_HASGONE")
}
else if(g_PlayerLast == id || (g_Duel && (id == g_DuelA || id == g_DuelB)))
{
g_Duel = 0
g_DuelA = 0
g_DuelB = 0
g_LastDenied = 0
g_BlockWeapons = 0
g_PlayerLast = 0
}
g_Translate[id] = false
g_ak47Gold[id] = false
remove_task(id+TASK_SHOWHUD)
team_count()
}

public client_PostThink(id)
{
if(id != g_Simon || !gc_SimonSteps || !is_user_alive(id) ||
!(entity_get_int(id, EV_INT_flags) & FL_ONGROUND) || entity_get_int(id, EV_ENT_groundentity))
return PLUGIN_CONTINUE

static Float:origin[3]
static Float:last[3]

entity_get_vector(id, EV_VEC_origin, origin)
if(get_distance_f(origin, last) < 32.0)
{
return PLUGIN_CONTINUE
}

vec_copy(origin, last)
if(entity_get_int(id, EV_INT_bInDuck))
origin[2] -= 18.0
else
origin[2] -= 36.0

message_begin(MSG_BROADCAST, SVC_TEMPENTITY, {0,0,0}, 0)
write_byte(TE_WORLDDECAL)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(origin[2]))
write_byte(105)
message_end()

return PLUGIN_CONTINUE
}

public msg_statustext(msgid, dest, id)
return PLUGIN_HANDLED

public msg_statusicon(msgid, dest, id)
{
static icon[5]
get_msg_arg_string(2, icon, charsmax(icon))
if(icon[0] == 'b' && icon[2] == 'y' && icon[3] == 'z')
{
set_pdata_int(id, 235, get_pdata_int(id, 235) & ~(1<<0))
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}

public msg_vguimenu(msgid, dest, id)
{
static msgarg1
static CsTeams:team

msgarg1 = get_msg_arg_int(1)
if(msgarg1 == 2)
{
team = cs_get_user_team(id)
if((team == CS_TEAM_T) && !is_user_admin(id) && (is_user_alive(id) || !get_pcvar_num(gp_TeamChange)))
{
client_print(id, print_center, "%L", LANG_SERVER, "JBE_TEAM_CANTCHANGE")
return PLUGIN_HANDLED
}
show_menu(id, 51, TEAM_MENU, -1)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}

public msg_showmenu(msgid, dest, id)
{
static msgarg1, roundloop
static CsTeams:team
msgarg1 = get_msg_arg_int(1)

if(msgarg1 != 531 && msgarg1 != 563)
return PLUGIN_CONTINUE

roundloop = floatround(get_pcvar_float(gp_RetryTime) / 2)
team = cs_get_user_team(id)

if(team == CS_TEAM_T)
{
if(!is_user_admin(id) && (is_user_alive(id) || (g_RoundStarted >= roundloop) || !get_pcvar_num(gp_TeamChange)))
{
client_print(id, print_center, "%L", LANG_SERVER, "JBE_TEAM_CANTCHANGE")
return PLUGIN_HANDLED
}else{
show_menu(id, 51, TEAM_MENU, -1)
return PLUGIN_HANDLED
}
}else{
show_menu(id, 51, TEAM_MENU, -1)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}

public msg_motd(msgid, dest, id)
{
if(get_pcvar_num(gp_Motd))
return PLUGIN_HANDLED

return PLUGIN_CONTINUE
}

public msg_clcorpse(msgid, dest, id)
return PLUGIN_HANDLED

public current_weapon_two(id)
{
if(!is_user_alive(id))
return PLUGIN_CONTINUE

if(g_RoundEnd)
{
if(get_user_weapon(id) != CSW_KNIFE)
engclient_cmd(id, "weapon_knife")
}

if(g_SpeedPlayer[id])
set_user_maxspeed(id, 510.0)

if(g_SpeedPlayerZombie[id])
set_user_maxspeed(id,ZOMBIE_SPEED)

new weapon
weapon = read_data(2)
if(g_ak47Gold[id] && weapon == CSW_AK47)
{
set_pev(id, pev_viewmodel2, _Ak47_viewmodel)
set_pev(id, pev_weaponmodel2, _Ak47_weaponmodel)
}
return PLUGIN_CONTINUE
}

public current_weapon(id)
{
if(!is_user_alive(id))
return PLUGIN_CONTINUE

if(cs_get_user_team(id) == CS_TEAM_CT)
{
if(g_RoundEnd)
{
set_pev(id, pev_viewmodel2, "models/v_roundhand.mdl")
set_pev(id, pev_weaponmodel2, _FistModels[0])
}
else
{
if(get_bit(g_PlayerCrowbar2, id))
{
set_pev(id, pev_viewmodel2, "models/v_crowbar.mdl")
set_pev(id, pev_weaponmodel2, "models/p_crowbar.mdl")
}
else
{
set_pev(id, pev_viewmodel2, _CTFistModels[1])
set_pev(id, pev_weaponmodel2, _CTFistModels[0])
}
}
}
else if(cs_get_user_team(id) == CS_TEAM_T)
{
if(g_RoundEnd)
{
set_pev(id, pev_viewmodel2, "models/v_roundhand.mdl")
set_pev(id, pev_weaponmodel2, _FistModels[0])
}
else
{
if(get_bit(g_PlayerCrowbar, id))
{
set_pev(id, pev_viewmodel2, _CrowbarModels[1])
set_pev(id, pev_weaponmodel2, _CrowbarModels[0])
}
else if(get_bit(g_PlayerCrowbar2, id))
{
set_pev(id, pev_viewmodel2, "models/v_crowbar.mdl")
set_pev(id, pev_weaponmodel2, "models/p_crowbar.mdl")
}
else if (jb_moto(id))
{
set_pev(id, pev_viewmodel2, _v_Moto)
set_pev(id, pev_weaponmodel2, _p_Moto)
}
else if (jb_kogti(id))
{
set_pev(id, pev_viewmodel2, _v_Moto1)
set_pev(id, pev_weaponmodel2, _p_Moto1)
}
else if (jb_lom(id))
{
set_pev(id, pev_viewmodel2, _v_Moto2)
set_pev(id, pev_weaponmodel2, _p_Moto2)
}
else if (jb_machete(id))
{
set_pev(id, pev_viewmodel2, _v_Mahete)
set_pev(id, pev_weaponmodel2, _p_Mahete)
}
else if (jb_hands(id))
{
set_pev(id, pev_viewmodel2, _v_Hands)
set_pev(id, pev_weaponmodel2, _p_Hands)
}
else
{
if(g_BoxStarted)
{
set_pev(id, pev_viewmodel2, _BOXFistModels[1])
set_pev(id, pev_weaponmodel2, _BOXFistModels[0])
} else {
set_pev(id, pev_viewmodel2, _FistModels[1])
set_pev(id, pev_weaponmodel2, _FistModels[0])
}
}
}
}
return PLUGIN_CONTINUE
}

public hud_Informer()
{
static i, n,len,freeday[1024],Message[1024]
new name[32]
len = 0

new szText2[32]
get_user_name(jb_gang(), szText2, charsmax(szText2))

n = 0
formatex(freeday, charsmax(freeday), "Свободных зеков:")
n = strlen(freeday)
for(i = 0; i < g_MaxClients; i++)
{
if(get_bit(g_PlayerFreeday, i) && is_user_alive(i) && n < charsmax(freeday))
{
get_user_name(i, name, charsmax(name))
n += copy(freeday[n], charsmax(freeday) - n, "^n^t")
n += copy(freeday[n], charsmax(freeday) - n, name)
}
}

len += formatex(Message[len], 511 - len, "%L^n", LANG_SERVER, "JBE_INFORMER_WEEKDAY",g_JailDay,g_Weekday)
if(g_GameMode)
{
switch( g_GameMode )
{
case 1: len += formatex(Message[len], 511 - len, "Режим игры: Спарта^n")
case 2: len += formatex(Message[len], 511 - len, "Режим игры: Галактика^n")
case 3: len += formatex(Message[len], 511 - len, "Режим игры: Акула^n")
case 4: len += formatex(Message[len], 511 - len, "Режим игры: Снайпер^n")
case 5: len += formatex(Message[len], 511 - len, "Режим игры: Догонялки^n")
case 6: len += formatex(Message[len], 511 - len, "Режим игры: Зомби^n")
case 7: len += formatex(Message[len], 511 - len, "Режим игры: Прятки^n")
case 8: len += formatex(Message[len], 511 - len, "Режим игры: Чай-чай выручай^n")
}
}else if(g_PlayerLast) {
get_user_name(g_PlayerLast, name, 31)
len += formatex(Message[len], 511 - len, "%L^n", LANG_SERVER, "JBE_INFORMER_LASTREQ",name)
}else if(g_Freeday){
len += formatex(Message[len], 511 - len, "%L^n", LANG_SERVER, "JBE_INFORMER_FREEDAY")
}else if(g_BoxStarted){
len += formatex(Message[len], 511 - len, "%L^n", LANG_SERVER, "JBE_INFORMER_BOX")
}else if(g_Simon){
get_user_name(g_Simon, name, charsmax(name))
len += formatex(Message[len], 511 - len, "%L^n", LANG_SERVER, "JBE_INFORMER_SIMON",name)
}else{
len += formatex(Message[len],511 - len, "%L^n", LANG_SERVER, "JBE_INFORMER_SIMON_OFF")
}

len += formatex(Message[len], 511 - len, "%L^n", LANG_SERVER, "JBE_INFORMER_CT",g_TeamAlive[CS_TEAM_CT],g_TeamCount[CS_TEAM_CT])
len += formatex(Message[len], 511 - len, "%L^n^n", LANG_SERVER, "JBE_INFORMER_TT",g_TeamAlive[CS_TEAM_T],g_TeamCount[CS_TEAM_T])

if(g_Restart_Timer)
{
len += formatex(Message[len], 511 - len, "%L^n^n", LANG_SERVER, "JBE_RESTART_RAUND",g_Restart_Timer)
}
if(jb_gang())
{
len += formatex(Message[len], 511 - len, "Главарь: %s^n^n", szText2)
}
else len += formatex(Message[len], 511 - len, "На сервере нет банды^n^n")
if(g_PlayerFreeday && !g_Freeday)
{
len += formatex(Message[len], 511 - len, "%s^n^n", freeday)
}
if(g_TimerOver)
{
len += formatex(Message[len], 511 - len, "Игра закончиться через %i секунд",g_TimerOver)
g_TimerOver = g_TimerOver - 1
}else if(g_TimeHide > 0){
len += formatex(Message[len], 511 - len, "Прятки начнуться через %i секунд",g_TimeHide)
}
set_hudmessage(255, 204, 0, 0.14, 0.15, 0, 6.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(0, Message)
wanted_list()
}

public wanted_list(){
static i, n,wanted[1024]
new name[32]
n = 0;
formatex(wanted, charsmax(wanted), "[z0na55.ru] Розыск:");
n = strlen(wanted);
for(i = 0; i < g_MaxClients; i++)
{
if(get_bit(g_PlayerWanted, i) && is_user_alive(i) && n < charsmax(wanted))
{
get_user_name(i, name, charsmax(name));
n += copy(wanted[n], charsmax(wanted) - n, "^n^t");
n += copy(wanted[n], charsmax(wanted) - n, name);
}
}
set_hudmessage(255, 204, 0, 0.75, 0.15, 0, 0.0, 12.0, 0.0, 0.0, -1);
show_hudmessage(0, wanted);
}

public player_status(id)
{
static type, player, CsTeams:team, name[32], health
type = read_data(1)
player = read_data(2)
switch(type)
{
case(1):
{
ClearSyncHud(id, g_HudSync[1][_hudsync])
}
case(2):
{
team = cs_get_user_team(player)
if((team != CS_TEAM_T) && (team != CS_TEAM_CT))
return PLUGIN_HANDLED

health = get_user_health(player)
get_user_name(player, name, charsmax(name))
player_hudmessage(id, 4, 2.0, {255, 255, 255}, "%L", LANG_SERVER,
(team == CS_TEAM_T) ? "JBE_PRISONER_STATUS" : "JBE_GUARD_STATUS", name, health)
}
}
return PLUGIN_HANDLED
}

public impulse_100(id)
{
if(cs_get_user_team(id) == CS_TEAM_T)
return PLUGIN_HANDLED
return PLUGIN_CONTINUE
}

public player_spawn(id)
{
static CsTeams:team

if(!is_user_connected(id))
return HAM_IGNORED

set_pdata_float(id, m_fNextHudTextArgsGameTime, get_gametime() + 999999.0)
player_strip_weapons(id)
if(g_RoundEnd)
{
g_RoundEnd = 0
g_JailDay++
}

set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)

if(is_user_alive(id) && is_user_connected(id))
{
if(cs_get_user_team(id) == CS_TEAM_CT)
{
player_strip_weapons(id)
give_item(id, "weapon_knife")
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 90)
cmd_weapon_menu(id)
}
}

clear_bit(g_PlayerCrowbar, id)
clear_bit(g_PlayerCrowbar2, id)
clear_bit(g_PlayerWanted, id)
team = cs_get_user_team(id)

switch(team)
{
case(CS_TEAM_T):
{
g_PlayerLast = 0

if(jb_user_member_gang(id))
{
set_user_info(id, "model", "zona_banda")
entity_set_int(id, EV_INT_skin, jb_gang_skin())
}
else
{
set_user_info(id, "model", server_model)
entity_set_int(id, EV_INT_body, 2)
}
if(is_freeday() || get_bit(g_FreedayAuto, id))
{
freeday_set(0, id)
clear_bit(g_FreedayAuto, id)
}
else
{
if(jb_user_member_gang(id))
entity_set_int(id, EV_INT_skin, jb_gang_skin())
else
entity_set_int(id, EV_INT_skin, random_num(0, 2))
}

if(g_CrowbarCount < get_pcvar_num(gp_CrowbarMax))
{
if(random_num(0, g_MaxClients) > (g_MaxClients / 2))
{
g_CrowbarCount++
set_bit(g_PlayerCrowbar, id)
}
}
cs_set_user_armor(id, 0, CS_ARMOR_NONE)
}
case(CS_TEAM_CT):
{
g_PlayerSimon[id]++
set_user_info(id, "model", server_model)
entity_set_int(id, EV_INT_body, 3)
cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM)
}
}

if(g_GameMode == 9)
{
if (cs_get_user_team(id) == CS_TEAM_CT)
{
set_bit(g_BackToCT, id)
cs_set_user_team2(id, CS_TEAM_T)
}
new j = 0;
strip_user_weapons(id)
j = random_num(0, sizeof(_WeaponsFree) - 1)
give_item(id, "weapon_knife")
give_item(id, _WeaponsFree[j])
cs_set_user_bpammo(id, _WeaponsFreeCSW[j], _WeaponsFreeAmmo[j])
}

first_join(id)
return HAM_IGNORED
}

stock cs_set_user_team2(index, {CsTeams,_}:team, update = 1)
{
if (index == g_Simon)
{
g_Simon = 0
hud_status(0)
}
set_pdata_int(index, 114, _:team)
set_pev(index, pev_team, _:team)

if(update)
{
static _msg_teaminfo; if(!_msg_teaminfo) _msg_teaminfo = get_user_msgid("TeamInfo")
static teaminfo[][] = { "UNASSIGNED", "TERRORIST", "CT", "SPECTATOR" }

message_begin(MSG_ALL, _msg_teaminfo)
write_byte(index)
write_string(teaminfo[_:team])
message_end()
}
return 1
}

public player_damage(victim, ent, attacker, Float:damage, bits)
{
if(!is_user_connected(victim) || !is_user_connected(attacker) || victim == attacker)
return HAM_IGNORED

if(get_user_weapon(attacker) == CSW_AK47 && g_ak47Gold[attacker])
SetHamParamFloat(4, damage*2)


if((g_GameMode == 9) && (g_Simon == attacker) && get_user_weapon(attacker) == CSW_KNIFE && get_bit(g_PlayerCrowbar2, attacker))
{
set_user_rendering(attacker, kRenderFxNone, 0, 0, 0, kRenderNormal, 0 )
remove_task(7447)
set_task(3.1, "task_inviz",7447);
SetHamParamFloat(4, damage * 25.0)
return HAM_OVERRIDE
}

switch(g_Duel)
{
case(0):
{
if(attacker == ent && get_user_weapon(attacker) == CSW_KNIFE && get_bit(g_PlayerCrowbar, attacker) && cs_get_user_team(victim) != CS_TEAM_T)
{
SetHamParamFloat(4, damage * gc_CrowbarMul)
return HAM_OVERRIDE
}
}
case(2):
{
if(attacker != g_PlayerLast)
return HAM_SUPERCEDE
}
default:
{
if((victim == g_DuelA && attacker == g_DuelB) || (victim == g_DuelB && attacker == g_DuelA))
return HAM_IGNORED

return HAM_SUPERCEDE
}
}

return HAM_IGNORED
}

public player_attack(victim, attacker, Float:damage, Float:direction[3], tracehandle, damagebits)
{
static CsTeams:vteam, CsTeams:ateam
if(!is_user_connected(victim) || !is_user_connected(attacker) || victim == attacker)
return HAM_IGNORED

vteam = cs_get_user_team(victim)
ateam = cs_get_user_team(attacker)

if(ateam == CS_TEAM_CT && vteam == CS_TEAM_CT)
return HAM_SUPERCEDE

switch(g_Duel)
{
case(0):
{
if(ateam == CS_TEAM_CT && vteam == CS_TEAM_T)
{
if(get_bit(g_PlayerRevolt, victim))
{
clear_bit(g_PlayerRevolt, victim)
hud_status(0)
}
return HAM_IGNORED
}
}
case(2):
{
if(attacker != g_PlayerLast)
return HAM_SUPERCEDE
}
default:
{
if((victim == g_DuelA && attacker == g_DuelB) || (victim == g_DuelB && attacker == g_DuelA))
return HAM_IGNORED

return HAM_SUPERCEDE
}
}

if(ateam == CS_TEAM_T && vteam == CS_TEAM_T && !g_BoxStarted)
return HAM_SUPERCEDE

if(ateam == CS_TEAM_T && vteam == CS_TEAM_CT)
{
if(!g_PlayerRevolt)
revolt_start()

set_bit(g_PlayerRevolt, attacker)
}
return HAM_IGNORED
}

public button_attack(button, id, Float:damage, Float:direction[3], tracehandle, damagebits)
{
if(is_valid_ent(button) && gc_ButtonShoot)
{
ExecuteHamB(Ham_Use, button, id, 0, 2, 1.0)
entity_set_float(button, EV_FL_frame, 0.0)
}
return HAM_IGNORED
}

public player_killed(victim, attacker, shouldgib)
{
static CsTeams:vteam, CsTeams:kteam
if(!(0 < attacker <= g_MaxClients) || !is_user_connected(attacker))
kteam = CS_TEAM_UNASSIGNED
else
kteam = cs_get_user_team(attacker)

vteam = cs_get_user_team(victim)
if(g_ak47Gold[victim])
g_ak47Gold[victim] = false

if(g_Simon == victim)
{
g_Simon = 0
ClearSyncHud(0, g_HudSync[2][_hudsync])
player_hudmessage(0, 2, 5.0, _, "%L", LANG_SERVER, "JBE_SIMON_KILLED")

if(is_user_connected(attacker) && jb_user_member_gang(attacker))
jb_set_money(jb_get_money() + 10000)
}

if((g_GameMode == 9) && (g_Simon == attacker))
{
set_user_health(g_Simon, get_user_health(g_Simon) + 200)
}

switch(g_Duel)
{
case(0):
{
switch(vteam)
{
case(CS_TEAM_CT):
{
if(kteam == CS_TEAM_T && !get_bit(g_PlayerWanted, attacker))
{
set_bit(g_PlayerWanted, attacker)
if(jb_user_member_gang(attacker))
entity_set_int(attacker, EV_INT_skin, 7)
else entity_set_int(attacker, EV_INT_skin, 4)
client_cmd(victim, "say /life")

if(jb_user_member_gang(attacker))
{
set_dhudmessage(255, 0, 0, -1.0, 0.5, 0, 6.0, 12.0)
show_dhudmessage(0, "Банда^nНачала бунт!")
}
}
}
case(CS_TEAM_T):
{
clear_bit(g_PlayerRevolt, victim)
clear_bit(g_PlayerWanted, victim)
client_cmd(victim, "say /life")
}
}
}
default:
{
if(g_Duel != 2 && (attacker == g_DuelA || attacker == g_DuelB))
{
set_user_rendering(victim, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)
set_user_rendering(attacker, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)
g_Duel = 0
g_LastDenied = 0
g_BlockWeapons = 0
g_PlayerLast = 0
team_count()
}
}
}
hud_status(0)
return HAM_IGNORED
}

public player_touchweapon(id, ent)
{
static model[32], class[32]
if(g_BlockWeapons)
return HAM_SUPERCEDE

if(is_valid_ent(id) && g_Duel != 6 && is_user_alive(ent) && cs_get_user_team(ent) == CS_TEAM_CT)
{
entity_get_string(id, EV_SZ_model, model, charsmax(model))
if(model[7] == 'w' && model[9] == 'h' && model[10] == 'e' && model[11] == 'g')
{
entity_get_string(id, EV_SZ_classname, class, charsmax(class))
if(equal(class, "weapon_hegrenade"))
remove_entity(id)

return HAM_SUPERCEDE
}
}
return HAM_IGNORED
}

public set_client_kv(id, const info[], const key[])
{
if(equal(key, "model"))
return FMRES_SUPERCEDE

return FMRES_IGNORED
}

public sound_emit(id, channel, sample[])
{
if(is_user_alive(id) && equal(sample, "weapons/knife_", 14))
{
switch(sample[17])
{
case('b'):
{
emit_sound(id, CHAN_WEAPON, "weapons/cbar_hitbod2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
case('w'):
{
emit_sound(id, CHAN_WEAPON, "weapons/cbar_hitbod1.wav", 1.0, ATTN_NORM, 0, PITCH_LOW)
}
case('1', '2'):
{
emit_sound(id, CHAN_WEAPON, "weapons/bullet_hit2.wav", random_float(0.5, 1.0), ATTN_NORM, 0, PITCH_NORM)
}
}
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}

public block_player()
{
static i
new mxplr
for(i = 1; i < mxplr; i++)
{
if(!g_Translate)
continue

if(is_user_alive(i))
user_kill(i)

get_user_team(i) == 2
}
}

public voice_listening(receiver, sender, bool:listen)
{
if((receiver == sender))
return FMRES_IGNORED

if(is_user_admin(sender))
{
engfunc(EngFunc_SetClientListening, receiver, sender, true)
return FMRES_SUPERCEDE
}

switch(gc_VoiceBlock)
{
case(2):
{
if((sender != g_Simon) && (!get_bit(g_SimonVoice, sender) && gc_VoiceBlock))
{
engfunc(EngFunc_SetClientListening, receiver, sender, false)
return FMRES_SUPERCEDE
}
}
case(1):
{
if(!get_bit(g_SimonVoice, sender) && gc_VoiceBlock)
{
engfunc(EngFunc_SetClientListening, receiver, sender, false)
return FMRES_SUPERCEDE
}
}
}
if(!is_user_alive(sender))
{
engfunc(EngFunc_SetClientListening, receiver, sender, false)
return FMRES_SUPERCEDE
}

if(sender == g_Simon)
{
engfunc(EngFunc_SetClientListening, receiver, sender, true)
return FMRES_SUPERCEDE
}

if(get_bit(g_HaveVoice, sender))
{
engfunc(EngFunc_SetClientListening, receiver, sender, true)
return FMRES_SUPERCEDE
}

listen = true

if(g_SimonTalking && (sender != g_Simon))
{
listen = false
}
else
{
static CsTeams:steam
steam = cs_get_user_team(sender)
switch(gc_TalkMode)
{
case(2):
{
listen = (steam == CS_TEAM_CT)
}
case(1):
{
listen = (steam == CS_TEAM_CT || steam == CS_TEAM_T)
}
}
}
engfunc(EngFunc_SetClientListening, receiver, sender, listen)
return FMRES_SUPERCEDE
}

public cmd_voice(id)
{
if(g_Simon == id || is_user_admin(id))
{
menu_players(id, CS_TEAM_T, 0, 1, "voice_enable_select", "%L", LANG_SERVER, "JBE_GVC_MENU")
}
return PLUGIN_HANDLED
}

public voice_enable_select(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
static dst[32], data[5], player, access, callback

menu_item_getinfo(menu, item, access, data, charsmax(data), dst, charsmax(dst), callback)
player = str_to_num(data)
enable_player_voice(id, player)
cmd_simonmenu(id)
return PLUGIN_HANDLED
}

public enable_player_voice(id, player)
{
static src[32], dst[32]
get_user_name(player, dst, charsmax(dst))
if (!get_bit(g_HaveVoice, player))
{
set_bit(g_HaveVoice, player)
if(0 < id <= g_MaxClients)
{
get_user_name(id, src, charsmax(src))
player_hudmessage(0, 1, 3.0,{150, 150, 150}, "%L", LANG_SERVER, "JBE_GVC_ENABLED", src, dst)
}
}
else
{
clear_bit(g_HaveVoice, player)
if(0 < id <= g_MaxClients)
{
get_user_name(id, src, charsmax(src))
player_hudmessage(0, 1, 3.0,{150, 150, 150}, "%L", LANG_SERVER, "JBE_GVC_DISABLED", src, dst)
}
}
}

public player_cmdstart(id, uc, random)
{
if(g_Duel > 3)
cs_set_user_bpammo(id, _Duel[g_Duel - 4][_csw], 1)
}

public round_first()
{
g_JailDay = 0
for(new i = 1; i <= g_MaxClients; i++)
g_PlayerSimon = 0

set_cvar_num("sv_alltalk", 1)
set_cvar_num("mp_roundtime", 2)
set_cvar_num("mp_limitteams", 0)
set_cvar_num("mp_autoteambalance", 0)
set_cvar_num("mp_tkpunish", 0)
set_cvar_num("mp_friendlyfire", 1)
round_end()
}

public round_end()
{
g_GameMode = 0
g_SafeTime = 0
g_PlayerRevolt = 0
g_PlayerFreeday = 0
g_PlayerLast = 0
g_BoxStarted = 0
g_CrowbarCount = 0
g_Simon = 0
g_SimonAllowed = 0
g_RoundStarted = 0
g_LastDenied = 0
g_BlockWeapons = 0
g_TeamCount[CS_TEAM_T] = 0
g_TeamCount[CS_TEAM_CT] = 0
g_Freeday = 0
g_FreedayBlock = 0
g_FreedayNext = (random_num(0,99) >= 95)
g_RoundEnd = 1
g_Duel = 0

remove_task(935)
remove_task(666)

for(new i = 1; i <= g_MaxClients; i++)
{
if(!is_user_connected(i))
continue

menu_cancel(i)
g_SpeedPlayer = false
g_SpeedPlayerZombie = false
player_strip_weapons(i)
give_item(i, "weapon_knife")
}

client_cmd(0, "mp3 stop;mp3 play sound/%s",endsounds[random_num(0,11)])
remove_task(TASK_STATUS)
remove_task(TASK_FREEDAY)
remove_task(TASK_FREEEND)
remove_task(TASK_ROUND)
remove_task(TASK_HNS_DAY)
remove_task(TASK_GAME_OVER)

if(!task_exists(488))
set_task(0.1, "LogEvent_RoundEndTask", 488);

//GameTimer
set_lights("#OFF")
g_TimeHide = false
g_TimerOver = false

for(new i = 0; i < sizeof(g_HudSync); i++)
ClearSyncHud(0, g_HudSync[_hudsync])
}

public LogEvent_RoundEndTask()
{
for(new i = 1; i <= get_maxplayers(); i++)
{
if(!is_user_alive(i))
continue

player_strip_weapons(i)

set_pev(i, pev_viewmodel2, "models/v_roundhand.mdl")

set_pdata_float(i, 83, 5.0)
UTIL_WeaponAnimation(i, 0)
}
}

public round_start()
{
if(g_RoundEnd)
return

team_count()
if(!g_Simon && is_freeday())
{
g_Freeday = 1
emit_sound(0, CHAN_AUTO, "JBprogame/jail_mode/bell.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
check_freeday(TASK_FREEDAY)
}
else
{
set_task(300.0, "check_freeday", TASK_FREEDAY)
}
set_task(HUD_DELAY, "hud_status", TASK_STATUS, _, _, "b")
set_task(get_pcvar_float(gp_RetryTime) + 1.0, "safe_time", TASK_SAFETIME)
set_task(120.0, "freeday_end", TASK_FREEDAY)
g_SimonRandom = get_pcvar_num(gp_SimonRandom) ? random_float(15.0, 45.0) : 0.0
g_SimonAllowed = 1
g_FreedayNext = 0

switch(g_RoundDay)
{
case 0: copy(g_Weekday, 63, "Понедельник")
case 1:copy(g_Weekday, 63, "Вторник")
case 2:copy(g_Weekday, 63, "Среда")
case 3:copy(g_Weekday, 63, "Четверг")
case 4:copy(g_Weekday, 63, "Пятница")
case 5:copy(g_Weekday, 63, "Суббота [Игра, выбор: Общий]")
case 6:
{
g_RoundDay = -1;
copy(g_Weekday, 63, "Воскресенье [Игра, выбор: Саймона]");
}
}
for(new i = 1; i <= get_maxplayers(); i++)
{
if(!is_user_connected(i))
continue

clear_bit(g_PlayerCrowbar2, i)
}
g_RoundDay++
set_lights("#OFF")
}

public cmd_jointeam(id)
return PLUGIN_HANDLED

public cmd_joinclass(id)
return PLUGIN_HANDLED

public cmd_voiceon(id)
{
client_cmd(id, "+voicerecord")
set_bit(g_SimonVoice, id)
if(g_Simon == id || is_user_admin(id))
set_bit(g_SimonTalking, id)

return PLUGIN_HANDLED
}

public cmd_voiceoff(id)
{
client_cmd(id, "-voicerecord")
clear_bit(g_SimonVoice, id)
if(g_Simon == id || is_user_admin(id))
clear_bit(g_SimonTalking, id)

return PLUGIN_HANDLED
}

public cmd_simon(id)
{
if(!is_user_connected(id) || g_GameMode == 1 || g_GameMode == 2 || g_GameMode == 3 || g_GameMode == 4 || g_GameMode == 5 || g_GameMode == 6 || g_GameMode == 7 || g_GameMode == 8)
{
ChatColor(id,"В игровые дни !gСаймон !tнедоступен")
return PLUGIN_HANDLED
}

static CsTeams:team, name[32]

team = cs_get_user_team(id)
if(g_SimonAllowed && !g_Freeday && team == CS_TEAM_CT)
{
if(is_user_alive(id))
{
if(!g_Simon)
{
g_Simon = id
get_user_name(id, name, charsmax(name))
entity_set_int(id, EV_INT_body, 1)
g_PlayerSimon[id]--
if(get_pcvar_num(gp_GlowModels))
player_glow(id, g_Colors[0])

player_strip_weapons(id)
Simon_Ak47_Gold(id)
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 35)

hud_status(0)
set_user_health(id, 255)
set_user_armor(id, 255)
cmd_simonmenu(id)
}else ChatColor(id,"Нельзя взять Начальника Тюрьмы, должность уже занята.")
}else ChatColor(id,"Нельзя взять Начальника Тюрьмы, Вы мертвы.")
}
return PLUGIN_HANDLED
}

public cmd_simonmenu(id)
{
if(g_GameMode == 1 || g_GameMode == 2 || g_GameMode == 3 || g_GameMode == 4 || g_GameMode == 5 || g_GameMode == 6 || g_GameMode == 7 || g_GameMode == 8)
{
ChatColor(id,"!tСаймон!y Меню недоступно в !gигровые дни")
return PLUGIN_HANDLED
}

if(g_Simon == id)
{
static menu, menuname[32], option[64]

formatex(menuname, charsmax(menuname), "\w%L", LANG_SERVER, "JBE_SIMON_MENU")
menu = menu_create(menuname, "smenu_handler")

formatex(option, charsmax(option), "\w%L", LANG_SERVER, "JBE_SIMON_MENU_1")
menu_additem(menu, option, "1", 0)

formatex(option, charsmax(option), "\w%L", LANG_SERVER, "JBE_SIMON_MENU_2")
menu_additem(menu, option, "2", 0)

formatex(option, charsmax(option), "\w%L", LANG_SERVER, "JBE_SIMON_MENU_3")
menu_additem(menu, option, "3", 0)

formatex(option, charsmax(option), "\w%L", LANG_SERVER, "JBE_SIMON_MENU_4")
menu_additem(menu, option, "4", 0)

if(!g_GameBox[id]){
formatex(option, charsmax(option), "\w%L", LANG_SERVER, "JBE_SIMON_MENU_5")
menu_additem(menu, option, "5", 0)
}else{
formatex(option, charsmax(option), "\w%L", LANG_SERVER, "JBE_SIMON_MENU_5_2")
menu_additem(menu, option, "5", 0)
}

formatex(option, charsmax(option), "\w%L", LANG_SERVER, "JBE_SIMON_MENU_6")
menu_additem(menu, option, "6", 0)

formatex(option, charsmax(option), "\w%L", LANG_SERVER, "JBE_SIMON_MENU_7")
menu_additem(menu, option, "7", 0)

formatex(option, charsmax(option), "\w%L", LANG_SERVER, "JBE_SIMON_MENU_8")
menu_additem(menu, option, "8", 0)

formatex(option, charsmax(option), "\w%L", LANG_SERVER, "JBE_SIMON_MENU_9")
menu_additem(menu, option, "9", 0)

menu_setprop(menu, MPROP_NEXTNAME, "Далее")
menu_setprop(menu, MPROP_BACKNAME, "Назад")
menu_setprop(menu, MPROP_EXITNAME, "Выход")
menu_setprop(menu, MPROP_EXIT,MEXIT_ALL)
menu_display(id,menu,0)
}else{
client_print(id, print_center, "%L", LANG_SERVER, "JBE_SM_ONLYSIMON")
}
return PLUGIN_HANDLED
}

public smenu_handler(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}

static dst[32], data[5], access, callback

menu_item_getinfo(menu, item, access, data, charsmax(data), dst, charsmax(dst), callback)
menu_destroy(menu)
get_user_name(id, dst, charsmax(dst))

switch(data[0])
{
case ('1'):
{
jail_open()
cmd_simonmenu(id)
}
case ('2'):
{
emit_sound(0, CHAN_AUTO, "JBprogame/jail_mode/bell.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
cmd_simonmenu(id)
}
case ('3'):
{
cmd_freeday(id)
}
case ('4'):
{
if(GetAliveCt() < 2)
{
ChatColor(id,"%L", LANG_SERVER, "JBE_ACCESS_TRANSLITE")
cmd_simonmenu(id)
}else{
Translate_Player(id)
}
}
case ('5'):
{
if(GetAliveTT() < 2)
{
ChatColor(id,"%L", LANG_SERVER, "JBE_ACCESS_GAME_BOX")
cmd_simonmenu(id)
}else{
if(g_Simon == id)
{
if(g_GameBox[id])
{
cmd_nobox(id)
g_GameBox[id] = 0
}else{
cmd_box(id)
g_GameBox[id] = 1
}
cmd_simonmenu(id)
client_print(0, print_console, "Simon %s ON BOX", dst)
}
}
}
case ('6'):
{
if(GetAliveTT() < 1)
{
ChatColor(id,"%L", LANG_SERVER, "JBE_ACCESS_VOICE")
cmd_simonmenu(id)
}else{
cmd_voice(id)
}
}
case ('7'):
{
cmd_timer_menu(id)
}
case ('8'):
{
if(GetAliveCt() < 2)
{
ChatColor(id,"%L", LANG_SERVER, "JBE_ACCESS_RESET")
cmd_simonmenu(id)
}else{
cmd_simonreset(id)
}
}
case ('9'):
{
client_cmd(id, "say /football")
}
}
return PLUGIN_HANDLED
}

public cmd_open(id)
{
if(id == g_Simon)
jail_open()

return PLUGIN_HANDLED
}

public cmd_box(id)
{
new szName[32];
get_user_name(id, szName, charsmax(szName))
static i
if((id < 0) || (is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT))
{
if(g_TeamAlive[CS_TEAM_T] <= get_pcvar_num(gp_BoxMax) && g_TeamAlive[CS_TEAM_T] > 1)
{
for(i = 1; i <= g_MaxClients; i++)
if(is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T)
set_user_health(i, 100)

set_cvar_num("mp_tkpunish", 0)
set_cvar_num("mp_friendlyfire", 1)
g_BoxStarted = 1
emit_sound(0, CHAN_AUTO, "JBprogame/jail_mode/bell.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
player_hudmessage(0, 1, 3.0,{255, 255, 255}, "%L", LANG_SERVER, "JBE_GUARD_BOX")
ChatColor(0,"[^4z0na55^3]^1 Игрок ^4%s ^3включил бокс.", szName)
}else player_hudmessage(0, 1, 3.0,{255, 255, 255}, "%L", LANG_SERVER, "JBE_GUARD_CANTBOX")
}
return PLUGIN_HANDLED
}

public cmd_nobox(id)
{
new szName[32];
get_user_name(id, szName, charsmax(szName))
static i
if((id < 0) || (is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT))
{
if(g_BoxStarted)
{
for(i = 1; i <= g_MaxClients; i++)
if(is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T)
engclient_cmd(i, "weapon_knife")

g_BoxStarted = 0
set_cvar_num("mp_friendlyfire", 0)
emit_sound(0, CHAN_AUTO, "JBprogame/jail_mode/bell.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
player_hudmessage(0, 1, 3.0,{255, 255, 255}, "%L", LANG_SERVER, "JBE_GUARD_BOX_OFF")
ChatColor(0, "[^4z0na55^3]^1 Игрок ^4%s ^3выключил бокс.", szName)
}else player_hudmessage(id, 1, 3.0,{255, 255, 255}, "%L", LANG_SERVER, "JBE_GUARD_BOX_ON")
}
return PLUGIN_HANDLED
}

public cmd_freeday(id)
{
static menu, menuname[32], option[64]
if(!is_freeday() && ((is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT) || is_user_admin(id)))
{
formatex(menuname, charsmax(menuname), "%L", LANG_SERVER, "JBE_MENU_FREEDAY")
menu = menu_create(menuname, "freeday_choice")

formatex(option, charsmax(option), "%L", LANG_SERVER, "JBE_MENU_FREEDAY_PLAYER")
menu_additem(menu, option, "1", 0)

formatex(option, charsmax(option), "%L", LANG_SERVER, "JBE_MENU_FREEDAY_ALL")
menu_additem(menu, option, "2", 0)

menu_display(id, menu)
}
return PLUGIN_HANDLED
}

public cmd_freeday_player(id)
{
if((is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT) || is_user_admin(id))
menu_players(id, CS_TEAM_T, id, 1, "freeday_select", "%L", LANG_SERVER, "JBE_MENU_FREEDAY")

return PLUGIN_CONTINUE
}

public cmd_lastrequest(id)
{
new Players[32]
new playerCount, i, TAlive

get_players(Players, playerCount, "ac")
for (i=0; i<playerCount; i++)
{
if (is_user_connected(Players))

if ( cs_get_user_team(Players) == CS_TEAM_T )
{
TAlive++;
}
}
if (TAlive == 1)
{
for (i=0; i<playerCount; i++)
{
if ( cs_get_user_team(Players) == CS_TEAM_T )
{
g_PlayerLast = Players;
if (get_pcvar_num(gp_AutoLastresquest)) cmd_lastrequest_2(Players)
break;
}
}
}
return PLUGIN_CONTINUE
}

public cmd_lastrequest_2(id)
{
if(g_GameMode == 1 || g_GameMode == 2 || g_GameMode == 3 || g_GameMode == 4 || g_GameMode == 5 || g_GameMode == 6 || g_GameMode == 7 || g_GameMode == 8)
return PLUGIN_HANDLED

static i, num[5], menu, menuname[32], option[64]
if(g_LastDenied || id != g_PlayerLast || g_RoundEnd || !is_user_alive(id))
return PLUGIN_CONTINUE

formatex(menuname, charsmax(menuname), "%L", LANG_SERVER, "JBE_MENU_LASTREQ")
menu = menu_create(menuname, "lastrequest_select")

formatex(option, charsmax(option), "%L", LANG_SERVER, "JBE_MENU_LASTREQ_OPT1")
menu_additem(menu, option, "1", 0)

formatex(option, charsmax(option), "%L", LANG_SERVER, "JBE_MENU_LASTREQ_OPT9")
menu_additem(menu, option, "9", 0)

formatex(option, charsmax(option), "%L", LANG_SERVER, "JBE_MENU_LASTREQ_OPT2")
menu_additem(menu, option, "2", 0)

formatex(option, charsmax(option), "%L", LANG_SERVER, "JBE_MENU_LASTREQ_OPT3")
menu_additem(menu, option, "3", 0)

for(i = 0; i < sizeof(_Duel); i++)
{
num_to_str(i + 4, num, charsmax(num))
formatex(option, charsmax(option), "%L", LANG_SERVER, _Duel[_opt])
menu_additem(menu, option, num, 0)
}
menu_setprop(menu, MPROP_NEXTNAME, "Далее")
menu_setprop(menu, MPROP_BACKNAME, "Назад")
menu_setprop(menu, MPROP_EXITNAME, "Выход")
menu_setprop(menu, MPROP_EXIT,MEXIT_ALL)

menu_display(id, menu)
return PLUGIN_CONTINUE
}

public adm_freeday(id)
{
static player, user[32]
if(!is_user_admin(id))
return PLUGIN_CONTINUE

read_argv(1, user, charsmax(user))
player = cmd_target(id, user, 2)
if(is_user_connected(player) && cs_get_user_team(player) == CS_TEAM_T)
{
freeday_set(id, player)
}
return PLUGIN_HANDLED
}

public adm_open(id)
{
if(!is_user_admin(id))
return PLUGIN_CONTINUE

new name[32]
get_user_name(id, name, charsmax(name))
player_hudmessage(0, 1, 3.0,{150, 150, 150}, "%L", LANG_SERVER, "JBE_OPEN_DOORS", name)

jail_open()
return PLUGIN_HANDLED
}

public adm_box(id)
{
if(!is_user_admin(id))
return PLUGIN_CONTINUE

cmd_box(-1)
return PLUGIN_HANDLED
}

public team_select(id, key)
{
static CsTeams:team, roundloop, admin

roundloop = get_pcvar_num(gp_RetryTime) / 2
team = cs_get_user_team(id)
admin = is_user_admin(id)
team_count()

if(!admin && (team == CS_TEAM_UNASSIGNED) && (g_RoundStarted >= roundloop) && g_TeamCount[CS_TEAM_CT] && g_TeamCount[CS_TEAM_T] && !is_user_alive(id))
{
team_join(id, CS_TEAM_SPECTATOR)
client_print(id, print_center, "%L", LANG_SERVER, "JBE_TEAM_CANTJOIN")
return PLUGIN_HANDLED
}


switch(key)
{
case(0):
{
if(team == CS_TEAM_T)
return PLUGIN_HANDLED

team_join(id, CS_TEAM_T)
}
case(1):
{
if(team == CS_TEAM_CT || (!admin && get_bit(g_PlayerNomic, id)))
return PLUGIN_HANDLED

if(g_TeamCount[CS_TEAM_CT] < ctcount_allowed() || admin)
team_join(id, CS_TEAM_CT)
else
client_print(id, print_center, "%L", LANG_SERVER, "JBE_TEAM_CTFULL")
}
case(5):
{
user_silentkill(id)
team_join(id, CS_TEAM_SPECTATOR)
}
}
return PLUGIN_HANDLED
}

public Translate_Player(id)
{
new menu = menu_create( "\wСписок Охранников:", "tranlist_menu_player" )
new players[32], pnum, tempid
new szName[32], szTempid[10]
cs_get_user_team(id)

get_players(players, pnum)

for(new i; i<pnum; i++)
{
if(get_user_team(players) != 2 || !is_user_alive(players))
continue

if((get_user_flags(players) & ADMIN_BAN))
continue;

if(id == players)
continue

tempid = players

if(!is_user_alive(tempid))
{

}else{
get_user_name(tempid, szName, 31)
num_to_str(tempid, szTempid, 9)

menu_additem(menu, szName, szTempid, 0)
}
}
menu_setprop( menu, MPROP_NEXTNAME, "Дальше")
menu_setprop( menu, MPROP_BACKNAME, "Назад")
menu_setprop( menu, MPROP_EXITNAME, "Выход")

menu_display(id, menu, 0)
return PLUGIN_HANDLED
}

public tranlist_menu_player(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}

new data[6], iName[64], playername[33], playername2[33]
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)

new tempid = str_to_num(data)
cs_get_user_team(tempid)

get_user_name(id, playername, 32)
get_user_name(tempid, playername2, 32)

user_kill(tempid)
cs_set_user_team(tempid, CS_TEAM_T)
set_user_info(tempid, "model", server_model)
set_pev(tempid, pev_body, 2)
set_pev(tempid, pev_skin, random_num(0, 2))
g_Translate[tempid] = true
ChatColor(0, "%L", LANG_SERVER, "JBE_TRANSLIT_PLAYER",playername, playername2)

menu_destroy(menu)
return PLUGIN_HANDLED
}

public team_join(id, CsTeams:team)
{
static restore, vgui, msgblock

restore = get_pdata_int(id, m_iVGUI)
vgui = restore & (1<<0)
if(vgui)
set_pdata_int(id, m_iVGUI, restore & ~(1<<0))

switch(team)
{
case CS_TEAM_SPECTATOR:
{
msgblock = get_msg_block(g_MsgShowMenu)
set_msg_block(g_MsgShowMenu, BLOCK_ONCE)
dllfunc(DLLFunc_ClientPutInServer, id)
set_msg_block(g_MsgShowMenu, msgblock)
set_pdata_int(id, m_fGameHUDInitialized, 1)
engclient_cmd(id, "jointeam", "6")
}
case CS_TEAM_T, CS_TEAM_CT:
{
msgblock = get_msg_block(g_MsgShowMenu)
set_msg_block(g_MsgShowMenu, BLOCK_ONCE)
engclient_cmd(id, "jointeam", (team == CS_TEAM_CT) ? "2" : "1")
engclient_cmd(id, "joinclass", "1")
set_msg_block(g_MsgShowMenu, msgblock)
g_PlayerSpect[id] = 0
}
}

if(vgui)
set_pdata_int(id, m_iVGUI, restore)
}

public team_count()
{
static CsTeams:team, last
g_TeamCount[CS_TEAM_UNASSIGNED] = 0
g_TeamCount[CS_TEAM_T] = 0
g_TeamCount[CS_TEAM_CT] = 0
g_TeamCount[CS_TEAM_SPECTATOR] = 0
g_TeamAlive[CS_TEAM_UNASSIGNED] = 0
g_TeamAlive[CS_TEAM_T] = 0
g_TeamAlive[CS_TEAM_CT] = 0
g_TeamAlive[CS_TEAM_SPECTATOR] = 0
for(new i = 1; i <= g_MaxClients; i++)
{
if(is_user_connected(i))
{
team = cs_get_user_team(i)
g_TeamCount[team]++
g_PlayerTeam = team
if(is_user_alive(i))
{
g_TeamAlive[team]++
if(team == CS_TEAM_T)
last = i
}
}
else
{
g_PlayerTeam = CS_TEAM_UNASSIGNED
}
}
if(g_TeamAlive[CS_TEAM_T] == 1)
{
if(last != g_PlayerLast && g_SafeTime)
{
prisoner_last(last)
}
}
else
{
if(g_Duel || g_DuelA || g_DuelB)
{
if(is_user_alive(g_DuelA))
{
set_user_rendering(g_DuelA, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)
player_strip_weapons(g_DuelA)
}

if(is_user_alive(g_DuelB))
{
set_user_rendering(g_DuelB, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)
player_strip_weapons(g_DuelB)
}

}
g_PlayerLast = 0
g_DuelA = 0
g_DuelB = 0
g_Duel = 0
}
}

public revolt_start()
{
if(g_GameMode == 1 || g_GameMode == 2 || g_GameMode == 3 || g_GameMode == 4 || g_GameMode == 5 || g_GameMode == 6 || g_GameMode == 7 || g_GameMode == 8)
return PLUGIN_HANDLED

emit_sound(0, CHAN_AUTO, "JBprogame/timepass_ac.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
hud_status(0)

set_dhudmessage(255, 0, 0, -1.0, 0.71, 0, 6.0, 12.0)
show_dhudmessage(0, "ВНИМАНИЕ, БУНТ!")

return PLUGIN_HANDLED
}

public hud_status(task)
{
if(g_RoundStarted < (get_pcvar_num(gp_RetryTime) / 2))
g_RoundStarted++

if(!g_Freeday && !g_Simon && g_SimonAllowed && (0.0 < g_SimonRandom < get_gametime()))
{
cmd_simon(random_num(1, g_MaxClients))
}

gc_TalkMode = get_pcvar_num(gp_TalkMode)
gc_VoiceBlock = get_pcvar_num(gp_VoiceBlock)
gc_SimonSteps = get_pcvar_num(gp_SimonSteps)
gc_ButtonShoot = get_pcvar_num(gp_ButtonShoot)
gc_CrowbarMul = get_pcvar_float(gp_CrowbarMul)
}

public safe_time(task)
g_SafeTime = 1

public check_freeday(task)
{
static Float:roundmax, i
if(!g_Simon && !g_PlayerLast)
{
g_Freeday = 1
g_FreedayBlock = 1
hud_status(0)
roundmax = get_pcvar_float(gp_RoundMax)
if(roundmax > 0.0)
{
for(i = 1; i <= g_MaxClients; i++)
{
if(is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T)
freeday_set(0, i)
}

emit_sound(0, CHAN_AUTO, "JBprogame/jail_mode/bell.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
player_hudmessage(0, 8, 3.0, {255, 255, 255}, "%L", LANG_SERVER, "JBE_STATUS_ENDTIMER", floatround(roundmax - 60.0))
remove_task(TASK_ROUND)
}
}
if(get_pcvar_num(gp_AutoOpen))
jail_open()
}

public freeday_end(task)
{
if(g_Freeday || g_PlayerFreeday)
{
g_FreedayBlock = 1
client_cmd(0, "mp3 stop")
emit_sound(0, CHAN_AUTO, "JBprogame/task_complete.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)

new Players[32]
new playerCount, i
get_players(Players, playerCount, "ac")
for (i=0; i<playerCount; i++)
{
if(cs_get_user_team(Players) == CS_TEAM_T)
{
if(g_PlayerWanted)
{
if(jb_user_member_gang(Players))
{
set_user_info(Players, "model", "zona_banda")
entity_set_int(Players, EV_INT_skin, 7)
}
else entity_set_int(Players, EV_INT_skin, 4)
}
if(jb_user_member_gang(Players))
{
set_user_info(Players, "model", "zona_banda")
entity_set_int(Players, EV_INT_skin, jb_gang_skin())
}
else entity_set_int(Players, EV_INT_skin, random_num(0,2))
}
}
}
g_PlayerFreeday = 0
g_Freeday = 0
hud_status(0)
}

public check_end(task)
{
team_count()
for(new i = 1; i <= g_MaxClients; i++)
{
if(g_PlayerTeam == CS_TEAM_T && is_user_alive(i))
{
//user_silentkill(i)
//cs_set_user_deaths(i, get_user_deaths(i) - 1)
}
}
for(new i = 1; i <= g_MaxClients; i++)
{
if(g_PlayerTeam == CS_TEAM_CT && is_user_alive(i))
{
//user_silentkill(i)
//cs_set_user_deaths(i, get_user_deaths(i) - 1)
}
}
}

public cmd_timer_menu(id)
{
if(cs_get_user_team(id) != CS_TEAM_CT)
return PLUGIN_HANDLED

new classic_menu1 = menu_create("\wДать Отчет", "menu_timer")
menu_additem(classic_menu1, "\wОт 3", "1")
menu_additem(classic_menu1, "\wОт 5", "2")
menu_additem(classic_menu1, "\wОт 7", "3")
menu_additem(classic_menu1, "\wОт 10", "4")

menu_setprop(classic_menu1, MPROP_EXITNAME, "Выход")
menu_setprop(classic_menu1, MPROP_EXIT,MEXIT_ALL)

menu_display(id,classic_menu1,0)
return PLUGIN_HANDLED
}

public menu_timer(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new s_Data[6], s_Name[64], i_Access, i_Callback
menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)
new i_Key = str_to_num(s_Data)

switch(i_Key)
{
case 1:
{
if(g_Counted) return PLUGIN_HANDLED
g_Count = 3
g_Counted = true
set_task(1.0, "Count_Timer", 55, "", 0, "b")
}
case 2:
{
if(g_Counted) return PLUGIN_HANDLED
g_Count = 5
g_Counted = true
set_task(1.0, "Count_Timer", 66, "", 0, "b")
}
case 3:
{
if(g_Counted) return PLUGIN_HANDLED
g_Count = 7
g_Counted = true
set_task(1.0, "Count_Timer", 77, "", 0, "b")
}
case 4:
{
if(g_Counted) return PLUGIN_HANDLED
g_Count = 10
g_Counted = true
set_task(1.0, "Count_Timer", 88, "", 0, "b")
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}

public Count_Timer(id)
{
if(g_Count == 1)
{
remove_task(id)
g_Counted = false
}
client_print(0, print_center, "%L", LANG_SERVER, "JBE_TIMER_OTSHET", g_Count);
client_cmd(0, "mp3 play sound/%s", sounds[g_Count])
g_Count--
}

public prisoner_last(id)
{
static name[32], Float:roundmax
if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
{
roundmax = get_pcvar_float(gp_RoundMax)
get_user_name(id, name, charsmax(name))
g_PlayerLast = id
player_hudmessage(0, 6, 5.0, {255, 255, 255}, "%L", LANG_SERVER, "JBE_PRISONER_LAST", name)
remove_task(TASK_ROUND)
if(roundmax > 0.0)
{
set_task(roundmax - 60.0, "check_end", TASK_ROUND)
}
if((g_TeamAlive[CS_TEAM_CT] > 0) && get_pcvar_num(gp_AutoLastresquest))
cmd_lastrequest(id)
}
}

public freeday_select(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}

static dst[32], data[5], player, access, callback

menu_item_getinfo(menu, item, access, data, charsmax(data), dst, charsmax(dst), callback)
player = str_to_num(data)
freeday_set(id, player)
static name1[32],name2[32];
get_user_name(id, name1, charsmax(name1))
get_user_name(player, name2, charsmax(name2))
ChatColor(0,"%s дал фд %s",name1,name2)
return PLUGIN_HANDLED
}

public duel_knives(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
g_LastDenied = 0
return PLUGIN_HANDLED
}

static dst[32], data[5], access, callback, option[128], player, src[32]

menu_item_getinfo(menu, item, access, data, charsmax(data), dst, charsmax(dst), callback)
get_user_name(id, src, charsmax(src))
player = str_to_num(data)
formatex(option, charsmax(option), "%L^n%L", LANG_SERVER, "JBE_MENU_LASTREQ_SEL3", src, LANG_SERVER, "JBE_MENU_DUEL_SEL", src, dst)
player_hudmessage(0, 6, 3.0, {255, 255, 255}, option)

g_DuelA = id
clear_bit(g_PlayerCrowbar, id)
player_strip_weapons(id)
player_glow(id, g_Colors[3])
set_user_health(id, 100)

g_DuelB = player
player_strip_weapons(player)
player_glow(player, g_Colors[2])
set_user_health(player, 100)

g_BlockWeapons = 1
return PLUGIN_HANDLED
}

public duel_guns(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
g_LastDenied = 0
g_Duel = 0
return PLUGIN_HANDLED
}

static gun, dst[32], data[5], access, callback, option[128], player, src[32]

menu_item_getinfo(menu, item, access, data, charsmax(data), dst, charsmax(dst), callback)
get_user_name(id, src, charsmax(src))
player = str_to_num(data)
formatex(option, charsmax(option), "%L^n%L", LANG_SERVER, _Duel[g_Duel - 4][_sel], src, LANG_SERVER, "JBE_MENU_DUEL_SEL", src, dst)
emit_sound(0, CHAN_AUTO, "JBprogame/jail_mode/duels1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
player_hudmessage(0, 6, 3.0, {255, 255, 255}, option)

g_DuelA = id
clear_bit(g_PlayerCrowbar, id)
clear_bit(g_PlayerCrowbar2, id)
player_strip_weapons(id)
gun = give_item(id, _Duel[g_Duel - 4][_entname])
cs_set_weapon_ammo(gun, 1)
set_user_health(id, 100)
player_glow(id, g_Colors[3])

g_DuelB = player
player_strip_weapons(player)
gun = give_item(player, _Duel[g_Duel - 4][_entname])
cs_set_weapon_ammo(gun, 1)
set_user_health(player, 100)
player_glow(player, g_Colors[2])

g_BlockWeapons = 1
return PLUGIN_HANDLED
}

public freeday_choice(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}

static dst[32], data[5], access, callback

menu_item_getinfo(menu, item, access, data, charsmax(data), dst, charsmax(dst), callback)
menu_destroy(menu)
get_user_name(id, dst, charsmax(dst))
switch(data[0])
{
case('1'):
{
cmd_freeday_player(id)
}
case('2'):
{
if((id == g_Simon) || is_user_admin(id))
{
if(!g_FreedayBlock)
{
g_Simon = 0
check_freeday(TASK_FREEDAY)
ChatColor(0,"%s дал всем ФД!",dst)
} else ChatColor(id,"В этом раунде уже был выходной")
}
}
}
return PLUGIN_HANDLED
}

public lastrequest_select(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}

static i, dst[32], data[5], access, callback, option[64]

menu_item_getinfo(menu, item, access, data, charsmax(data), dst, charsmax(dst), callback)
get_user_name(id, dst, charsmax(dst))
switch(data[0])
{
case('1'):
{
formatex(option, charsmax(option), "%L", LANG_SERVER, "JBE_MENU_LASTREQ_SEL1", dst)
player_hudmessage(0, 6, 3.0, {255, 255, 255}, option)
set_bit(g_FreedayAuto, id)
user_silentkill(id)
}
case('2'):
{
if(GetAliveCt() > 0)
{
formatex(option, charsmax(option), "%L", LANG_SERVER, "JBE_MENU_LASTREQ_SEL2", dst)
player_hudmessage(0, 6, 3.0, {255, 255, 255}, option)
g_Duel = 2
player_strip_weapons_all()
i = random_num(0, sizeof(_WeaponsFree) - 1)
give_item(id, _WeaponsFree)
g_BlockWeapons = 1
cs_set_user_bpammo(id, _WeaponsFreeCSW, _WeaponsFreeAmmo)
}else ChatColor(id,"Нельзя выбрать дуэль, нет противников.")
}
case('3'):
{
if(GetAliveCt() > 0)
{
g_Duel = 3
menu_players(id, CS_TEAM_CT, 0, 1, "duel_knives", "%L", LANG_SERVER, "JBE_MENU_DUEL")
}else ChatColor(id,"Нельзя выбрать дуэль, нет противников.")
}
case('9'):
{
user_silentkill(id)
cs_set_user_money(id, 16000)
formatex(option, charsmax(option), "%L", LANG_SERVER, "JBE_MENU_LASTREQ_SEL9", dst)
player_hudmessage(0, 6, 3.0, {255, 255, 255}, option)
}
default:
{
if(GetAliveCt() > 0)
{
g_Duel = str_to_num(data)
menu_players(id, CS_TEAM_CT, 0, 1, "duel_guns", "%L", LANG_SERVER, "JBE_MENU_DUEL")
}else ChatColor(id,"Нельзя выбрать дуэль, нет противников.")
}
}
g_LastDenied = 1
menu_destroy(menu)
return PLUGIN_HANDLED
}

public cmd_weapon_menu(id)
{
if(g_GameMode == 1 || g_GameMode == 2 || g_GameMode == 3 || g_GameMode == 4 || g_GameMode == 5 || g_GameMode == 6 || g_GameMode == 7 || g_GameMode == 8)
return PLUGIN_HANDLED

new wMenu = menu_create("Выберите Оружие:","cmd_menu_weapon")

menu_additem(wMenu, "Взять [Aк-47 + Deagle]","1")
menu_additem(wMenu, "Взять [M4A1 + Deagle]","2")
menu_additem(wMenu, "Взять [Famas + Deagle]","3")
menu_additem(wMenu, "Взять [Awp + Deagle]","4")
menu_additem(wMenu, "Взять [M3 + Deagle]","5")
menu_additem(wMenu, "Взять [M249 + Deagle]^n","6")

if(get_user_flags(id) & ADMIN_LEVEL_D)
menu_additem(wMenu, "Ak-47 \yNew \r+\d Deagle^n","7")
else
menu_additem(wMenu, "Ak-47 \yNew \r+\d Deagle^n","7",ADMIN_ADMIN)

menu_setprop(wMenu, MPROP_EXITNAME, "Выход")
menu_setprop(wMenu, MPROP_EXIT,MEXIT_ALL)
menu_display(id,wMenu,0)
return PLUGIN_HANDLED
}

public cmd_menu_weapon(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}

new data[6], iName[64], access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)

switch(key)
{
case 1:
{
give_item(id,"weapon_ak47")
cs_set_user_bpammo(id,CSW_AK47,100)
}
case 2:
{
give_item(id,"weapon_m4a1")
cs_set_user_bpammo( id,CSW_M4A1,100)
}
case 3:
{
give_item(id,"weapon_famas")
cs_set_user_bpammo(id,CSW_FAMAS,100)
}
case 4:
{
give_item(id, "weapon_awp")
cs_set_user_bpammo(id, CSW_AWP, 100)
}
case 5:
{
give_item( id,"weapon_m3")
cs_set_user_bpammo(id,CSW_M3,100)
}
case 6:
{
give_item(id,"weapon_m249")
cs_set_user_bpammo(id,CSW_M249,200)
}
case 7:
{
Simon_Ak47_Gold(id)
}
}
menu_destroy(menu)
return PLUGIN_HANDLED;
}

public setup_buttons()
{
new ent[3]
new Float:origin[3]
new info[32]
new pos

while((pos <= sizeof(g_Buttons)) && (ent[0] = engfunc(EngFunc_FindEntityByString, ent[0], "classname", "info_player_deathmatch")))
{
pev(ent[0], pev_origin, origin)
while((ent[1] = engfunc(EngFunc_FindEntityInSphere, ent[1], origin, CELL_RADIUS)))
{
if(!is_valid_ent(ent[1]))
continue

entity_get_string(ent[1], EV_SZ_classname, info, charsmax(info))
if(!equal(info, "func_door"))
continue

entity_get_string(ent[1], EV_SZ_targetname, info, charsmax(info))
if(!info[0])
continue

if(TrieKeyExists(g_CellManagers, info))
{
TrieGetCell(g_CellManagers, info, ent[2])
}
else
{
ent[2] = engfunc(EngFunc_FindEntityByString, 0, "target", info)
}

if(is_valid_ent(ent[2]) && (in_array(ent[2], g_Buttons, sizeof(g_Buttons)) < 0))
{
g_Buttons[pos] = ent[2]
pos++
break
}
}
}
TrieDestroy(g_CellManagers)
}

stock in_array(needle, data[], size)
{
for(new i = 0; i < size; i++)
{
if(data == needle)
return i
}
return -1
}

stock freeday_set(id, player)
{
static src[32], dst[32]
get_user_name(player, dst, charsmax(dst))

if(is_user_alive(player) && !get_bit(g_PlayerWanted, player))
{
set_bit(g_PlayerFreeday, player)
if(jb_user_member_gang(id))
entity_set_int(player, EV_INT_skin, 6)
else entity_set_int(player, EV_INT_skin, 3)
if(get_pcvar_num(gp_GlowModels))
player_glow(player, g_Colors[1])

if(0 < id <= g_MaxClients)
{
get_user_name(id, src, charsmax(src))
player_hudmessage(0, 1, 3.0,{150, 150, 150}, "%L", LANG_SERVER, "JBE_GUARD_FREEDAYGIVE", src, dst)
}
else if(!is_freeday())
{
player_hudmessage(0, 1, 3.0,{150, 150, 150}, "%L", LANG_SERVER, "JBE_PRISONER_HASFREEDAY", dst)
}
}
}

stock first_join(id)
{
if(!get_bit(g_PlayerJoin, id))
set_bit(g_PlayerJoin, id)
}

stock ctcount_allowed()
{
static count
count = ((g_TeamCount[CS_TEAM_T] + g_TeamCount[CS_TEAM_CT]) / get_pcvar_num(gp_TeamRatio))
if(count < 2)
count = 2
else if(count > get_pcvar_num(gp_CtMax))
count = get_pcvar_num(gp_CtMax)

return count
}

stock player_hudmessage(id, hudid, Float:time = 0.0, color[3] = {255, 255, 255}, msg[], any:...)
{
static text[512], Float:x, Float:y
x = g_HudSync[hudid][_x]
y = g_HudSync[hudid][_y]

if(time > 0)
set_hudmessage(color[0], color[1], color[2], x, y, 0, 0.00, time, 0.00, 0.00, -1)
else
set_hudmessage(color[0], color[1], color[2], x, y, 0, 0.00, g_HudSync[hudid][_time], 0.00, 0.00, -1)

vformat(text, charsmax(text), msg, 6)
ShowSyncHudMsg(id, g_HudSync[hudid][_hudsync], text)
}

stock menu_players(id, CsTeams:team, skip, alive, callback[], title[], any:...)
{
static i, name[32], num[5], menu, menuname[32]
vformat(menuname, charsmax(menuname), title, 7)
menu = menu_create(menuname, callback)
for(i = 1; i <= g_MaxClients; i++)
{
if(!is_user_connected(i) || (alive && !is_user_alive(i)) || (skip == i))
continue

if(!(team == CS_TEAM_T || team == CS_TEAM_CT) || ((team == CS_TEAM_T || team == CS_TEAM_CT) && (cs_get_user_team(i) == team)))
{
get_user_name(i, name, charsmax(name))
num_to_str(i, num, charsmax(num))
menu_additem(menu, name, num, 0)
}
}
menu_display(id, menu)
}

stock player_glow(id, color[3], amount=40)
set_user_rendering(id, kRenderFxGlowShell, color[0], color[1], color[2], kRenderNormal, amount)

stock player_strip_weapons(id)
{
strip_user_weapons(id)
give_item(id, "weapon_knife")
set_pdata_int(id, m_iPrimaryWeapon, 0)
}

stock player_strip_weapons_all()
{
for(new i = 1; i <= g_MaxClients; i++)
{
if(is_user_alive(i))
player_strip_weapons(i)
}
}

stock is_freeday()
return (g_FreedayNext || g_Freeday || (g_JailDay == 1))

public plugin_natives()
{
register_native("jbe_freeday_give", "cmd_give_freeday", 1)
register_native("jbe_is_user_simon", "native_get_user_simon", 1)
register_native("jb_set_box_off", "cmd_box_native_off", 1)
register_native("jb_set_box_on", "cmd_box_native_on", 1)

register_native("jbe_nowanted", "cmd_jbe_nowanted", 1)
register_native("jbe_ctclothes", "cmd_jbe_ctclothes", 1)
//register_native("jbe_clown", "cmd_jbe_clown", 1)

register_native("jb_get_gamemode", "get_gamemode", 1)

register_native("jb_get_last", "get_last", 1)
register_native("jb_give_crowbar", "jb_give_crowbar", 1)

register_native("jb_set_game", "jb_set_game", 1)
register_native("jb_get_day", "jb_get_day", 1)
register_native("jb_get_wanted", "get_wanted", 1)
}

public jb_get_day()
return g_RoundDay

public jb_set_game(num)
{
switch(num)
{
case 1: cmd_game_zombie()
case 2: cmd_game_iviz()
case 3: cmd_game_sparta()
case 4: cmd_game_shark()
case 5: cmd_game_alien()
case 6: cmd_game_runner()
case 7: cmd_game_hide()
case 8:
{
jb_set_chay()
g_GameMode = 8
g_TimerOver = 300
set_task(300.0, "cmd_game_over", TASK_GAME_OVER, _, _, "b")
jail_open()
}
case 9: cmd_game_sniper()
}
}

public jb_give_crowbar(id)
{
if(get_user_weapon(id) == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/v_crowbar.mdl")
set_pev(id, pev_weaponmodel2, "models/p_crowbar.mdl")
}
set_bit(g_PlayerCrowbar2, id)
}

public get_last()
return g_PlayerLast
public get_gamemode()
return g_GameMode

public bool:get_wanted(id)
{
if(get_bit(g_PlayerWanted, id))
return true
return false
}

public cmd_jbe_nowanted(id)
{
if(get_bit(g_PlayerWanted, id))
{
clear_bit(g_PlayerWanted, id)

if(jb_user_member_gang(id))
{
set_user_info(id, "model", "zona_banda")
entity_set_int(id, EV_INT_skin, jb_gang_skin())
}
else
{
set_user_info(id, "model", server_model)
entity_set_int(id, EV_INT_body, 2)
entity_set_int(id, EV_INT_skin, random_num(0, 2))
}
}
}

public cmd_jbe_ctclothes(id)
{
if(cs_get_user_team(id) == CS_TEAM_T)
{
set_user_info(id, "model", server_model)
entity_set_int(id, EV_INT_body, 3)
}
}
// натив(Мод) на BOX-ON(Игрок)
public cmd_box_native_on()
{
if(g_TeamAlive[CS_TEAM_T] <= get_pcvar_num(gp_BoxMax) && g_TeamAlive[CS_TEAM_T] > 1)
{
set_cvar_num("mp_tkpunish", 0)
set_cvar_num("mp_friendlyfire", 1)
g_BoxStarted = 1
}
}
// натив(Мод) на BOX-OFF(Игрок)
public cmd_box_native_off()
{
if(g_TeamAlive[CS_TEAM_T] <= get_pcvar_num(gp_BoxMax) && g_TeamAlive[CS_TEAM_T] > 1)
{
set_cvar_num("mp_tkpunish", 0)
set_cvar_num("mp_friendlyfire", 0)
g_BoxStarted = 0
}
}

public native_get_user_simon(id)
{
if(cs_get_user_team(id) != CS_TEAM_CT)
return 0

return g_Simon == id? 1 : 0
}

public cmd_give_freeday(id)
{
static dst[32]
get_user_name(id, dst, charsmax(dst))

if(!get_bit(g_PlayerWanted, id))
{
if(is_user_alive(id))
{
set_bit(g_PlayerFreeday, id)
if(jb_user_member_gang(id))
entity_set_int(id, EV_INT_skin, 6)
else entity_set_int(id, EV_INT_skin, 3)
player_hudmessage(0, 1, 3.0,{150, 150, 150}, "Заключенный %s приобрел себе Свободный день", dst)
} else ChatColor(0,"Вы не можете купить Свободный день, вы мертвы")
}
}

public jail_open()
{
static i
for(i = 0; i < sizeof(g_Buttons); i++)
{
if(g_Buttons)
{
ExecuteHamB(Ham_Use, g_Buttons, 0, 0, 1, 1.0)
entity_set_float(g_Buttons, EV_FL_frame, 0.0)
}
}
}

stock GetAliveTT()
{
new CountTT, i
for(i = 1; i <= get_maxplayers(); i++)
if(is_user_alive(i) && is_user_connected(i) && get_user_team(i) == 1)
CountTT++
return CountTT
}

stock GetAliveCt()
{
new CountCt, i
for(i = 1; i <= get_maxplayers(); i++)
if(is_user_alive(i) && is_user_connected(i) && get_user_team(i) == 2)
CountCt++
return CountCt
}

public cmd_simonreset(id)
{
if((id == g_Simon) || is_user_admin(id) )
menu_players(id, CS_TEAM_CT, id, 1, "cmd_simon_ct", "Передать саймона - охранику")
return PLUGIN_CONTINUE
}

public cmd_simon_ct(id, menu, item)
{
if(item == MENU_EXIT ||( g_Simon != id))
{
menu_destroy(menu)
return PLUGIN_HANDLED
}

static dst[32],src[32], data[5], player, access, callback
menu_item_getinfo(menu, item, access, data, charsmax(data), dst, charsmax(dst), callback)
player = str_to_num(data)
if (g_Simon == player)
return PLUGIN_CONTINUE

g_Simon = 0
g_ak47Gold[id] = false
current_weapon_two(id)
client_cmd(player, "simon")
get_user_name(player, dst, charsmax(dst))
get_user_name(id, src, charsmax(src))
entity_set_int(id, EV_INT_body, 3)
ChatColor(0,"%L", LANG_SERVER, "JBE_TRANSLITE_SIMON",src, dst)

return PLUGIN_HANDLED
}

public start_rr_timer()
{
if(g_Restart_Timer == 1)
{
if(g_Freeday)
{
g_Freeday = 0
}
server_cmd("sv_restartround 1")
}
g_Restart_Timer--
}

public Simon_Ak47_Gold(id)
{
g_ak47Gold[id] = true
give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 400)
return PLUGIN_HANDLED
}

public client_authorized(id)
{
client_cmd(id, "bind ^"F3^" ^"say /Menu^"")
}

public check_menu(id)
{
if(!is_user_connected(id))
return

if(get_user_team(id) == 1)
OpenT(id)
else if(get_user_team(id) == 2)
OpenCT(id)
}

public OpenT(id)
{
if(!is_user_connected(id))
return

static menu[512], iLen
iLen = 0

iLen = formatex(menu[iLen], charsmax(menu) - iLen, "\y[\wНАЗВАНИЕ СЕРВЕРА\y]^n\wIP: 194.67.209.188:28129^n^n")

if(g_Freeday)
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w1.\y] \wОткрыть клетки^n")
else iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w1.\y] \dОткрыть клетки^n")

if(is_user_alive(id))
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w2.\y] \wМагазин^n")
else iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w2.\y] \dМагазин^n")

if(GetAliveTT() > 1)
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w3.\y] \wРулетка^n")
else iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w3.\y] \dРулетка^n")

if(is_user_alive(id))
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w4.\y] \wЯ - последний^n")
else iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w4.\y] \dЯ - последний^n")

iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w5.\y] \wПередать деньги^n")
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w6.\y] \wБанды^n")
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w7.\y] \wШапочки^n")
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w8.\y] \wИнформация^n")
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w9.\y] \wЗеленые билеты^n^n")

iLen += formatex(menu[iLen], charsmax(menu) - iLen, "[\w0.\y] \wВыход")

show_menu(id, 1023, menu, -1, "MenuT")
}

public cmd_server_menu_t(id, key)
{
switch(key)
{
case 0:
{
if(g_Freeday)
jail_open()
else ChatColor(id,"%L", LANG_SERVER, "JBE_ACCESS_OPEN")
}
case 1:
{
if(is_user_alive(id))
client_cmd(id, "say /shop")
else ChatColor(id,"!tВы должны быть Живы")
}
case 2:
{
if(is_user_alive(id))
client_cmd(id, "say /lox")
else ChatColor(id,"!tВы должны быть Живы")
}
case 3:
{
if(GetAliveTT() > 1)
ChatColor(id,"%L", LANG_SERVER, "JBE_ACCESS_LR")
else client_cmd(id, "say /lr")
}
case 4:
{
if(is_user_alive(id))
transfermoney(id)
else ChatColor(id,"%L", LANG_SERVER, "JBE_ACCESS_TRANSLITE_MONEY")
}
case 5: client_cmd(id, "say /gang")
case 6:
{
client_cmd(id, "say /hats")
}
case 7: client_cmd(id, "say /vipjj")
case 8: client_cmd(id, "say /life")
}
return PLUGIN_HANDLED
}

public OpenCT(id)
{
if(!is_user_connected(id))
return

static menu[512], iLen
iLen = 0

iLen = formatex(menu[iLen], charsmax(menu) - iLen, "\y[\wНАЗВАНИЕ СЕРВЕРА\y]^n\wIP: 194.67.209.188:28129^n^n")

if(!g_Simon)
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w1.\y] \wВзять Саймона^n")
else
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w1.\y] \dВзять Саймона^n")
if(g_Simon == id)
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w2.\y] \wМеню Саймона^n")
else
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w2.\y] \dМеню Саймона^n")
if(is_user_alive(id))
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w3.\y] \wВкусняшки для КТ^n")
else
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w3.\y] \dВкусняшки для КТ^n")

iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w4.\y] \wЗеленые билеты^n")
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w5.\y] \wШапочки^n")
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w6.\y] \wИгровые дни^n")
iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\y[\w7.\y] \wИнформация^n^n")

iLen += formatex(menu[iLen], charsmax(menu) - iLen, "\r0. \wВыход")

show_menu(id, 1023, menu, -1, "MenuCT")
}

public cmd_server_menu_ct(id, key)
{
switch(key)
{
case 0:
{
if(!g_Simon)
client_cmd(id, "say /simon")
else ChatColor(id,"Нельзя взять начальника тюрьмы, должность уже занята.")
}
case 1:
{
if(g_Simon == id)
client_cmd(id, "say /smenu")
else ChatColor(id,"Вы не !tСаймон!y и не можете открыть !tМеню Саймона")
}
case 2:
{
if(is_user_alive(id))
client_cmd(id, "say /shop")
else ChatColor(id,"!tВы должны быть Живы")
}
case 3:
{
client_cmd(id, "say /life")
}
case 4:
{
client_cmd(id, "say /hats")
}
case 5:
{
if(g_Simon == id) cmd_game_menu(id)
}
case 6:
{
client_cmd(id, "say /vipjj")
}
}
return PLUGIN_HANDLED
}
//======================================================================
//= [Передача денег] Меню с игроками //By SimplePRO
//======================================================================
public transfermoney(id)
{
new i, name[32], num[5], menu, menuitem[64]
menu = menu_create("\wМеню передачи денег:", "transfermoney_choice")
for(i=1; i<=32; i++)
{
if(is_user_connected(i))
{
if(get_user_team(id) == get_user_team(i) && id != i)
{
get_user_name(i, name, charsmax(name))
formatex(menuitem, charsmax(menuitem), "%s \r[\y%i$\r]\w", name, cs_get_user_money(i))
num_to_str(i, num, charsmax(num))
menu_additem(menu, menuitem, num, 0)
}
}
}

menu_setprop(menu, MPROP_EXITNAME, "Выход")
menu_display(id, menu)
return PLUGIN_HANDLED
}

public transfermoney_choice(id, menu, item)
{
if(item == MENU_EXIT)
return PLUGIN_HANDLED
new dst[32], data[5], access, callback
menu_item_getinfo(menu, item, access, data, charsmax(data), dst, charsmax(dst), callback)
menu_destroy(menu)
PlayerCredit[id] = str_to_num(data)
g_TransferMoney[id] = 0
transfermoney_count(id)
return PLUGIN_HANDLED
}

public transfermoney_count(id)
{
new menu, menuname[128], name[32]
get_user_name(PlayerCredit[id], name, charsmax(name))
formatex(menuname, charsmax(menuname), "Передать \r%i$\w ^nИгроку \y%s", g_TransferMoney[id], name)
menu = menu_create(menuname, "transfermoney_count_choice")
if(cs_get_user_money(id) >= g_TransferMoney[id] + 100 && g_TransferMoney[id] <= 15900)
menu_additem(menu, "Добавить 100$", "1", 0)
else
menu_additem(menu, "\dДобавить 100$", "1", 0)
if(cs_get_user_money(id) >= g_TransferMoney[id] + 1000 && g_TransferMoney[id] <= 15000)
menu_additem(menu, "Добавить 1000$", "2", 0)
else
menu_additem(menu, "\dДобавить 1000$", "2", 0)
if(g_TransferMoney[id] >= 100)
menu_additem(menu, "Отнять 100$", "3", 0)
else
menu_additem(menu, "\dОтнять 100$", "3", 0)
if(g_TransferMoney[id] >= 1000)
menu_additem(menu, "Отнять 1000$", "4", 0)
else
menu_additem(menu, "\dОтнять 1000$", "4", 0)
if(cs_get_user_money(id) != 0)
menu_additem(menu, "Добавить все деньги", "5", 0)
else
menu_additem(menu, "\dДобавить все деньги", "5", 0)
if(g_TransferMoney[id] != 0)
menu_additem(menu, "Отнять все деньги^n", "6", 0)
else
menu_additem(menu, "\dОтнять все деньги^n", "6", 0)
if(g_TransferMoney[id] != 0)
menu_additem(menu, "\rПередать", "7", 0)
else
menu_additem(menu, "\dПередать", "7", 0)

menu_setprop(menu, MPROP_EXITNAME, "Выход")
menu_display(id, menu)
return PLUGIN_HANDLED
}

public transfermoney_count_choice(id, menu, item)
{
if(item == MENU_EXIT)
return PLUGIN_HANDLED
new name1[32], name2[32], data[5], dst[32], access, callback
menu_item_getinfo(menu, item, access, data, charsmax(data), dst, charsmax(dst), callback)
menu_destroy(menu)
new key = str_to_num(data)
switch(key)
{
case 1:
{
if(cs_get_user_money(id) >= g_TransferMoney[id] + 100)
{
if(g_TransferMoney[id] <= 15900)
g_TransferMoney[id] = g_TransferMoney[id] + 100
else ChatColor(id, "Количество денег для передачи достигло !tмаксимума.")
}else ChatColor(id, "У Вас недостаточно !tденег.")
transfermoney_count(id)
}
case 2:
{
if(cs_get_user_money(id) >= g_TransferMoney[id] + 1000)
{
if(g_TransferMoney[id] <= 15000)
g_TransferMoney[id] = g_TransferMoney[id] + 1000
else
ChatColor(id, "Количество денег для передачи достигло !tмаксимума.")
} else ChatColor(id, "У Вас недостаточно !tденег.")
transfermoney_count(id)
}
case 3:
{
if(g_TransferMoney[id] >= 100)
g_TransferMoney[id] = g_TransferMoney[id] - 100
else ChatColor(id, "Количество денег для передачи достигло !tминимума.")
transfermoney_count(id)
}
case 4:
{
if(g_TransferMoney[id] >= 1000)
g_TransferMoney[id] = g_TransferMoney[id] - 1000
else ChatColor(id, "Количество денег для передачи достигло !tминимума.")
transfermoney_count(id)
}
case 5:
{
if(cs_get_user_money(id) != 0)
{
g_TransferMoney[id] = cs_get_user_money(id)
if(g_TransferMoney[id] > 16000)
g_TransferMoney[id] = 16000
} else ChatColor(id, "У Вас недостаточно !tденег.")
transfermoney_count(id)
}
case 6:
{
if(g_TransferMoney[id] != 0)
g_TransferMoney[id] = 0
else ChatColor(id, "Нельзя отнять !gденьги!y, количество !tденег!y для передачи равно нулю.")
transfermoney_count(id)
}
case 7:
{
if(g_TransferMoney[id] <= cs_get_user_money(id))
{
if(is_user_connected(PlayerCredit[id]))
{
get_user_name(id, name1, charsmax(name1))
get_user_name(PlayerCredit[id], name2, charsmax(name2))

cs_set_user_money(id, cs_get_user_money(id) - g_TransferMoney[id])
cs_set_user_money(PlayerCredit[id], cs_get_user_money(PlayerCredit[id]) + g_TransferMoney[id])

ChatColor(id, "Вы передали !t%i$!y игроку !g%s.", g_TransferMoney[id], name2)
ChatColor(PlayerCredit[id], "Игрок !t%s!y передал Вам !g%i$.", name1, g_TransferMoney[id])

if(cs_get_user_money(PlayerCredit[id]) > 16000)
cs_set_user_money(PlayerCredit[id], 16000)

PlayerCredit[id] = 0
g_TransferMoney[id] = 0
}else ChatColor(id, "Игрок которому вы передаёте !gденьги отключился.")
}else ChatColor(id, "У Вас недостаточно !tденег!y для !gпередачи.")
}
}
return PLUGIN_HANDLED
}
/*======================================================================================================*/

/*================================================================================
Функция: Меню Игр
=================================================================================*/
public cmd_game_menu(id)
{
if(g_GameMode == 1 || g_GameMode == 2 || g_GameMode == 3 || g_GameMode == 4 || g_GameMode == 5 || g_GameMode == 6 || g_GameMode == 7 || g_GameMode == 8)
return PLUGIN_HANDLED

static menu, menuname[32], option[64]
formatex(menuname, charsmax(menuname), "\wВыберете игру:")
menu = menu_create(menuname, "smenu_game")

formatex(option, charsmax(option), "\wЗомби")
menu_additem(menu, option, "1", 0)

formatex(option, charsmax(option), "\wГалактика")
menu_additem(menu, option, "2", 0)

formatex(option, charsmax(option), "\wСпарта")
menu_additem(menu, option, "3", 0)

formatex(option, charsmax(option), "\wАкула")
menu_additem(menu, option, "4", 0)

formatex(option, charsmax(option), "\wХищник \r(Саймон)")
menu_additem(menu, option, "5", 0)

formatex(option, charsmax(option), "\wДогонялки \r(без оружия)")
menu_additem(menu, option, "6", 0)

formatex(option, charsmax(option), "\wПрятки^n")
menu_additem(menu, option, "7", 0)

formatex(option, charsmax(option), "\wЧай-чай выручай")
menu_additem(menu, option, "8", 0)

formatex(option, charsmax(option), "\wСнайпер^n")
menu_additem(menu, option, "9", 0)

menu_setprop(menu , MPROP_EXITNAME, "Выход")
menu_setprop(menu , MPROP_EXIT, MEXIT_ALL)
menu_display( id, menu, 0 )

return PLUGIN_HANDLED
}
/*================================================================================
Функция: Действие в меню игр
=================================================================================*/
public smenu_game(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}

static dst[32], data[5], access, callback

menu_item_getinfo(menu, item, access, data, charsmax(data), dst, charsmax(dst), callback)
menu_destroy(menu)
get_user_name(id, dst, charsmax(dst))

switch(data[0])
{
case ('1'): cmd_game_zombie()
case ('2'): cmd_game_iviz()
case ('3'): cmd_game_sparta()
case ('4'): cmd_game_shark()
case ('5'): cmd_game_alien()
case ('6'): cmd_game_runner()
case ('7'): cmd_game_hide()
case ('8'):
{
jb_set_chay()
g_GameMode = 8
g_TimerOver = 300
set_task(300.0, "cmd_game_over", TASK_GAME_OVER, _, _, "b")
jail_open()
}
case ('9'): cmd_game_sniper()
}
return PLUGIN_HANDLED
}
/*================================================================================
Режим: Убиваем охранников после отчета
=================================================================================*/
public cmd_game_over()
{
for(new i = 1; i<=zsMaxPlayers; i++)
{
if(is_user_connected(i) && is_user_alive(i))
if(get_user_team(i) == 2)
user_kill(i)
}
}
/*================================================================================
Режим: Спарта
=================================================================================*/
public cmd_game_sparta()
{
jail_open()
set_lights("f")
g_GameMode = 1
g_BlockWeapons = 1
client_cmd(0, "mp3 stop; mp3 play %s", g_Game_2)
for(new i = 1; i<=zsMaxPlayers; i++)
{
if(is_user_connected(i) && is_user_alive(i))
{
if(cs_get_user_team(i) == CS_TEAM_T)
{
player_strip_weapons(i)
give_item(i, "weapon_knife")
give_item(i, "weapon_deagle" )
give_item(i, "weapon_shield" )
cs_set_user_bpammo(i, CSW_DEAGLE, 999)
set_user_health(i,100)
}
else if(cs_get_user_team(i) == CS_TEAM_CT)
{
player_strip_weapons(i)
give_item(i, "weapon_knife")
give_item(i, "weapon_deagle" )
give_item(i, "weapon_shield" )
cs_set_user_bpammo(i, CSW_DEAGLE, 999)
set_user_health(i,400)
}
}
}
g_TimerOver = 130
set_task(130.0, "cmd_game_over", TASK_GAME_OVER, _, _, "b")
}
/*================================================================================
Режим: Неведимки
=================================================================================*/
public cmd_game_iviz()
{
jail_open()
set_lights("c")
g_GameMode = 2
g_BlockWeapons = 1
client_cmd(0, "mp3 stop; mp3 play %s", g_Game_3)
for(new i = 1; i<=zsMaxPlayers; i++)
{
if(is_user_connected(i) && is_user_alive(i))
{
if(cs_get_user_team(i) == CS_TEAM_T)
{
player_strip_weapons(i)
give_item(i, "weapon_knife")
give_item(i, "weapon_scout" )
cs_set_user_nvg(i, true)
cs_set_user_bpammo(i, CSW_SCOUT, 900 )
set_user_gravity(i,0.1)
set_user_health(i,100)
set_user_rendering(i, kRenderFxGlowShell,random_num(0,255),random_num(0,255),random_num(0,255),kRenderNormal,50)
}
else if(cs_get_user_team(i) == CS_TEAM_CT)
{
player_strip_weapons(i)
give_item(i, "weapon_knife")
give_item(i, "weapon_scout" )
cs_set_user_bpammo(i, CSW_SCOUT, 900 )
set_user_gravity(i,0.1)
set_user_health(i,500)
set_user_rendering(i, kRenderFxGlowShell,random_num(0,255),random_num(0,255),random_num(0,255),kRenderNormal,50)
}
}
}
g_TimerOver = 150
set_task(150.0, "cmd_game_over", TASK_GAME_OVER, _, _, "b")
}
/*================================================================================
Режим: Акула
=================================================================================*/
public cmd_game_shark()
{
jail_open()
set_lights("d")
g_GameMode = 3
g_BlockWeapons = 1
emit_sound(0, CHAN_VOICE, "alien_alarm.wav", 1.0, ATTN_NORM, 0, PITCH_LOW)
for(new i = 1; i<=zsMaxPlayers; i++)
{
if(is_user_connected(i) && is_user_alive(i))
{
if(cs_get_user_team(i) == CS_TEAM_T)
{
player_strip_weapons(i)
give_item(i, "weapon_knife")
give_item(i, "weapon_deagle")
give_item(i, "weapon_m3")
cs_set_user_bpammo(i, CSW_DEAGLE, 100 )
cs_set_user_bpammo(i, CSW_M3, 100 )
set_user_health(i,100)
}
else if(cs_get_user_team(i) == CS_TEAM_CT)
{
player_strip_weapons(i)
give_item(i, "weapon_knife")
set_user_health(i,650)
set_user_noclip(i, 1)
}
}
}
g_TimerOver = 160
set_task(160.0, "cmd_game_over", TASK_GAME_OVER, _, _, "b")
}
/*================================================================================
Режим: Снайпер
=================================================================================*/
public cmd_game_sniper()
{
jail_open()
set_lights("c")
g_GameMode = 4
g_BlockWeapons = 1
server_cmd("jb_block_weapons")
emit_sound(0, CHAN_VOICE, "alien_alarm.wav", 1.0, ATTN_NORM, 0, PITCH_LOW)
for(new i = 1; i<=zsMaxPlayers; i++)
{
if(is_user_connected(i) && is_user_alive(i))
{
if(cs_get_user_team(i) == CS_TEAM_T)
{
g_SpeedPlayer = true
player_strip_weapons(i)
give_item(i, "weapon_knife")
set_user_health(i,100)
set_user_maxspeed(i, 510.0)
set_user_gravity(i,0.3)
}
else if(cs_get_user_team(i) == CS_TEAM_CT)
{
player_strip_weapons(i)
give_item(i, "weapon_knife")
give_item(i, "weapon_awp" )
cs_set_user_bpammo(i, CSW_AWP, 900 )
set_user_health(i,200)
}
}
}
g_TimerOver = 130
set_task(130.0, "cmd_game_over", TASK_GAME_OVER, _, _, "b")
}
/*================================================================================
Режим: Догонялки
=================================================================================*/
public cmd_game_runner()
{
jail_open()
set_lights("d")
g_GameMode = 5
g_BlockWeapons = 1
client_cmd(0, "mp3 stop; mp3 play %s", g_Game_7)
for(new i = 1; i<=zsMaxPlayers; i++)
{
if(is_user_connected(i) && is_user_alive(i))
{
if(cs_get_user_team(i) == CS_TEAM_T)
{
player_strip_weapons(i)
give_item(i, "weapon_knife")
set_user_health(i,1)
set_user_gravity(i,0.3)
}
else if(cs_get_user_team(i) == CS_TEAM_CT)
{
player_strip_weapons(i)
set_user_godmode(i, 1)
give_item(i, "weapon_knife")
set_user_health(i,100)
set_user_gravity(i,0.3)
}
g_SpeedPlayer = true
set_user_maxspeed(i, 550.0)
}
}
g_TimerOver = 150
set_task(150.0, "cmd_game_over", TASK_GAME_OVER, _, _, "b")
}
/*================================================================================
Режим: Зомби
=================================================================================*/
public cmd_game_zombie()
{
jail_open()
set_lights("d")
g_GameMode = 6
g_BlockWeapons = 1
emit_sound(0, CHAN_VOICE, "alien_alarm.wav", 1.0, ATTN_NORM, 0, PITCH_LOW)
for(new i = 1; i<=zsMaxPlayers; i++)
{
if(is_user_connected(i) && is_user_alive(i))
{
if(cs_get_user_team(i) == CS_TEAM_T)
{
player_strip_weapons(i)
give_item(i, "weapon_knife")
set_user_gravity(i, 0.4)
set_user_maxspeed(i, ZOMBIE_SPEED)
g_SpeedPlayerZombie = true
set_user_health(i, 700)
cs_set_user_nvg(i, true)
engclient_cmd(i, "nightvision")
}
else if(cs_get_user_team(i) == CS_TEAM_CT)
{
player_strip_weapons(i)
give_item(i, "weapon_knife")
give_item(i, "weapon_m3" )
client_cmd(i, "impulse 100")
cs_set_user_bpammo(i, CSW_M3, 900 )
set_user_health(i,250)
}
}
}
g_TimerOver = 130
set_task(130.0, "cmd_game_over", TASK_GAME_OVER, _, _, "b")
}
/*================================================================================
Режим: Начало Пряток
=================================================================================*/
public cmd_game_hide()
{
jail_open()
set_lights("d")
g_GameMode = 7
for(new i = 1; i<=zsMaxPlayers; i++)
{
if(is_user_connected(i) && is_user_alive(i))
{
if(cs_get_user_team(i) == CS_TEAM_CT)
{
set_user_godmode(i, 1)
set_pev(i, pev_flags, pev(i, pev_flags) | FL_FROZEN)
}
else if(cs_get_user_team(i) == CS_TEAM_T)
{
set_user_gravity(i, 0.5)
cs_set_user_nvg(i, true)
engclient_cmd(i, "nightvision")
}
player_strip_weapons(i)
}
}
g_TimeHide = 20
set_task(1.0, "cmd_time_hide", TASK_HNS_DAY, _, _, "b")
}
/*================================================================================
Функция: Если отчет закончился то:
=================================================================================*/
public cmd_time_hide()
{
if(g_GameMode == 7)
{
--g_TimeHide
if(g_TimeHide <= 0)
{
remove_task(TASK_HNS_DAY)
cmd_start_hide()
}
}
else remove_task(TASK_HNS_DAY)
}
/*================================================================================
Режим: Прятки
=================================================================================*/
public cmd_start_hide()
{
set_lights("b")
g_BlockWeapons = 1
client_cmd(0, "mp3 stop; mp3 play %s", g_Game_4)
for(new i = 1; i<=zsMaxPlayers; i++)
{
if(is_user_connected(i) && is_user_alive(i))
{
if(cs_get_user_team(i) == CS_TEAM_T)
{
g_SpeedPlayer = true
set_user_maxspeed(i, 320.0)
give_item(i, "weapon_knife")
give_item(i, "weapon_hegrenade")
give_item(i, "weapon_flashbang")
give_item(i, "weapon_flashbang")
give_item(i, "weapon_smokegrenade")
}
else if(cs_get_user_team(i) == CS_TEAM_CT)
{
player_strip_weapons(i)
give_item(i, "weapon_knife")
client_cmd(i, "impulse 100")
give_item(i, "weapon_m4a1")
give_item(i, "weapon_ak47")
cs_set_user_bpammo( i, CSW_AK47, 900 )
cs_set_user_bpammo(i, CSW_M4A1, 900 )
set_pev(i, pev_flags, pev(i, pev_flags) & ~FL_FROZEN)
}
}
}
g_TimerOver = 200
set_task(200.0, "cmd_game_over", TASK_GAME_OVER, _, _, "b")
}

public cmd_game_alien()
{
jail_open()
g_GameMode = 9
g_BlockWeapons = 1
for(new i = 1; i<=zsMaxPlayers; i++)
{
if(!is_user_alive(i))
continue

strip_user_weapons(i)
if(g_Simon != i)
{
if(cs_get_user_team(i) == CS_TEAM_CT)
{
set_bit(g_BackToCT, i)
cs_set_user_team2(i, CS_TEAM_T)
}
give_item(i, "weapon_knife")
new j = random_num(0, sizeof(_WeaponsFree) - 1)

give_item(i, _WeaponsFree[j])
cs_set_user_bpammo(i, _WeaponsFreeCSW[j], _WeaponsFreeAmmo[j])

new n = random_num(0, sizeof(_WeaponsFree) - 1)
while (n == j) {
n = random_num(0, sizeof(_WeaponsFree) - 1)
}

give_item(i, _WeaponsFree[n])
cs_set_user_bpammo(i, _WeaponsFreeCSW[n], _WeaponsFreeAmmo[n])
}
}
set_user_rendering(g_Simon, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0 )
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, g_Simon)
write_short(~0)
write_short(~0)
write_short(0x0004) // stay faded
write_byte(180)
write_byte(240)
write_byte(140)
write_byte(100)
message_end()

set_user_maxspeed(g_Simon, 350.0)
set_user_health(g_Simon, 1000)
set_user_gravity(g_Simon, 0.5)
set_task(20.0, "give_items_alien", 935)
entity_set_int(g_Simon, EV_INT_body, 4)
set_task(2.5, "radar_alien", 666, _, _, "b")

emit_sound(0, CHAN_VOICE, "alien_alarm.wav", 1.0, ATTN_NORM, 0, PITCH_LOW)
}

public task_inviz()
{
/*
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, g_Simon)
write_short(~0)
write_short(~0)
write_short(0x0004) // stay faded
write_byte(ALIEN_RED)
write_byte(ALIEN_GREEN)
write_byte(ALIEN_BLUE)
write_byte(100)
message_end()
g_Faded = 1*/
set_user_rendering(g_Simon, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0 )
}

public radar_alien()
{
new origin[3]
get_user_origin(g_Simon,origin)

message_begin(MSG_ALL, get_user_msgid("BombDrop"), {0,0,0}, 0)
write_coord(origin[0]) //X Coordinate
write_coord(origin[1]) //Y Coordinate
write_coord(origin[2]) //Z Coordinate
write_byte(0) //?? This byte seems to always be 0...so, w/e
message_end()
}

public give_items_alien()
{
give_item(g_Simon, "item_assaultsuit")
give_item(g_Simon, "item_longjump")
give_item(g_Simon, "weapon_knife")
if(get_user_weapon(g_Simon) == CSW_KNIFE)
{
set_pev(g_Simon, pev_viewmodel2, "models/v_crowbar.mdl")
set_pev(g_Simon, pev_weaponmodel2, "models/p_crowbar.mdl")
}
set_bit(g_PlayerCrowbar2, g_Simon)
}

stock UTIL_WeaponAnimation(pPlayer, iAnimation)
{
set_pev(pPlayer, pev_weaponanim, iAnimation);
engfunc(EngFunc_MessageBegin, MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0.0, 0.0, 0.0}, pPlayer);
write_byte(iAnimation);
write_byte(0);
message_end();
}
/*================================================================================
Функция: Цветной чат
=================================================================================*/
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
format(msg, sizeof(msg), "!y[!gJailBreak!y] %s", msg); //Префикс
replace_all(msg, 190, "!g", "^4"); // Green Color
replace_all(msg, 190, "!y", "^1"); // Default Color
replace_all(msg, 190, "!t", "^3"); // Team Color

if (id) players[0] = id; else get_players(players, count, "ch");
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players);
write_byte(players);
write_string(msg);
message_end();
}
}
}
}


Комментарий:
Больше добавить нечего..
 
В этой теме было размещено решение! Перейти к решению.

Вложения

Сообщения
2,751
Реакции
3,016
Помог
61 раз(а)
Удали первую строчку
 
D

DJ_A1

не помогло(
23 Мар 2017
вот чуть новее версия, еще ссылки убрал некоторые...и заменил на свои)
 

Вложения

Сообщения
1,536
Реакции
2,324
Помог
39 раз(а)
DJ_A1, кодировку UTF-8 без BOM в файле установите.
 
D

DJ_A1

а нет, все норм, спасибо)
24 Мар 2017
только есть одно но, я забиндил вызов команды на m, но оно открывает, но все же те пункты которые есть в меню - они не работают... в чем проблема может быть, а?
24 Мар 2017
Алексеич,
register_clcmd("chooseteam", "check_menu")
register_clcmd("say /menu", "check_menu")
register_clcmd("Menu", "check_menu")


P.S. я еще меню исправил, там была реклама...
 

Вложения

D

DJ_A1

Алексеич, хорошо, тогда скомпилируй мне еще пожалуйста, тот последний исходник. Благодарю за помощь
 
Статус
В этой теме нельзя размещать новые ответы.

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

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