gm_night_vips

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
52
Реакции
0
Помог
1 раз(а)
Ошибка
увеличить количество символов
ОС
Windows
Amx Mod X
AMX Mod X 1.9.0.5271
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.11.0.767-dev
Build date: 03:14:15 Oct 25 2021 (2753)
ReGamedll
ReGameDLL version: 5.21.0.556-dev
Build date: 08:44:42 Jul 22 2022
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/1081301
Версия Metamod
Metamod-r v1.3.0.131, API (5:13)
Metamod-r build: 18:51:28 Jul 11 2022
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/adc9414
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] SafeNameAndChat RUN - safenameandchat.dll v1.1 ini ANY ANY
[ 2] Reunion RUN - reunion_mm.dll v0.1.92d ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm.dll v0.1.6 ini Start Never
[ 4] VoiceTranscoder RUN - voicetranscoder.dll v2017RC5 ini ANY ANY
[ 5] AMX Mod X RUN - amxmodx_mm.dll v1.9.0.5271 ini Start ANY
[ 6] Rechecker RUN - rechecker_mm.dll v2.7 ini Chlvl ANY
[ 7] ReSemiclip RUN - resemiclip_mm.dll v2.3.9 ini Chlvl ANY
[ 8] WHBlocker RUN - whblocker_mm.dll v1.5.697 ini Chlvl ANY
[ 9] SQLite RUN - sqlite_amxx.dll v1.9.0.5271 pl5 ANY ANY
[10] GeoIP RUN - geoip_amxx.dll v1.9.0.5271 pl5 ANY ANY
[11] Ham Sandwich RUN - hamsandwich_amxx.dll v1.9.0.5271 pl5 ANY ANY
[12] FakeMeta RUN - fakemeta_amxx.dll v1.9.0.5271 pl5 ANY ANY
[13] ReAPI RUN - reapi_amxx.dll v5.21.0.252-dev pl5 ANY Never
[14] ReAimDetector RUN - reaimdetector_amxx.dll v0.2.2 pl5 ANY Never
[15] CStrike RUN - cstrike_amxx.dll v1.9.0.5271 pl5 ANY ANY
[16] Fun RUN - fun_amxx.dll v1.9.0.5271 pl5 ANY ANY
[17] Engine RUN - engine_amxx.dll v1.9.0.5271 pl5 ANY ANY
17 plugins, 17 running
Список плагинов
gm_night_vips
Автор плагина
Noob_with_cheatsv
Версия плагина
1.1.1
Исходный код
#include <amxmodx>
#include <reapi>

enum _:PCVAR
{
FLAGS[64],
COLOR[12],
COORD[11],
START[6],
END[6]
}
new bool:bModeNight = false, bool:bPlayers[MAX_PLAYERS + 1], g_pCvar[PCVAR];

