- Ошибка
-
L 12/03/2017 - 11:20:16: [AMXX] Displaying debug trace (plugin "zl_core.amxx", version "2.0.2")
L 12/03/2017 - 11:20:16: [AMXX] Run time error 11: divide
L 12/03/2017 - 11:20:16: [AMXX] [0] zl_core.sma::zl_vote_count (line 424)
L 12/03/2017 - 11:20:16: [AMXX] [1] zl_core.sma::formatex_title (line 419)
L 12/03/2017 - 11:20:16: [AMXX] [2] zl_core.sma::vote_menu (line 163)
- ОС
- Linux
- Билд
-
ReHLDS version: 3.3.0.605-dev
Build date: 22:55:56 Nov 8 2017 (1306)
- ReGamedll
-
ReGameDLL version: 5.3.0.275-dev
Build date: 16:51:10 Nov 27 2017
- Список метамодулей
-
[ 1] AMX Mod X RUN - amxmodx_mm_i386.so v1.8.3-Re ini Start ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.75 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.3 ini Chlvl ANY
[ 5] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 6] VoiceTranscoder RUN - vtc.so v2017RC3 ini ANY ANY
[ 7] MySQL RUN - mysql_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[ 8] CStrike RUN - cstrike_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[ 9] CSX RUN - csx_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[10] ReAPI RUN - reapi_amxx_i386.so v5.2.0.142-dev pl1 ANY Never
[11] FakeMeta RUN - fakemeta_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[13] Engine RUN - engine_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[14] Fun RUN - fun_amxx_i386.so v1.8.3-Re pl1 ANY ANY
14 plugins, 14 running
- Список плагинов
-
[ 1] AMX Mod X RUN - amxmodx_mm_i386.so v1.8.3-Re ini Start ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.75 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.3 ini Chlvl ANY
[ 5] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 6] VoiceTranscoder RUN - vtc.so v2017RC3 ini ANY ANY
[ 7] MySQL RUN - mysql_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[ 8] CStrike RUN - cstrike_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[ 9] CSX RUN - csx_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[10] ReAPI RUN - reapi_amxx_i386.so v5.2.0.142-dev pl1 ANY Never
[11] FakeMeta RUN - fakemeta_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[ 1] AMXBans Core Gm 1.5.1 GmStaff & xPaw amxbans_core.am running
[ 2] FreshBans 1.3.8b kanagava fresh_bans_138_ running
[ 3] Admin Commands 1.8.3-Re AMXX Dev Team admincmd.amxx running
[ 4] Slots Reservation 1.8.2 AMXX Dev Team adminslots.amxx running
[ 5] AdminMenu 1.0 CrAsH AdminMenu.amxx running
[ 6] Commands Menu 1.8.3-Re AMXX Dev Team cmdmenu.amxx running
[ 7] Players Menu 1.8.3-Re AMXX Dev Team plmenu.amxx running
[ 8] Maps Menu 1.8.3-Re AMXX Dev Team mapsmenu.amxx running
[ 9] Plugin Menu 1.8.3-Re AMXX Dev Team pluginmenu.amxx running
[ 10] Admin Chat 1.8.3-Re AMXX Dev Team adminchat.amxx running
[ 11] Anti Flood 1.8.3-Re AMXX Dev Team antiflood.amxx running
[ 12] Admin Votes 1.8.3-Re AMXX Dev Team adminvote.amxx running
[ 13] unknown unknown unknown block_audio.amx running
[ 14] Me_Hp_StatsX 1.3 AMXX Dev Team & me_hp_statsx.am running
[ 15] Map Manager 2.5.61 Mistrick mapmanager.amxx running
[ 16] Chat Manager 1.1.1-11 Mistrick chatmanager.amx running
[ 17] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 18] [ZMO] Anti 512 Limit Best KOBRA zmo_unprecacher running
[ 19] ResetScore 1.0 Leo_[BH] resetscore_reap running
[ 20] No weapon list 1.1 BaRSiK nowpnlist.amxx running
[ 21] Precache Management 1.0.0 ConnorMcLeod precache_manage stopped
[ 22] no Money 0.1 REVO hide_money.amxx running
[ 23] VIP TAG in Score Board 1.0 FreeCode vip_in_tab.amxx running
[ 24] [ReAPI] Damager 1.1 phe damage.amxx running
[ 25] Menu 1.0 JusTD menu.amxx running
[ 26] [ZL] CoreFunction 2.0.2 Alexander.3 zl_core.amxx debug
[ 27] OberonBoss 3.3 Alexander.3 zl_oberonboss.a stopped
[ 28] [ZL] MapChooser 1.1 Alexander.3 zl_mapchooser.a stopped
[ 29] [ZL] RewardSystem 1.3.2 Alexander.3 zl_rewardsystem stopped
[ 30] SupplyBox 2.2 Alexander.3 zl_supplybox.am stopped
[ 31] [ZL] SpawnSystem 1.5 Alexander.3 zl_spawnsystem. stopped
[ 32] Zombie Plague Zombie MeRcyLeZZ zombiemod.amxx debug
[ 33] unknown unknown unknown zp_level.amxx debug
[ 34] unknown unknown unknown zp_stats.amxx debug
[ 35] [ ZM ] ZClass: Speed 1.0 MeRcyLeZZ zmo_class_speed debug
[ 36] [ZMO] ZClass: Spin Div 1.0 t3rkecorejz zmo_class_spind debug
[ 37] [ ZM ] ZClass: Doctor 1.0 KOBRA / t3rkecor zmo_class_docto debug
[ 38] [ZMO] Class: Heavy 1.1 Jim/4e/| zmo_class_heavy debug
[ 39] [ZMO] ZClass: Hunter 1.0 KOBRA / t3rkecor zmo_class_hunte debug
[ 40] [ZMO] Nemesis Ability Best 1.0 class_nemesis.a debug
[ 41] [ZP: Addon] Human Clas Live heka zp_human_classe debug
[ 42] SF Easy SQL 1 Windranger1337 zp_save_MySQL.a debug
[ 43] WinTeam Sprite 0.0.8 Some Scripter WinTeam_Sprite. debug
[ 44] [ZP] Addon: Knifes 1.0 BlackCat knife.amxx running
[ 45] Axyennblu megaplug 1.0 Alexander.3 zp_drop_bonus.a running
[ 46] [ZP]NadeModes 1.0 BaJIeHoK zp_nademodes.am running
[ 47] [ZP]: Custom respawn 1.0 Weltgericht zp_addon_respaw running
[ 48] [ZP: CSO] VIP Menu 0.0.1 heka zp_vip_menu.amx running
[ 49] [Server Addon] Admin M Server Add erver Addon] Adm card.amxx running
[ 50] [ZP: CSO] NightVision 0.0.1 heka zp_nightvision. running
[ 51] [ZN] Buy Menu 2.4 Felix_Font zn_buymenu.amxx running
[ 52] [ZMO] Weapon: Negev NG 1.0 Base: Batcon; Re zmo_weapon_nege running
[ 53] [ZMO] Weapon: SF Laser 1.0 Base: Batcon; Re zmo_weapon_torn running
[ 54] [ZMO]Weapon: Destroyer 1.0 Base: Batcon; Re zmo_weapon_dest running
[ 55] [ZMO] Weapon: QBS-09 1.0 Base: Batcon; Re zmo_weapon_qbs0 running
[ 56] [ZMO] Weapon: TURBULEN 1.0 Base: Batcon; Re zmo_weapon_turb running
[ 57] [ZMO] Extra-Item: Skul 1.0 Mr.Kot3 zmo_weapon_skul running
[ 58] [ZMO] Weapon: VSK-94 1.0 Base: Batcon; Re zmo_weapon_vsk9 running
[ 59] [ZMO] Weapon: Dragunov 1.0 Base: Batcon; Re zmo_weapon_svd. running
[ 60] [ZMO] Weapon: Skull-11 0.1 Chrescoe1 zmo_weapon_skul running
[ 61] unknown unknown unknown CSO_Weapon_Aklo running
[ 62] unknown unknown unknown CSO_Weapon_Qbar running
[ 63] unknown unknown unknown CSO_Weapon_Dual running
[ 64] unknown unknown unknown CSO_Weapon_F200 running
[ 65] ZP: C4 satchel charge 1.0 CrAsH zp_c4.amxx running
[ 66] unknown unknown unknown zp_extra_health running
[ 67] [ZP] Extra Item: Jump 1.0 Opo4uMapy zp_jump_bomb.am debug
[ 68] [ZP]DropGrenade 1.0 CrAsH zp_dropgrenade. running
[ 69] [ZMO] Extra: ZombieCon ZMO] Extra MO] Extra: Zombi zmo_extra_grena running
[ 70] [ZP] Extra Item: Knife 1.2 pharse zp_extra_knife_ running
[ 71] [ZP] Extra items: Thun 0.1 serfreeman1337 zp_ThunderNade. running
[ 72] [ZMO] Weapon: M4A1 Dar 1.0 Base: Batcon; Re zmo_weapon_buff running
72 plugins, 66 running
- Исходный код
-
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >
#include < nvault >
#include < cstrike >
#define PLUGIN "[ZL] CoreFunction"
#define VERSION "2.0.2"
#define AUTHOR "Alexander.3"
/* ALL SETTING */
#define CMD_BOSS "say /boss"
/* Macro */
#define MAPCHOOSER
//#define DEBUG
/* MAP SETTING */
#define MAP_ALIEN "zl_boss_alien"
#define MAP_APACHE "zl_boss_apache"
#define MAP_OBERON "zl_boss_oberon_v2"
#define MAP_REVENANT "zl_boss_revenant"
#define MAP_ANGRA "zl_boss_angra"
#define MAP_ENVYMASK "megaololo"
#define MAP_ILLIDAN "zl_boss_illidan_alpha"
#define MAP_SCORPION "zl_boss_scorpion"
#define MAP_P_REVENANT "zl_boss_p_revenant_alpha"
#define KILL_EXP 30
////////////////////////
/*------- CODE -------*/
/*---- DONT CHANGE ---*/
////////////////////////
#define m_iId 43
#define m_iPrimaryAmmoType 49
#define m_iPlayerTeam 114
#define m_iNumRespawns 365
#define m_pActiveItem 373
#define m_rgAmmoCBasePlayer 376
#define b_mNum 10
#define b_bmin 1
#define b_bmax 2
#define v_name "boss_time"
#define f_config "zl_core.ini"
#if defined MAPCHOOSER
native zl_vote_start()
#endif
native zp_stats_getdata(id, iData)
native zp_stats_setdata(id, iData, iNum)
native zp_get_user_exp(id)
native zp_set_user_exp(id,value)
/* global */
static g_PlayerCount, g_MaxPlayer, g_timer_forward, g_blood[2],
g_cvar[4], Float:g_fcvar, g_cfg_cvar[3], Float:g_cfg_fcvar,
g_cfg_szmap[24]
/* vote */
static bool:g_vote_true, g_voteid[33], g_vote[b_mNum], g_CallBack,
g_vote_all, g_vote_vault, g_vote_time, Array:BossMap
/* respawn */
static bool:g_respawn_preapre = true
public plugin_precache() {
register_plugin(PLUGIN, VERSION, AUTHOR)
g_cvar[0] = get_cvar_num("mp_autoteambalance")
g_cvar[1] = get_cvar_num("mp_limitteams")
g_cvar[2] = get_cvar_num("mp_startmoney")
g_cvar[3] = get_cvar_num("mp_friendlyfire")
g_fcvar = get_cvar_float("mp_buytime")
g_MaxPlayer = get_maxplayers()
config_load()
if (native_zl_map_boss() > 0) {
RegisterHam(Ham_TraceAttack, "info_target", "Hook_TraceAttack")
RegisterHam(Ham_Killed, "info_target", "Hook_Killed")
RegisterHam(Ham_Killed, "player", "Hook_Killed", 1)
register_message(get_user_msgid("AmmoX"), "MSG_AmmoX")
g_blood[0] = precache_model("sprites/blood.spr")
g_blood[1] = precache_model("sprites/bloodspray.spr")
g_timer_forward = CreateMultiForward("zl_timer", ET_CONTINUE, FP_CELL, FP_CELL)
new task = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "func_wall"))
set_pev(task, pev_classname, "zl_classname_timer")
set_pev(task, pev_nextthink, get_gametime() + 1.0)
RegisterHamFromEntity(Ham_Think, task, "Hook_Think")
set_cvar_num("mp_autoteambalance", 0)
set_cvar_num("mp_limitteams", 0)
set_cvar_num("mp_startmoney", 16000)
set_cvar_num("mp_friendlyfire", 0)
set_cvar_float("mp_buytime", 99.99)
} else {
BossMap = ArrayCreate(128)
if(is_plugin_loaded("zl_alienboss.amxx", true) != -1) ArrayPushString(BossMap, MAP_ALIEN)
if(is_plugin_loaded("zl_apacheboss.amxx", true) != -1) ArrayPushString(BossMap, MAP_APACHE)
if(is_plugin_loaded("zl_oberonboss.amxx", true) != -1) ArrayPushString(BossMap, MAP_OBERON)
if(is_plugin_loaded("zl_revenantboss.amxx", true) != -1) ArrayPushString(BossMap, MAP_REVENANT)
if(is_plugin_loaded("zl_boss_angra.amxx", true) != -1) ArrayPushString(BossMap, MAP_ANGRA)
if(is_plugin_loaded("zl_boss_envymask.amxx", true) != -1) ArrayPushString(BossMap, MAP_ENVYMASK)
if(is_plugin_loaded("zl_boss_illidan.amxx", true) != -1) ArrayPushString(BossMap, MAP_ILLIDAN)
if(is_plugin_loaded("zl_boss_scorpion.amxx", true) != -1) ArrayPushString(BossMap, MAP_SCORPION)
if(is_plugin_loaded("zl_boss_p_revenant.amxx", true) != -1) ArrayPushString(BossMap, MAP_P_REVENANT)
register_logevent("RoundEnd", 2, "1=Round_End")
register_clcmd(CMD_BOSS, "vote_menu")
g_CallBack = menu_makecallback("vote_menu_callback")
g_vote_vault = nvault_open("zl_boss")
g_vote_time = nvault_get(g_vote_vault, v_name)
set_cvar_num("mp_autoteambalance", g_cvar[0])
set_cvar_num("mp_limitteams", g_cvar[1])
set_cvar_num("mp_startmoney", g_cvar[2])
set_cvar_num("mp_friendlyfire", g_cvar[3])
set_cvar_float("mp_buytime", g_fcvar)
}
}
public RoundEnd() {
if (!g_vote_true)
return
new szBossMap[32], szTime[16]
formatex(szTime, charsmax(szTime), "%d", get_systime() + (g_cfg_cvar[1] * 60))
nvault_pset(g_vote_vault, v_name, szTime)
ArrayGetString(BossMap, (zl_vote_winner() == -1) ? 0 : zl_vote_winner(), szBossMap, charsmax(szBossMap))
log_amx(szBossMap)
server_cmd("amx_map ^"%s^"", szBossMap)
}
public vote_menu(id) {
if (g_vote_true) {
zl_colorchat(id, "!g[BOSS] !nГолосование завершено!")
return
}
if (zl_vote_time() > 0) {
zl_colorchat(id, "!g[BOSS] !nГолосование станет доступно через !g%d минут", ((zl_vote_time() / 60) > 0) ? (zl_vote_time() / 60) : 1)
return
}
static menu
if (!menu)menu = menu_create("^t", "vote_menu_handle")
else { menu_display(id, menu); return; }
formatex_title(menu)
new i, BossNum = ArraySize(BossMap)
for(i = 0; i < BossNum; ++i) menu_additem(menu, "", _, _, g_CallBack)
menu_display(id, menu)
}
public vote_menu_handle(id, menu, key) {
/* if (key == MENU_EXIT || g_vote_true) {
//menu_destroy(menu)
if (is_user_connected(id))
menu_cancel(id)
return PLUGIN_HANDLED
}*/
if (key == MENU_EXIT)
return PLUGIN_HANDLED
if (g_vote_true) {
menu_cancel(id)
return PLUGIN_HANDLED
}
if (g_voteid[id]) {
g_vote[g_voteid[id]]--
g_voteid[id] = key + 1
g_vote[g_voteid[id]]++
} else {
static szName[32], szMap[32]
get_user_name(id, szName, charsmax(szName))
ArrayGetString(BossMap, key, szMap, charsmax(szMap))
g_voteid[id] = key + 1
g_vote[key + 1]++
g_vote_all++
zl_colorchat(0, "!g[BOSS] !t%s !nПроголосовал за!g %s !nСделано !g[%d/%d] !nголосов.", szName, szMap, g_vote_all, zl_vote_count(g_cfg_fcvar))
}
if (g_vote_all >= zl_vote_count(g_cfg_fcvar)) {
static szWinner[32]
ArrayGetString(BossMap, zl_vote_winner(), szWinner, charsmax(szWinner))
set_hudmessage(227, 177, 168, 0.12, 0.05, 2, 1.0, 7.0, 0.1, 0.1, -1)
show_hudmessage(0, "Голосование завершено!^n\
Следующий босс: %s^n^n\
Последний раунд!", szWinner)
g_vote_true = true
menu_destroy(menu)
return PLUGIN_HANDLED
}
formatex_title(menu)
menu_display(id, menu)
return PLUGIN_CONTINUE
}
public vote_menu_callback(id, menu, key) {
static szMap[64]
ArrayGetString(BossMap, key, szMap, charsmax(szMap))
if (g_voteid[id] == (key + 1) || g_vote_true) {
format(szMap, charsmax(szMap), "\d%s \r[%d \y(%d%%)\r]", szMap, g_vote[key + 1], zl_vote_proc(key))
menu_item_setname(menu, key, szMap)
return ITEM_DISABLED
} else {
format(szMap, charsmax(szMap), "\w%s \r[%d \y(%d%%)\r]", szMap, g_vote[key + 1], zl_vote_proc(key))
menu_item_setname(menu, key, szMap)
return ITEM_ENABLED
}
/*return ITEM_IGNORE*/
}
public MSG_AmmoX(msg, dest, id) {
if (dest != MSG_ONE || !is_user_alive(id))
return PLUGIN_CONTINUE
new AmmoIndex = get_msg_arg_int(1)
if (AmmoIndex > 10) {
set_pdata_int(id, m_rgAmmoCBasePlayer + AmmoIndex, 0, 5)
return PLUGIN_CONTINUE
}
set_pdata_int(id, m_rgAmmoCBasePlayer + AmmoIndex, 250, 5)
return PLUGIN_CONTINUE
}
public client_putinserver(id) {
if (!g_respawn_preapre) {
if (native_zl_player_alive() <= 0) {
is_map_valid(g_cfg_szmap) ? server_cmd("amx_map ^"%s^"", g_cfg_szmap) : server_cmd("restart")
return
}
set_pdata_int(id, m_iNumRespawns, 1)
}
g_PlayerCount++
}
public client_disconnected(id) {
if (native_zl_map_boss() <= 0) {
if (g_voteid[id]) {
g_vote[g_voteid[id]] = 0
g_voteid[id] = 0
g_vote_all--
}
}
g_PlayerCount--
}
public plugin_end() {
if (native_zl_map_boss() > 0) {
set_cvar_num("mp_autoteambalance", g_cvar[0])
set_cvar_num("mp_limitteams", g_cvar[1])
set_cvar_num("mp_startmoney", g_cvar[2])
set_cvar_float("mp_buytime", g_fcvar)
} else {
if (!g_vote_true) {
new szTime[32]
formatex(szTime, charsmax(szTime), "%d", (zl_vote_time() > 0) ? (get_systime() + zl_vote_time()) : (get_systime()))
nvault_pset(g_vote_vault, v_name, szTime)
}
nvault_close(g_vote_vault)
}
}
public plugin_natives() {
register_native("zl_boss_map", "native_zl_map_boss", 1)
register_native("zl_boss_valid", "native_zl_valid_boss", 1)
register_native("zl_player_alive", "native_zl_player_alive", 1)
register_native("zl_player_random", "native_zl_random_player", 1)
register_native("zl_player_count", "native_zl_player_count", 1)
register_native("zl_colorchat", "native_zl_color_chat", 1)
}
public native_zl_map_boss() {
static MapName[64], Map_Boss
if (MapName[0])
return Map_Boss
get_mapname(MapName, 63)
if (contain(MapName, MAP_OBERON) != -1) Map_Boss = 1
if (contain(MapName, MAP_ALIEN) != -1) Map_Boss = 2
if (contain(MapName, MAP_ANGRA) != -1) Map_Boss = 3
if (contain(MapName, MAP_REVENANT) != -1) Map_Boss = 4
if (contain(MapName, MAP_ENVYMASK) != -1) Map_Boss = 5
if (contain(MapName, MAP_ILLIDAN) != -1) Map_Boss = 6
if (contain(MapName, MAP_SCORPION) != -1) Map_Boss = 7
if (contain(MapName, MAP_P_REVENANT) != -1) Map_Boss = 50
#if defined DEBUG
log_amx("DEBUG: Map id: %d | Map Name: %s", Map_Boss, MapName)
#endif
return Map_Boss
}
public native_zl_valid_boss(index) {
new ClassName[32]
pev(index, pev_classname, ClassName, charsmax(ClassName))
if (ClassName[0] == 'o' && ClassName[5] == 'n' && ClassName[7] == 'b') return 1
if (ClassName[0] == 'a' && ClassName[4] == 'n' && ClassName[6] == 'b') return 2
if (ClassName[0] == 'A' && ClassName[4] == 'a' && ClassName[5] == 'B') return 3
if (ClassName[0] == 'R' && ClassName[2] == 'v' && ClassName[8] == 'B') return 4
if (ClassName[0] == 'b' && ClassName[5] == 'z' && ClassName[9] == 's' || ClassName[0] == 'b' && ClassName[5] == 'n' && ClassName[8] == 'd') return 5
if (ClassName[0] == 'b' && ClassName[5] == 'i' && ClassName[9] == 'd') return 6
if (ClassName[0] == 'b' && ClassName[5] == 's' && ClassName[9] == 'p') return 7
if (ClassName[0] == 'b' && ClassName[5] == 'p' && ClassName[14] == 't') return 50
return 0
}
public native_zl_random_player() {
new Index
Index = GetRandomAlive(random_num(1, native_zl_player_alive()))
return Index
}
public native_zl_player_alive() {
new iAlive, id, CsTeams:team
for (id = 1; id <= g_MaxPlayer; id++) {
if (!is_user_alive(id) || is_user_bot(id))
continue
team = cs_get_user_team(id)
if (team == CS_TEAM_SPECTATOR || team == CS_TEAM_UNASSIGNED)
continue
iAlive++
}
return iAlive
}
GetRandomAlive(target_index) {
new iAlive, id, CsTeams:team
for (id = 1; id <= g_MaxPlayer; id++) {
if (!is_user_alive(id) || is_user_bot(id))
continue
team = cs_get_user_team(id)
if (team == CS_TEAM_SPECTATOR || team == CS_TEAM_UNASSIGNED)
continue
iAlive++
if (iAlive == target_index)
return id
}
return -1
}
public native_zl_player_count()
return g_PlayerCount
public native_zl_color_chat( iPlayer, szMessage[ ], any:... ) {
for( new i = 2; i <= numargs(); ++i )
param_convert(i)
static szBuffer[512]
vformat(szBuffer, charsmax( szBuffer ), szMessage, 3)
zl_colorchat(iPlayer, szBuffer)
}
stock zl_colorchat( iPlayer, szMessage[ ], any:... ) {
static szBuffer[512]
vformat(szBuffer, charsmax( szBuffer ), szMessage, 3 );
replace_all(szBuffer, charsmax(szBuffer), "!t", "^3")
replace_all(szBuffer, charsmax(szBuffer), "!n", "^1")
replace_all(szBuffer, charsmax(szBuffer), "!g", "^4")
if( iPlayer ) {
message_begin( MSG_ONE, 76, _, iPlayer );
write_byte( iPlayer );
write_string( szBuffer );
message_end( );
} else {
for( new iPlayers = 33; iPlayers > 0; iPlayers-- ) {
if( !is_user_connected( iPlayers ) )
continue;
message_begin( MSG_ONE, 76, _, iPlayers );
write_byte( iPlayers );
write_string( szBuffer );
message_end( );
}
}
}
formatex_title(menu) {
static szTitle[64]
formatex(szTitle, charsmax(szTitle), "\yVote\rBoss\wMenu ^nVoteNum: %d/%d [%d%%]", g_vote_all, zl_vote_count(g_cfg_fcvar), g_vote_all * 100 / zl_vote_count(g_cfg_fcvar))
menu_setprop(menu, MPROP_TITLE, szTitle)
}
zl_vote_count(Float:procent)
return floatround(procent / 100.0 * float(g_PlayerCount), floatround_ceil)
zl_vote_proc(key)
return g_vote_all ? floatround(floatmul(float(g_vote[key + 1]) / float(g_vote_all), 100.0)) : 0
zl_vote_winner() {
new buffer = 0, s = 0, i = 0, m = ArraySize(BossMap)
for(i = 1; i <= m; ++i) {
if (g_vote[i] > buffer) {
buffer = g_vote[i]
s = i
}
}
return s - 1
}
zl_vote_time()
return g_vote_time - get_systime()
public Hook_Think(ent) {
if (!native_zl_player_alive()) {
set_pev(ent, pev_nextthink, get_gametime() + 1.0)
return
}
static szName[32]
pev(ent, pev_classname, szName, charsmax(szName))
if (szName[0] == 'z' && szName[1] == 'l' && szName[14] == 'i' && szName[17] == 'r') {
static Prepare = 2, ret
set_pev(ent, pev_nextthink, get_gametime() + 1.0)
switch(Prepare) {
case 2: {
g_cfg_cvar[0]--
client_print(0, print_center, "Ожидание до начала следующего раунда: %d секунд", g_cfg_cvar[0])
if(g_cfg_cvar[0] <= 0) {
Prepare--
g_respawn_preapre = false
}
}
case 1: {
Prepare--
g_cfg_cvar[0]++
}
case 0:g_cfg_cvar[0]++
default: g_cfg_cvar[0]++
}
message_begin(MSG_ALL, get_user_msgid("RoundTime"))
write_short(g_cfg_cvar[0])
message_end()
ExecuteForward(g_timer_forward, ret, g_cfg_cvar[0], Prepare)
if(ret) Prepare = ret
}
}
config_load() {
static path[64]
get_localinfo("amxx_configsdir", path, charsmax(path))
format(path, charsmax(path), "%s/zl/%s", path, f_config)
if (!file_exists(path)) {
new error[100]
formatex(error, charsmax(error), "Cannot load customization file %s!", path)
set_fail_state(error)
return
}
static linedata[1024], key[64], value[960]
new file = fopen(path, "rt")
while (file && !feof(file)) {
fgets(file, linedata, charsmax(linedata))
replace(linedata, charsmax(linedata), "^n", "")
if (!linedata[0] || linedata[0] == '/') continue;
strtok(linedata, key, charsmax(key), value, charsmax(value), '=')
trim(key)
trim(value)
if (equal(key, "PREPARE"))
g_cfg_cvar[0] = str_to_num(value)
else if (equal(key, "BOSS_COLOR"))
g_cfg_cvar[2] = str_to_num(value)
else if (equal(key, "SZ_MAP"))
parse(value, g_cfg_szmap, charsmax(g_cfg_szmap))
else if (equal(key, "VOTE_PROCENT"))
g_cfg_fcvar = str_to_float(value)
else if (equal(key, "VOTE_TIME"))
g_cfg_cvar[1] = str_to_num(value)
}
if (file) fclose(file)
}
public Hook_TraceAttack(boss, player, Float:dmg, Float:direction[3], tr, damage_type) {
if (!native_zl_valid_boss( boss ))
return HAM_IGNORED
static Float:End[3]
get_tr2(tr, TR_vecEndPos, End)
if (pev(boss, pev_euser2) == 1) {
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_SPARKS)
engfunc(EngFunc_WriteCoord, End[0])
engfunc(EngFunc_WriteCoord, End[1])
engfunc(EngFunc_WriteCoord, End[2])
message_end()
return HAM_IGNORED
}
if (pev(boss, pev_deadflag) == DEAD_NO && pev(boss, pev_takedamage) == DAMAGE_NO) {
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_SPARKS)
engfunc(EngFunc_WriteCoord, End[0])
engfunc(EngFunc_WriteCoord, End[1])
engfunc(EngFunc_WriteCoord, End[2])
message_end()
return HAM_SUPERCEDE
}
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_BLOODSPRITE)
engfunc(EngFunc_WriteCoord, End[0])
engfunc(EngFunc_WriteCoord, End[1])
engfunc(EngFunc_WriteCoord, End[2])
write_short(g_blood[0])
write_short(g_blood[1])
write_byte(g_cfg_cvar[2])
write_byte(random_num(b_bmin, b_bmax))
message_end()
return HAM_IGNORED
}
public Hook_Killed(victim, attacker, corpse) {
if (native_zl_player_alive() <= 0) {
set_task(6.0, "changemap")
return HAM_IGNORED
}
if (!native_zl_valid_boss(victim))
return HAM_IGNORED
if (pev(victim, pev_deadflag) == DEAD_DYING)
return HAM_IGNORED
set_pev(victim, pev_solid, SOLID_NOT)
set_pev(victim, pev_velocity, {0.0, 0.0, 0.0})
static e = -1
while ( (e = engfunc(EngFunc_FindEntityByString, e, "classname", "classname_zombie")) )
if(pev_valid(e)) engfunc(EngFunc_RemoveEntity, e)
switch(native_zl_map_boss()) {
case 1: zl_anim(victim, 16, 1.0)
case 2: zl_anim(victim, 1, 1.0)
case 5: { // Neid and Zavist
new szBossType[32], g_Neid, g_Zavist
pev(victim, pev_classname, szBossType, charsmax(szBossType))
g_Neid = engfunc(EngFunc_FindEntityByString, g_Neid, "classname", "boss_neid")
g_Zavist = engfunc(EngFunc_FindEntityByString, g_Zavist, "classname", "boss_zavist")
if (pev(g_Neid, pev_deadflag) == DEAD_DYING && pev(g_Zavist, pev_deadflag) == DEAD_DYING) {
set_task(20.0, "changemap")
return HAM_SUPERCEDE
}
set_pev(victim, pev_deadflag, DEAD_DYING)
if (equal(szBossType, "boss_neid")) {
zl_anim(victim, 35, 1.0)
set_pev(g_Neid, pev_nextthink, get_gametime() + 7.4)
}
if (equal(szBossType, "boss_zavist")) {
zl_anim(victim, 28, 1.0)
set_pev(g_Zavist, pev_nextthink, get_gametime() + 13.2)
}
return HAM_SUPERCEDE
}
case 6: zl_anim(victim, 15, 1.0)
case 7: zl_anim(victim, 20, 1.0)
}
zp_set_user_exp(attacker, zp_get_user_exp(attacker) + KILL_EXP)
zp_stats_setdata(attacker, 8, zp_stats_getdata(attacker, 8) + 1)
set_pev(victim, pev_deadflag, DEAD_DYING)
set_task(20.0, "changemap")
return HAM_SUPERCEDE
}
public changemap() {
#if defined MAPCHOOSER
zl_vote_start()
#else
is_map_valid(g_cfg_szmap) ? server_cmd("changelevel ^"%s^"", g_cfg_szmap) : server_cmd("restart")
#endif
}
stock zl_anim(ent, sequence, Float:speed) {
set_pev(ent, pev_sequence, sequence)
set_pev(ent, pev_animtime, get_gametime())
set_pev(ent, pev_framerate, speed)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
Всем привет! Проблема в подсчете голосов, я как бы в этом не силен, вот и решил спросить совета у Вас, как я понял это что-то связано с делением при подсчете голосов, может кто-нибудь помочь?
В этой теме было размещено решение! Перейти к решению.