Администратор
- Сообщения
- 3,023
- Реакции
- 1,731
- Помог
- 79 раз(а)
Основная информация
Проблема: Ошибки в плагине
Ошибка:
Amx Mod X: ReAMXX
Билд:
ReGamedll:
Список модулей:
Список плагинов:
Список метамодулей:
Исходник:
Комментарий:
Ошибки. Есть возможность поправить?
Проблема: Ошибки в плагине
Ошибка:
Дополнительная информацияL 01/11/2017 - 23:09:13: Start of error session.
L 01/11/2017 - 23:09:13: Info (map "de_inferno") (file "addons/amxmodx/logs/error_20170111.log")
L 01/11/2017 - 23:09:13: Plugin called menu_display when item=MENU_EXIT
L 01/11/2017 - 23:09:13: [AMXX] Displaying debug trace (plugin "dm_mode_vote.amxx", version "1.62")
L 01/11/2017 - 23:09:13: [AMXX] Run time error 10: native error (native "menu_display")
L 01/11/2017 - 23:09:13: [AMXX] [0] dm_mode_vote.sma::show_menu_vote (line 274)
L 01/11/2017 - 23:09:13: [AMXX] [1] dm_mode_vote.sma::prepare_menu_vote (line 243)
L 01/11/2017 - 23:09:13: [AMXX] [2] dm_mode_vote.sma::show_vote (line 169)
L 01/11/2017 - 23:09:24: Plugin called menu_display when item=MENU_EXIT
L 01/11/2017 - 23:09:24: [AMXX] Displaying debug trace (plugin "dm_mode_vote.amxx", version "1.62")
L 01/11/2017 - 23:09:24: [AMXX] Run time error 10: native error (native "show_menu")
L 01/11/2017 - 23:09:24: [AMXX] [0] dm_mode_vote.sma::finish_vote (line 200)
L 01/11/2017 - 23:09:24: [AMXX] [1] dm_mode_vote.sma::time_vote (line 182)
L 01/25/2017 - 21:39:49: Start of error session.
L 01/25/2017 - 21:39:49: Info (map "cs_assault") (file "addons/amxmodx/logs/error_20170125.log")
L 01/25/2017 - 21:39:49: Invalid player id 111
L 01/25/2017 - 21:39:49: [AMXX] Displaying debug trace (plugin "dm_mode_vote.amxx", version "1.62")
L 01/25/2017 - 21:39:49: [AMXX] Run time error 10: native error (native "get_user_weapon")
L 01/25/2017 - 21:39:49: [AMXX] [0] dm_mode_vote.sma::fw_TraceAttack (line 325)
Amx Mod X: ReAMXX
Билд:
Код:
ReHLDS version: 3.0.0.418-dev
Build date: 20:38:00 Feb 6 2017 (1031)
ReGamedll:
Код:
5.2.0.177-dev
Список модулей:
PHP:
[ 1] dummy_csx 1.0 AGHL.RU Dev Team running
[ 2] ReAimDetector 0.1.3 ReHLDS Team running
[ 3] MySQL 1.8.3-Re AMX Mod X Dev Team running
[ 4] FakeMeta 1.8.3-Re AMX Mod X Dev Team running
[ 5] nVault 1.8.3-Re AMX Mod X Dev Team running
[ 6] ReAPI 5.1.0.103- Asmodai & s1lent running
[ 7] Ham Sandwich 1.8.3-Re AMX Mod X Dev Team running
[ 8] CStrike 1.8.3-Re AMX Mod X Dev Team running
[ 9] Fun 1.8.3-Re AMX Mod X Dev Team running
[10] ReCSDM 3.6 Adidasman & s1lent running
[11] Engine 1.8.3-Re AMX Mod X Dev Team running
[12] RegEx 1.8.3-Re AMX Mod X Dev Team running
Список плагинов:
HTML:
[ 1] fb_forwards 0.1.4 Kanagava & Realu fb_forwards.amx running
[ 2] Admin Load 3.9.0 Dev F@nt0M adminload_3_9_0 running
[ 3] FreshBan 1.3.1 kanagava fresh_bans_131- running
[ 5] DeathMatch Mod's Vote 1.62 Neeeeeeeeeel.- / dm_mode_vote.am debug
[ 6] Simple Admin Chat 1.1 ill simple_admin_ch running
[ 7] Change Game Name 1.2 GoldSrc Team ChangeGameName. running
[ 8] New Kick Menu 1.2.8 Radius newkickmenu.amx running
[ 9] Admin Commands 1.8.3-Re AMXX Dev Team admincmd.amxx running
[ 10] Menus Front-End 1.8.3-dev+ AMXX Dev Team menufront.amxx running
[ 11] Commands Menu 1.8.3-Re AMXX Dev Team cmdmenu.amxx running
[ 12] Players Menu 1.8.3-Re AMXX Dev Team plmenu.amxx running
[ 13] Maps Menu 1.8.3-Re AMXX Dev Team mapsmenu.amxx running
[ 14] Admin Chat 1.8.3-Re AMXX Dev Team adminchat.amxx running
[ 15] Admin Votes 1.8.3-Re AMXX Dev Team adminvote.amxx running
[ 16] Restrict Weapons 1.8.3-Re AMXX Dev Team restmenu.amxx running
[ 17] Anti Flood 1.8.3-Re AMXX Dev Team antiflood.amxx running
[ 18] CSStatsX SQL 0.7.4 serfreeman1337 csstatsx_sql.am running
[ 19] AES: StatsX 0.5 Vega serfreeman1337 aes_statsx_cstr running
[ 20] Stats Configuration 1.8.3-Re AMXX Dev Team statscfg.amxx running
[ 21] nice Demo 1.0 sector nice_demo.amxx running
[ 22] Advert Messages 1.3.3 neygomon | Radiu advert_messages running
[ 23] Resetscore 1.0 ill+Radius_fix resetscore.amxx running
[ 24] Blue Screen 1.2 Stimul blue_screen_and running
[ 25] Gag Me 1.7.2 Radius gag_me.amxx running
[ 26] [ReAPI] Parachute 1.0 ReHLDS Team parachute.amxx running
[ 27] GunGame AMMO 2.2 Prayer gg_ammo.amxx running
[ 28] Money as Frag Counter 0.1 Safety1st money_frag_coun running
[ 29] Chat Manager 1.0.0 Mistrick chatmanager.amx running
[ 30] Die Motion Rate 0.0.2 Vaqtincha reapi_die_motio running
[ 31] FitoNyashka v.1337 gyxoBka a2_style.amxx running
[ 33] Team Replace 0.0.1 Anonymus1337 :) TeamReplacer.am debug
[ 34] ReCSDM Main 3.6 ReCSDM Team csdm_main.amxx debug
[ 35] ReCSDM Equip 3.6 ReCSDM Team csdm_equip.amxx debug
[ 36] ReCSDM Spawns 3.6 ReCSDM Team csdm_spawn_pres debug
[ 37] ReCSDM Misc 3.6 ReCSDM Team csdm_misc.amxx debug
[ 38] ReCSDM Stripper 3.6 KWo csdm_stripper.a running
[ 39] ReCSDM Protection 3.6 BAILOPAN csdm_protection running
[ 40] Advanced Experience Sy 0.5 Vega serfreeman1337 aes_main.amxx running
[ 41] AES: CStrike Addon 0.5 Vega serfreeman1337 aes_exp_cstrike running
[ 42] AES: Informer 0.5 Vega serfreeman1337 aes_informer.am running
[ 43] AES: Admin Tools 0.5 Vega serfreeman1337 aes_exp_editor. running
Список метамодулей:
PHP:
[ 1] Reunion RUN - reunion_mm_i386. v0.1.75 ini Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i v0.1.5 ini Start Never
[ 3] AMX Mod X RUN - amxmodx_mm_i386. v1.8.3-R ini Start ANY
[ 4] WHBlocker RUN - whblocker_mm_i38 v1.5.672 ini Chlvl ANY
[ 5] Revoice RUN - revoice_mm_i386. v0.1.26 ini Start Never
[ 7] ReAimDetector RUN - reaimdetector_am v0.1.3 pl3 ANY Never
[ 8] MySQL RUN - mysql_amxx_i386. v1.8.3-R pl3 ANY ANY
[ 9] FakeMeta RUN - fakemeta_amxx_i3 v1.8.3-R pl3 ANY ANY
[10] ReAPI RUN - reapi_amxx_i386. v5.1.0.1 pl3 ANY Never
[11] Ham Sandwich RUN - hamsandwich_amxx v1.8.3-R pl3 ANY ANY
[12] CStrike RUN - cstrike_amxx_i38 v1.8.3-R pl3 ANY ANY
[13] Fun RUN - fun_amxx_i386.so v1.8.3-R pl3 ANY ANY
[14] ReCSDM RUN - csdm_amxx_i386.s v3.6 pl3 ANY ANY
[15] Engine RUN - engine_amxx_i386 v1.8.3-R pl3 ANY ANY
Исходник:
Код:
/*
* Modified by Safety1st
* 2/1/2014
*
* Original topic: https://forums.alliedmods.net/showthread.php?t=186460
*
* Changes are:
* - huge performance optimization thanks to ConnorMcLeod's idea
* - proper knife attacks handling
* - fixed 'Run time error 4: index out of bounds' error
* - revized redisplaying menu algorithm, now it also could be easily closed to continue playing
* - corrected colorchat function
* - other optimizations
*
* 22.05.2016
v1.62
- Дефайн на выбор dhud \ hud
- Добавлено перманентное сообщение
*/
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define USE_DHUD
#define HUD_COLORS 0, 255, 0
#define SET_HUDMSG set_hudmessage( 85, 255, 0, -1.0, 0.1, 0, .holdtime = 0.8, .fadeouttime = 0.1)
#if defined USE_DHUD
#define set_hudmessage set_dhudmessage
#define show_hudmessage show_dhudmessage
#endif
#if AMXX_VERSION_NUM < 183 && defined USE_DHUD
#include <dhudmessage>
#endif
#define ShowTASKTIME 3.0
#define SERVER_TAG " DM VOTE "
#define USE_MENU_FIX // should be commented for AMXX 1.8.3
#define MAX_PLAYERS 32
#define MsgId_ScreenFade 98
enum _:TASKS
{
TASK_VOTE_INIT = 1445,
TASK_VOTE_TIME,
TASK_VOTE_COUNTDOWN
}
enum _:MODES
{
NORMAL = 0,
HEAD
}
new g_iMaxPlayers, g_iVoteTime, g_iVoteCountdown = 7
new cvar_votetime, cvar_blockknife_dmg, cvar_voteinit_time
#define NO_MENU -1
#define MENU_CLOSE 2
new g_vote[MODES], g_menu_id[ MAX_PLAYERS + 1 ] = { NO_MENU, NO_MENU, ... }
// macro; %1 - variable being modified, %2 - player index
#define CheckFlag(%1,%2) ( %1 & ( 1 << (%2-1) ) )
#define AddFlag(%1,%2) ( %1 |= ( 1 << (%2-1) ) )
new giHasVoted, giHasCloseOption
new const sound_countdown[ ][ ] = {
"fvox/one.wav",
"fvox/two.wav",
"fvox/three.wav",
"fvox/four.wav",
"fvox/five.wav"
}
// temporary holds info
new szBuffer[MODES][64]
new iSum, iNormal, iHead
const m_iMenu = 205 // cbaseplayer offset
new gMsgSayText
// public plugin_precache() {
// for( new i = 0; i < sizeof sound_countdown; i++ )
// precache_sound( sound_countdown )
// }
public plugin_init() {
register_plugin( "DeathMatch Mod's Vote", "1.62", "Neeeeeeeeeel.- / Safety1st" )
register_dictionary( "dm_vote.txt" )
cvar_votetime = register_cvar( "dm_vote_time", "10" )
cvar_blockknife_dmg = register_cvar( "dm_block_knife_dmg", "0" )
cvar_voteinit_time = register_cvar( "dm_voteinit_time", "10" )
g_iMaxPlayers = get_maxplayers()
gMsgSayText = get_user_msgid("SayText")
}
public client_putinserver(id) {
set_task(ShowTASKTIME, "send_dhud", id, _, _, "b")
}
public plugin_cfg() {
set_task( get_pcvar_float( cvar_voteinit_time ), "show_vote", TASK_VOTE_INIT )
}
public client_disconnect(id) {
g_menu_id[id] = NO_MENU
remove_task(id);
}
public show_vote()
{
if( g_iVoteCountdown == 7 )
{
g_iVoteCountdown--
set_task( 1.0, "show_vote", TASK_VOTE_COUNTDOWN, _, _, "b" )
return
}
else if( g_iVoteCountdown )
{
//set_hudmessage( 85, 255, 0, -1.0, 0.1, 0, _, 0.9 )
SET_HUDMSG
if( g_iVoteCountdown != 1 )
{
for( new i = 1; i <= g_iMaxPlayers; i++ )
{
if( is_user_connected( i ) )
show_hudmessage( i, "%L", i, "VOTE_STARTS_IN", g_iVoteCountdown - 1 )
}
PlaySound( g_iVoteCountdown - 2 )
g_iVoteCountdown--
return
}
else
{
for( new i = 1; i <= g_iMaxPlayers; i++ )
{
if( is_user_connected( i ) )
show_hudmessage( i, "%L", i, "VOTE_STARTING" )
}
}
}
remove_task( TASK_VOTE_COUNTDOWN )
g_iVoteTime = get_pcvar_num( cvar_votetime )
set_task( 1.0, "time_vote", TASK_VOTE_TIME, _, _, "b" )
for( new i = 1; i <= g_iMaxPlayers; i++ )
{
if( is_user_connected( i ) )
{
prepare_menu_vote( i )
set_pev( i, pev_flags, pev( i, pev_flags ) | FL_FROZEN )
UTIL_ScreenFade( i, 0, 0, 4, 0, 0, 0, 255 )
}
}
return
}
public time_vote()
{
if( !g_iVoteTime ) {
remove_task( TASK_VOTE_TIME )
finish_vote()
return
}
SET_HUDMSG
for( new i = 1; i <= g_iMaxPlayers; i++ )
{
if( is_user_connected( i ) )
show_hudmessage( i, "%L", i, "VOTE_FINISHS_IN", g_iVoteTime )
}
g_iVoteTime--
}
public finish_vote() {
// hide menu
show_menu( 0, 0, "^n", .time = 1 )
new result = g_vote[ HEAD ] == g_vote[ NORMAL ] ? 0 : 1
if( result )
calculate_votes()
for( new i = 1; i <= g_iMaxPlayers; i++ )
{
if( is_user_connected( i ) )
{
if( !result )
ChatColor( i, "!g[%s] %L", SERVER_TAG, i, "VOTE_NOWINNER" )
else
{
ChatColor( i, "!g[%s] %L", SERVER_TAG, i, "VOTE_FINISH", iHead, iNormal )
ChatColor( i, "!g[%s] %L", SERVER_TAG, i, "VOTE_RESULT", g_vote [ HEAD ] > g_vote[ NORMAL ] ? "Only Headshot mode" : "Normal mode" )
}
set_pev( i, pev_flags, pev( i, pev_flags ) & ~FL_FROZEN );
UTIL_ScreenFade( i, 0, 0, 0, 0, 0, 0, 0 );
}
}
if( g_vote[ HEAD ] > g_vote[ NORMAL ] )
RegisterHam( Ham_TraceAttack, "player", "fw_TraceAttack" ) // we will block all damage except headshots and knife
set_cvar_num( "sv_restart", 3 )
}
public PlaySound( sound )
client_cmd( 0, "spk ^"%s^"", sound_countdown[ sound ] )
public prepare_menu_vote(id) {
formatex( szBuffer[NORMAL], 63, "%L", id, "VOTE_MENU_TITLE" )
new Menu = menu_create( szBuffer[NORMAL], "menu_vote" ) // menu ids start from 0
new iCallback = menu_makecallback( "CallbackMenu" )
menu_additem( Menu, "", .callback = iCallback )
menu_additem( Menu, "", .callback = iCallback )
formatex( szBuffer[NORMAL], 63, "%L", id, "VOTE_MENU_EXIT" )
menu_additem( Menu, szBuffer[NORMAL] )
menu_setprop( Menu, MPROP_EXIT, MEXIT_NEVER )
show_menu_vote( id, Menu )
g_menu_id[id] = Menu
}
public CallbackMenu( id, menu, item ) {
if( CheckFlag( giHasVoted, id ) )
return ITEM_DISABLED
return ITEM_IGNORE
}
show_menu_vote( id, menu ) {
formatex( szBuffer[NORMAL], 63, "Normal mode \r[\y%d%%\r]", iSum ? iNormal : 0 )
formatex( szBuffer[HEAD], 63, "Only Headshot \r[\y%d%%\r]", iSum ? iHead : 0 )
menu_item_setname( menu, NORMAL, szBuffer[NORMAL] )
menu_item_setname( menu, HEAD, szBuffer[HEAD] )
if( CheckFlag( giHasVoted, id ) && !CheckFlag( giHasCloseOption, id ) ) {
formatex( szBuffer[NORMAL], 63, "%L", id, "VOTE_MENU_CLOSE" )
menu_item_setname( menu, MENU_CLOSE, szBuffer[NORMAL] )
AddFlag( giHasCloseOption, id )
}
#if defined USE_MENU_FIX
/* Fix for AMXX menus, more info here:
https://bugs.alliedmods.net/show_bug.cgi?id=4778
https://forums.alliedmods.net/showthread.php?t=230887 */
set_pdata_int( id, m_iMenu, 0 )
#endif
menu_display( id, menu )
}
public menu_vote( id, menu, item ) {
if( item == MENU_EXIT )
return PLUGIN_HANDLED
/* do you see that? Even if a menu hasn't 'exit' option it is called anyway when menu is redisplayed for player.
who made this crap called 'new menus'?! */
if( item == MENU_CLOSE ) {
// destroy the menu and don't disturb player anymore
menu_destroy(menu)
g_menu_id[id] = NO_MENU
return PLUGIN_HANDLED
}
AddFlag( giHasVoted, id );
g_vote[item]++
new uName[ 33 ]
get_user_name( id, uName, charsmax( uName ) )
ChatColor( 0, "!g[%s] %L", SERVER_TAG, id, "VOTE_HAS_CHOOSEN", uName, !item ? "Normal" : "OnlyHead" )
new iMenuId
calculate_votes()
for( new i = 1; i <= g_iMaxPlayers; i++ ) {
iMenuId = g_menu_id
if( iMenuId != NO_MENU )
show_menu_vote( i, iMenuId )
}
return PLUGIN_HANDLED
}
calculate_votes() {
iSum = g_vote[ NORMAL ] + g_vote[ HEAD ]
if( iSum ) {
iNormal = g_vote[ NORMAL ] * 100 / iSum
iHead = 100 - iNormal
}
}
public send_dhud(id) {
set_hudmessage(HUD_COLORS, -1.0, 0.02, 0, _, ShowTASKTIME, 0.1, 0.1);
show_hudmessage(id, "РАБОТАЕТ РЕЖИМ^n%s", g_vote [ HEAD ] > g_vote[ NORMAL ] ? "Only Headshot mode" : "Normal mode");
}
public fw_TraceAttack( victim, attacker, Float:damage, Float:direction[3], trace, damageBits ) {
if( !is_user_connected(victim) ) return HAM_IGNORED
if( get_user_weapon( attacker ) == CSW_KNIFE ) {
if( get_pcvar_num( cvar_blockknife_dmg ) )
return HAM_SUPERCEDE
}
else if( victim != attacker && ( 1 <= attacker <= g_iMaxPlayers ) && get_tr2( trace, TR_iHitgroup ) != HIT_HEAD ) {
set_tr2( trace, TR_flFraction, 1.0 ) // didn't hit anything
return HAM_SUPERCEDE
}
return HAM_IGNORED
}
ChatColor( const id, const input[ ], any:... ) {
new count = 1, players[32], player
static msg[191]
vformat( msg, 190, input, 3 )
replace_all( msg, 190, "!g", "^4" )
replace_all( msg, 190, "!y", "^1" )
replace_all( msg, 190, "!team", "^3" )
replace_all( msg, 190, "!team2", "^0" )
if( id ) {
if( !is_user_connected(id) )
return
players[0] = id
}
else
get_players(players, count, "ch")
for( new i = 0; i < count; i++ ) {
player = players
message_begin(MSG_ONE_UNRELIABLE, gMsgSayText, _, player)
write_byte(player)
write_string(msg)
message_end()
}
}
stock UTIL_ScreenFade(id, iDuration, iHoldTime, iFlags, iRed, iGreen, iBlue, iAlpha, iReliable = 0)
{
message_begin(iReliable ? MSG_ONE : MSG_ONE_UNRELIABLE, MsgId_ScreenFade, _, id);
write_short(iDuration);
write_short(iHoldTime);
write_short(iFlags);
write_byte(iRed);
write_byte(iGreen);
write_byte(iBlue);
write_byte(iAlpha);
message_end();
}
Комментарий:
Ошибки. Есть возможность поправить?
В этой теме было размещено решение! Перейти к решению.
Вложения
-
9.3 KB Просмотры: 814