public plugin_init()
{
register_plugin("[GM] Night VIP","1.1.1","[GM] NWC");
register_dictionary("gm_night_vips.txt");

bind_pcvar_string(create_cvar("nightvip_flags", "t", FCVAR_NOEXTRAWHITEPACE, "Night Vip flags"), g_pCvar[FLAGS], charsmax(g_pCvar[FLAGS]));
bind_pcvar_string(create_cvar("nightvip_start", "23:00", FCVAR_NOEXTRAWHITEPACE, "Start time of the night VIP"), g_pCvar[START], charsmax(g_pCvar[START]));
bind_pcvar_string(create_cvar("nightvip_end", "8:00", FCVAR_NOEXTRAWHITEPACE, "End time of the night VIP"), g_pCvar[END], charsmax(g_pCvar[END]));
bind_pcvar_string(create_cvar("nightvip_dhud_color", "0 255 0", FCVAR_NOEXTRAWHITEPACE, "Dhud color"), g_pCvar[COLOR], charsmax(g_pCvar[COLOR]));
bind_pcvar_string(create_cvar("nightvip_dhud_coord","-1.0 0.1", FCVAR_NOEXTRAWHITEPACE, "Dhud coordinates"), g_pCvar[COORD], charsmax(g_pCvar[COORD]));

AutoExecConfig(true, "nightvips", "gm_plugins");

RegisterHookChain(RG_RoundEnd, "RG_RoundEnd_Pre", false);
}
public client_putinserver(id)
{
if(!is_user_ign(id) && bModeNight && ~get_user_flags(id) & read_flags(g_pCvar[FLAGS]))
{
set_task_ex(5.0, "vip_info", id+2077);
}
}
public client_disconnected(id)
{
if(bPlayers[id])
{
bPlayers[id] = false;
}
}
public RG_RoundEnd_Pre(WinStatus:status, ScenarioEventEndRound:event, Float:tmDelay)
{
new Hour, Min, hStart, hEnd, mStart, mEnd;

get_int_time(g_pCvar[START], hStart, mStart);
get_int_time(g_pCvar[END], hEnd, mEnd);
time(Hour,Min);

if(hStart == hEnd && mEnd == mStart || hStart >= 24 || hEnd >= 24 || hStart < 0 || hEnd < 0)
{
for(new id; id <= MaxClients; id++)
{
if(get_user_flags(id) & ADMIN_CVAR)
{
client_print_color(id, -2,"%L %L", -1, "GM_NIGTVIPS_PREFIX", -1, "GM_NIGHTVIPS_ERROR");
}
}
server_print("[GM Night VIP] Error! Sets cvar nightvip_end is 8:00 and nightvip_start is 23:00!", g_pCvar[START], g_pCvar[END]);
log_amx("[GM Night VIP] Error! Sets cvar nightvip_end is 8:00 and nightvip_start is 23:00!", g_pCvar[START], g_pCvar[END]);
set_pcvar_string(g_pCvar[START], "23:00");
set_pcvar_string(g_pCvar[END], "8:00");
}

new bool:bModeNightP = bModeNight;

if(hStart == hEnd && hStart == Hour && mStart <= Min <= mEnd)
{
bModeNight = true;
}
else if(Hour == hEnd && Min < mEnd)
{
bModeNight = true;
}
else if(Hour == hStart && Min >= mStart)
{
bModeNight = true;
}
else if(hStart > hEnd && (Hour > hStart > hEnd || hStart > hEnd > Hour))
{
bModeNight = true;
}
else if(hEnd > hStart && hEnd > Hour > hStart)
{
bModeNight = true;
}
else
{
bModeNight = false;
}

if(bModeNight && !bModeNightP)
{
for(new id; id <= MaxClients; id++)
{
if(is_user_ign(id))
{
continue;
}

if(get_user_flags(id) & read_flags(g_pCvar[FLAGS]))
{
vip_info(id, 2)
}
else
{
vip_info(id, 0)
}
}
}
if(bModeNightP && !bModeNight)
{
for(new id; id <= MaxClients; id++)
{
if(is_user_ign(id))
{
continue;
}

vip_info(id, 1)
}
}
}
public vip_info(id, sc)
{
new szChat[128], szDhud[64];

if(id > 2077)
{
id-=2077;
sc = 0;
}

switch(sc)
{
case 0:
{
bPlayers[id] = true;
set_user_flags(id, read_flags(g_pCvar[FLAGS]));
formatex(szChat, charsmax(szChat), "%L %L", id, "GM_NIGTVIPS_PREFIX", id, "GM_NIGTVIPS_CHAT_START")
formatex(szDhud, charsmax(szDhud), "%L", id, "GM_NIGTVIPS_DHUD_START")
}
case 1:
{
if(bPlayers[id])
{
bPlayers[id]=false;
remove_user_flags(id, read_flags(g_pCvar[FLAGS]));
}
formatex(szChat, charsmax(szChat), "%L %L", id, "GM_NIGTVIPS_PREFIX", id, "GM_NIGTVIPS_CHAT_END")
formatex(szDhud, charsmax(szDhud), "%L", id, "GM_NIGTVIPS_DHUD_END")
}
case 2:
{
formatex(szChat, charsmax(szChat), "%L %L", id, "GM_NIGTVIPS_PREFIX", id, "GM_NIGTVIPS_CHAT_IGN");
formatex(szDhud, charsmax(szDhud), "%L", id, "GM_NIGTVIPS_DHUD_START")
}
}

new red[4], green[4], blue[4], coord_x[5], coord_y[5];

parse(g_pCvar[COLOR], red, 3, green, 3, blue, 3);
parse(g_pCvar[COORD], coord_x, 4, coord_y, 4);
set_dhudmessage(str_to_num(red), str_to_num(green), str_to_num(blue), str_to_float(coord_x), str_to_float(coord_y), 0, 0.0, 5.0, 0.05, 1.5);
show_dhudmessage(id, "%s", szDhud);
client_print_color(id, print_team_blue, "%s", szChat);

return PLUGIN_HANDLED;
}

