Пользователь
- Сообщения
- 273
- Реакции
- 2
- Ошибка
-
Не отображает время снизу
- ОС
- Linux
- Билд
-
1411
- ReGamedll
-
5.7.0.295
- Список метамодулей
-
[ 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.0.92 ini Start Never
[ 3] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini ANY
[ 4] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY
[ 5] ReParachute RUN - parachute_amxx_i386.so v1.1 Beta pl1 ANY
[ 6] FakeMeta RUN - fakemeta_amxx_i386.so v1.8.3-Re pl1 ANY
[ 7] MySQL RUN - mysql_amxx_i386.so v1.8.3-Re pl1 ANY
[ 8] CStrike RUN - cstrike_amxx_i386.so v1.8.3-Re pl1 ANY
[ 9] CSX RUN - csx_amxx_i386.so v1.8.3-Re pl1 ANY
[10] ReAPI RUN - reapi_amxx_i386.so v5.5.0.150-dev pl1 ANY Never
[11] Engine RUN - engine_amxx_i386.so v1.8.3-Re pl1 ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.8.3-Re pl1 ANY
[13] Fun RUN - fun_amxx_i386.so v1.8.3-Re pl1 ANY
[14] ReCSDM RUN - csdm_amxx_i386.so v3.6 pl1 ANY
- Список плагинов
-
[ 1] Admin Loader 2.5.2 neygomon admin_loader_fo running
[ 2] FreshBans 1.3.8b kanagava fresh_bans_138_ running
[ 3] [CS] Player Models API 1.2 WiLS cs_player_model running
[ 4] Admin Chat 1.8.3-Re AMXX Dev Team adminchat.amxx running
[ 5] Admin Commands 1.8.3-Re AMXX Dev Team admincmd.amxx running
[ 6] Chat Manager 1.1.1-11 Mistrick chatmanager.amx running
[ 7] Commands Menu 1.8.3-Re AMXX Dev Team cmdmenu.amxx running
[ 8] Info. Messages 1.8.3-Re AMXX Dev Team imessage.amxx running
[ 9] Menus Front-End 1.8.3-Re AMXX Dev Team menufront.amxx running
[ 10] Maps Menu 1.8.3-Re AMXX Dev Team mapsmenu.amxx running
[ 11] Map Manager 2.5.61 Mistrick mapmanager.amxx running
[ 12] Players Menu 1.8.3-Re AMXX Dev Team plmenu.amxx running
[ 13] Plugin Menu 1.8.3-Re AMXX Dev Team pluginmenu.amxx running
[ 14] Restrict Weapons 1.8.3-Re AMXX Dev Team restmenu.amxx running
[ 15] Scrolling Message 1.8.3-Re AMXX Dev Team scrollmsg.amxx running
[ 16] Admin Votes 1.8.3-Re AMXX Dev Team adminvote.amxx running
[ 17] CS Misc. Stats 1.8.3-Re AMXX Dev Team miscstats.amxx running
[ 18] CS Stats Logging 1.8.3-Re AMXX Dev Team stats_logging.a running
[ 19] Stats Configuration 1.8.3-Re AMXX Dev Team statscfg.amxx running
[ 20] RE Vampire 1.0.7 MakapoH, AcE, RE re_vampire.amxx running
[ 21] resetscore(ReAPI) 1.0 Phantom resetscore.amxx running
[ 22] Custom Radio Commands 0.6 KaLoSZyFeR custom_radio_v2 running
[ 23] NadeModes 11.2 Nomexous & OT nademodes.amxx running
[ 24] Timelimit Vote 1.0 QooQa timelimitvote.a running
[ 25] Timeleft HUD 1.0 author hudtimeleft.amx running
[ 26] Player Status 1.0 QooQa VictimInfo.amxx running
[ 27] ReCSDM Main 3.6 ReCSDM Team csdm_main.amxx running
[ 28] ReCSDM Equip 3.6 ReCSDM Team csdm_equip.amxx running
[ 29] ReCSDM Spawns 3.6 ReCSDM Team csdm_spawn_pres running
[ 30] ReCSDM Misc 3.6 ReCSDM Team csdm_misc.amxx running
[ 31] ReCSDM Stripper 3.6 KWo csdm_stripper.a running
[ 32] ReCSDM Protection 3.6 BAILOPAN csdm_protection running
- Исходный код
-
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#define VOTE_DELAY 40.0
#define VOTE_STARTDELAY 5
#define VOTE_DURATION 15
#define MAX_RESULTS 5
#define UNIT_SECOND (1<<12)
#define FFADE_IN 0x0000
#define FFADE_OUT 0x0001
#define FFADE_STAYOUT 0x0004
#define TASK_SF 324512
new g_iVoted[33]
new HamHook:g_fwHamSpawn
new Float:g_fTimelimit
new g_msgScreenFade, g_msgSayText
new g_iTimelimitMin[MAX_RESULTS]
new g_iVoteTimeDelay = VOTE_STARTDELAY
new g_iVoteTime = VOTE_DURATION
public plugin_init ()
{
register_plugin ( "Timelimit Vote", "1.0", "QooQa" )
register_menu ( "Menu_Vote", -1, "MenuAction_Vote" )
g_msgScreenFade = get_user_msgid ( "ScreenFade" )
g_msgSayText = get_user_msgid ( "SayText" )
set_task ( VOTE_DELAY, "PreStartVote" )
}
public plugin_precache ()
{
precache_sound ( "csdm/vote_start.wav" )
precache_sound ( "csdm/vote_end.wav" )
}
public client_disconnected ( id )
{
remove_task ( id+TASK_SF )
g_iVoted[id] = 0
}
public PreStartVote ()
{
g_fwHamSpawn = RegisterHam ( Ham_Spawn, "player", "fw_PlayerSpawn", 1 )
for ( new i, iMin = 20; i < MAX_RESULTS; i++, iMin += 10 )
g_iTimelimitMin = iMin
new iNum, i, iPlayers[32]
get_players ( iPlayers, iNum, "ch" )
for ( new b; b < iNum; b++ )
{
i = iPlayers
create_screen_fade ( i, 1, 1, FFADE_OUT, 0, 0, 0, 255 )
set_task ( 1.0, "ScreenFadeStayout", i+TASK_SF )
if ( !is_user_alive ( i ) )
continue
set_pev ( i, pev_velocity, Float:{0.0, 0.0, 0.0} )
set_pev ( i, pev_flags, pev ( i, pev_flags ) | FL_FROZEN )
set_pev ( i, pev_takedamage, DAMAGE_NO )
engclient_cmd ( i, "weapon_knife" )
}
VoteDelayTimer ()
}
public ScreenFadeStayout ( id )
{
id -= TASK_SF
create_screen_fade ( id, 0, g_iVoteTimeDelay + g_iVoteTime, FFADE_STAYOUT, 0, 0, 0, 255 )
}
public VoteDelayTimer ()
{
if ( --g_iVoteTimeDelay > 0 )
{
new sWordEnd[3]
get_ending ( g_iVoteTimeDelay, "а", "ы", "", sWordEnd, charsmax ( sWordEnd ) )
set_hudmessage ( 255, 255, 255, -1.0, 0.3, 0, 0.0, 1.1, 0.0, 0.0, 2 )
show_hudmessage ( 0, "До голосования осталось %i секунд%s", g_iVoteTimeDelay, sWordEnd )
set_task ( 1.0, "VoteDelayTimer" )
}
else
{
client_cmd ( 0,"spk sound/csdm/vote_start" )
VoteTimer ()
}
}
public VoteTimer ()
{
if ( --g_iVoteTime > 0 )
{
new iNum, iPlayers[32]
get_players ( iPlayers, iNum, "ch" )
for ( new b; b < iNum; b++ )
MenuDisplay_Vote ( iPlayers )
set_task ( 1.0, "VoteTimer" )
}
else
{
DisableHamForward ( g_fwHamSpawn )
g_fTimelimit = get_cvar_float ( "mp_timelimit" )
new iTempVotes[MAX_RESULTS]
new iNum, i, iPlayers[32]
get_players ( iPlayers, iNum, "ch" )
for ( new b; b < iNum; b++ )
{
i = iPlayers
if ( g_iVoted ) iTempVotes[g_iVoted - 1]++
create_screen_fade ( i, 1, 0, FFADE_IN, 0, 0, 0, 255 )
client_cmd ( i, "spk sound/csdm/vote_end" )
show_menu ( i, 0, "^n", 1 )
if ( !is_user_alive ( i ) )
continue
if ( pev ( i, pev_flags ) & FL_FROZEN )
set_pev ( i, pev_flags, pev ( i, pev_flags ) & ~FL_FROZEN )
if ( pev ( i, pev_takedamage ) != DAMAGE_AIM )
set_pev ( i, pev_takedamage, DAMAGE_AIM )
}
new iBestVotes, iLeader
for ( new i; i < MAX_RESULTS; i++ )
{
if ( iTempVotes > iBestVotes )
{
iBestVotes = iTempVotes
iLeader = i
}
}
ChatColor ( 0, "^3[^4Информация^3]^1 Голосование завершено. ^1Играем на этой карте ^4%d ^1минут!", g_iTimelimitMin[iLeader] )
set_cvar_num ( "mp_timelimit", g_iTimelimitMin[iLeader] )
}
}
MenuDisplay_Vote ( id )
{
new sMenu[512], iKeys, iPerc
new iLen = formatex ( sMenu, charsmax ( sMenu ), "\yСколько минут хотите сыграть на этой карте?^n^n" )
for ( new b; b < MAX_RESULTS; b++ )
{
iPerc = CalculatePercent ( b )
if ( g_iVoted[id] == b + 1 )
iLen += formatex ( sMenu[iLen], charsmax ( sMenu ) - iLen, "\r%i. \d%i минут (\r%i%%\d)^n", b + 1, g_iTimelimitMin, iPerc )
else
{
iLen += formatex ( sMenu[iLen], charsmax ( sMenu ) - iLen, "\r%i. \y%i \wминут \d(\r%i%%\d)^n", b + 1, g_iTimelimitMin, iPerc )
iKeys |= ( 1 << b )
}
}
iLen += formatex ( sMenu[iLen], charsmax ( sMenu ) - iLen, "^n" )
iLen += formatex ( sMenu[iLen], charsmax ( sMenu ) - iLen, "\yПроголосовали: \r%i\y/\r%i^n", CountVoted (), get_playersnum () )
iLen += formatex ( sMenu[iLen], charsmax ( sMenu ) - iLen, "\yУ Вас \r%i\y секунд, чтобы проголосовать", g_iVoteTime )
show_menu ( id, iKeys, sMenu, -1, "Menu_Vote" )
}
public MenuAction_Vote ( id, key )
{
g_iVoted[id] = key + 1
client_cmd ( id, "spk UI/buttonclickrelease" )
new iNum, iPlayers[32]
get_players ( iPlayers, iNum, "ch" )
for ( new b; b < iNum; b++ )
MenuDisplay_Vote ( iPlayers )
return PLUGIN_HANDLED
}
public fw_PlayerSpawn ( id )
{
if ( !is_user_alive ( id ) )
return
create_screen_fade ( id, 0, g_iVoteTimeDelay + g_iVoteTime, FFADE_STAYOUT, 0, 0, 0, 255 )
set_pev ( id, pev_velocity, Float:{0.0,0.0,0.0} )
set_pev ( id, pev_flags, pev ( id, pev_flags ) | FL_FROZEN )
set_pev ( id, pev_takedamage, DAMAGE_NO )
engclient_cmd ( id, "weapon_knife" )
}
public plugin_end () { set_cvar_float ( "mp_timelimit", g_fTimelimit ); }
CalculatePercent ( const item )
{
new iTemp = CountVoted ()
if ( !iTemp )
return 0
new Float:fRet = 100.0 * CountVoted ( item ) / iTemp
return floatround ( fRet )
}
CountVoted ( const item = -1 )
{
/*
Если item == -1 значит плагин хочет посчитать сколько
людей вообще проголосовало
*/
new iRet, iNum, i, iPlayers[32]
get_players ( iPlayers, iNum, "ch" )
for ( new b; b < iNum; b++ )
{
i = iPlayers
if ( g_iVoted )
{
if ( item != -1 )
{
if ( item == g_iVoted - 1 )
iRet++
}
else
iRet++
}
}
return iRet
}
stock get_ending ( num, const a[], const b[], const c[], output[], output_len )
{
new iNum100 = num%100, iNum10 = num%10
if ( iNum100 >= 5 && iNum100 <= 20 || iNum10 == 0 || iNum10 >= 5 && iNum10 <= 9 ) formatex ( output, output_len, "%s", c )
else if ( iNum10 == 1 ) formatex ( output, output_len, "%s", a )
else if ( iNum10 >= 2 && iNum10 <= 4 ) formatex ( output, output_len, "%s", b )
}
stock create_screen_fade ( id, duration, holdtime, fade_type, red, green, blue, alpha )
{
message_begin ( MSG_ONE_UNRELIABLE, g_msgScreenFade, .player = id )
write_short ( UNIT_SECOND*duration ) // Duration
write_short ( UNIT_SECOND*holdtime ) // Hold time
write_short ( fade_type ) // Fade type
write_byte ( red ) // Red
write_byte ( green ) // Green
write_byte ( blue ) // Blue
write_byte ( alpha ) // Alpha
message_end ()
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!y", "^1") // Default Color
replace_all(msg, 190, "!team", "^3") // Team Color
replace_all(msg, 190, "!team2", "^0") // Team2 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, g_msgSayText, _, players)
write_byte(players);
write_string(msg);
message_end();
}
}
}
}
как сделать чтобы плагин после смены времени менял счётчик снизу без перезахода на сервер
В этой теме было размещено решение! Перейти к решению.