stock get_int_time(const string[], &hour, &minutes)
{
new left[4],right[4];
strtok2(string,left,charsmax(left),right,charsmax(right),':');
hour = str_to_num(left);
minutes = str_to_num(right);
}

stock set_task_ex(Float:time, const function[], id = 0, const any:parameter[] = "", len = 0, SetTaskFlags:flags = SetTask_Once, repeat = 0)
{
new strFlags[2];
get_flags(_:flags, strFlags, charsmax(strFlags));
set_task(time, function, id, parameter, len, strFlags, repeat);
}

stock is_user_ign(const id)
{
return (is_user_bot(id) || is_user_hltv(id) || is_user_connecting(id) || !is_user_connected(id));
}
Не хватает буквально пару символов для полного отображения текста, как пофиксить? помогите пожалуйста
 
В этой теме было размещено решение! Перейти к решению.

Download all Attachments

Сообщения
3,593
Реакции
1,576
Помог
141 раз(а)
Переделать с dhud на обычный HUD
 
Сообщения
397
Реакции
221
Помог
13 раз(а)
Troleks,

Код:
#include <amxmodx>
#include <reapi>

enum _:PCVAR
{
    FLAGS[64],
    COLOR[12],
    COORD[11],
    START[6],
    END[6]
}
new bool:bModeNight = false, bool:bPlayers[MAX_PLAYERS + 1], g_pCvar[PCVAR];

public plugin_init()
{
    register_plugin("[GM] Night VIP","1.1.1","[GM] NWC");
    register_dictionary("gm_night_vips.txt");

    bind_pcvar_string(create_cvar("nightvip_flags", "t", FCVAR_NOEXTRAWHITEPACE, "Night Vip flags"), g_pCvar[FLAGS], charsmax(g_pCvar[FLAGS]));
    bind_pcvar_string(create_cvar("nightvip_start", "23:00", FCVAR_NOEXTRAWHITEPACE, "Start time of the night VIP"), g_pCvar[START], charsmax(g_pCvar[START]));
    bind_pcvar_string(create_cvar("nightvip_end", "8:00", FCVAR_NOEXTRAWHITEPACE, "End time of the night VIP"), g_pCvar[END], charsmax(g_pCvar[END]));
    bind_pcvar_string(create_cvar("nightvip_dhud_color", "0 255 0", FCVAR_NOEXTRAWHITEPACE, "Dhud color"), g_pCvar[COLOR], charsmax(g_pCvar[COLOR]));
    bind_pcvar_string(create_cvar("nightvip_dhud_coord","-1.0 0.1", FCVAR_NOEXTRAWHITEPACE, "Dhud coordinates"), g_pCvar[COORD], charsmax(g_pCvar[COORD]));

    AutoExecConfig(true, "nightvips", "gm_plugins");

    RegisterHookChain(RG_RoundEnd, "RG_RoundEnd_Pre", false);
}
public client_putinserver(id)
{
    if(!is_user_ign(id) && bModeNight && ~get_user_flags(id) & read_flags(g_pCvar[FLAGS]))
    {
        set_task_ex(5.0, "vip_info", id+2077);
    }
}
public client_disconnected(id)
{
    if(bPlayers[id])
    {
        bPlayers[id] = false;
    }
}
public RG_RoundEnd_Pre(WinStatus:status, ScenarioEventEndRound:event, Float:tmDelay)
{
    new Hour, Min, hStart, hEnd, mStart, mEnd;

    get_int_time(g_pCvar[START], hStart, mStart);
    get_int_time(g_pCvar[END], hEnd, mEnd);
    time(Hour,Min);

    if(hStart == hEnd && mEnd == mStart || hStart >= 24 || hEnd >= 24 || hStart < 0 || hEnd < 0)
    {
        for(new id; id <= MaxClients; id++)
        {
            if(get_user_flags(id) & ADMIN_CVAR)
            {
                client_print_color(id, -2,"%L %L", -1, "GM_NIGTVIPS_PREFIX", -1, "GM_NIGHTVIPS_ERROR");
            }
        }
        server_print("[GM Night VIP] Error! Sets cvar nightvip_end is 8:00 and nightvip_start is 23:00!", g_pCvar[START], g_pCvar[END]);
        log_amx("[GM Night VIP] Error! Sets cvar nightvip_end is 8:00 and nightvip_start is 23:00!", g_pCvar[START], g_pCvar[END]);
        set_pcvar_string(g_pCvar[START], "23:00");
        set_pcvar_string(g_pCvar[END], "8:00");
    }

    new bool:bModeNightP = bModeNight;

    if(hStart == hEnd && hStart == Hour && mStart <= Min <= mEnd)
    {
        bModeNight = true;
    }
    else if(Hour == hEnd && Min < mEnd)
    {
        bModeNight = true;
    }
    else if(Hour == hStart && Min >= mStart)
    {
        bModeNight = true;
    }
    else if(hStart > hEnd && (Hour > hStart > hEnd || hStart > hEnd > Hour))
    {
        bModeNight = true;
    }
    else if(hEnd > hStart && hEnd > Hour > hStart)
    {
        bModeNight = true;
    }
    else
    {
        bModeNight = false;
    }

    if(bModeNight && !bModeNightP)
    {
        for(new id; id <= MaxClients; id++)
        {
            if(is_user_ign(id))
            {   
                continue;
            }
    
            if(get_user_flags(id) & read_flags(g_pCvar[FLAGS]))
            {
                vip_info(id, 2)
            }
            else
            {
                vip_info(id, 0)
            }
        }
    }
    if(bModeNightP && !bModeNight)
    {
        for(new id; id <= MaxClients; id++)
        {
            if(is_user_ign(id)) 
            {   
                continue;
            }

            vip_info(id, 1)
        }
    }
}
public vip_info(id, sc)
{
-     new szChat[128], szDhud[64];
+    new szChat[128], szDhud[128];

    if(id > 2077)
    {
        id-=2077;
        sc = 0;
    }

    switch(sc)
    {
        case 0:
        {
            bPlayers[id] = true;
            set_user_flags(id, read_flags(g_pCvar[FLAGS]));
            formatex(szChat, charsmax(szChat), "%L %L", id, "GM_NIGTVIPS_PREFIX", id, "GM_NIGTVIPS_CHAT_START")
            formatex(szDhud, charsmax(szDhud), "%L", id, "GM_NIGTVIPS_DHUD_START")
        }
        case 1:
        {
            if(bPlayers[id])
            {
                bPlayers[id]=false;
                remove_user_flags(id, read_flags(g_pCvar[FLAGS]));
            }
            formatex(szChat, charsmax(szChat), "%L %L", id, "GM_NIGTVIPS_PREFIX", id, "GM_NIGTVIPS_CHAT_END")
            formatex(szDhud, charsmax(szDhud), "%L", id, "GM_NIGTVIPS_DHUD_END")
        }
        case 2:
        {
            formatex(szChat, charsmax(szChat), "%L %L", id, "GM_NIGTVIPS_PREFIX", id, "GM_NIGTVIPS_CHAT_IGN");
            formatex(szDhud, charsmax(szDhud), "%L", id, "GM_NIGTVIPS_DHUD_START")
        }
    }

    new red[4], green[4], blue[4], coord_x[5], coord_y[5];

    parse(g_pCvar[COLOR], red, 3, green, 3, blue, 3);
    parse(g_pCvar[COORD], coord_x, 4, coord_y, 4);
    set_dhudmessage(str_to_num(red), str_to_num(green), str_to_num(blue), str_to_float(coord_x), str_to_float(coord_y), 0, 0.0, 5.0, 0.05, 1.5);
    show_dhudmessage(id, "%s", szDhud);
    client_print_color(id, print_team_blue, "%s", szChat);

    return PLUGIN_HANDLED;
}

stock get_int_time(const string[], &hour, &minutes)
{
    new left[4],right[4];
    strtok2(string,left,charsmax(left),right,charsmax(right),':');
    hour = str_to_num(left);
    minutes = str_to_num(right);
}

stock set_task_ex(Float:time, const function[], id = 0, const any:parameter[] = "", len = 0, SetTaskFlags:flags = SetTask_Once, repeat = 0)
{
    new strFlags[2];
    get_flags(_:flags, strFlags, charsmax(strFlags));
    set_task(time, function, id, parameter, len, strFlags, repeat);
}

stock is_user_ign(const id)
{
    return (is_user_bot(id) || is_user_hltv(id) || is_user_connecting(id) || !is_user_connected(id));
}
 
Статус
В этой теме нельзя размещать новые ответы.

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

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