Иконка ресурса

amxx reapi [GM] Free Vip 1.6.1-beta

Нет прав для скачивания
Установка
Скомпилируйте плагин (инструкция).
Скопируйте файл gm_free_vip.amxx в папку cstrike/addons/amxmodx/plugins
Пропишите файл gm_free_vip.amxx в файле cstrike/addons/amxmodx/configs/plugins.ini
Файл gm_free_vip.txt из архива, перенести в папку на сервере cstrike/addons/amxmodx/data/lang
Файл vips.ini из архива, перенести в папку на сервере cstrike/addons/amxmodx/scripting/plugins/gm_plugins/free_vip
Настройки
Код:
; "start" "end" "flags" "ignore"
; использовать . перед флагами для проверки каждого флага.
; использовать пробел для разделения групп флагов. Ищет до первого совпадения
[Holliday Vip]
"24.08.23 16:00" "25.08.23 16:00" "tm" "tm"
"08.03 00:00" "09.03 00:00" "tm" "tm" ; каждый год

; "start" "end" "flags" "ignore"
; использовать . перед флагами для проверки каждого флага.
; использовать пробел для разделения групп флагов. Ищет до первого совпадения
[Nights Vip]
"22:00" "10:00" "bit" ".bit"   ; Понедельник
"22:00" "10:00" "bit" ".bit"
"22:00" "10:00" "bit" ".bit"
"22:00" "10:00" "bit" ".bit"
"22:00" "10:00" "bit" ".bit"
"" "10:00" "bit" ".bit" выключено
"22:00" "10:00" "bit" ".bit"   ; Воскресенье

; "Steam" "start" "end" "flags"
[Gifts Vip Steam]
"STEAM_0:1:751714418" "24.08.23 16:00" "30.08.23 16:00" "abit"
[Gifts Vip Name]
"NWC" "24.08.23 16:00" "30.08.23 16:00" "abit"
[Gifts Vip Ip]
"192.168.0.1" "24.08.23 16:00" "30.08.23 16:00" "abit"

;"type" "flags" "ignor"
; Type: "Steam" "NextClient" "GSClient" "Steam GSClient" "Steam NextClient" "NextClient Steam" "GSClient Steam" "NonSteam" "All"
; использовать . перед флагами для проверки каждого флага.
; использовать пробел для разделения групп флагов. Ищет до первого совпадения
[Client]
"steam" "a" "a"
"gsclient" "x" "x"
"nextclient" "a" "a"

; "CMD1 CMD2" "AutoClear Minutes" "Length Minutes" "flags" "ignore"
; Не используйте / ? ! . (автоматически / ? ! .)
; используйте Auto Clear = 0 для использование viptest 1 раз за всё время
; использовать . перед флагами для проверки каждого флага.
; использовать пробел для разделения групп флагов. Ищет до первого совпадения
[Test Vip]
"viptest testvip VIPTEST TESTVIP" "43200" "1440" "tw" ".tw m"
Код:
// Писать в чат
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
fv_send_chat "1"

// Писать в hud
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
fv_show_hud "1"

// Частота показа сообщений. N - каждый n раунд. 0 — показать только 1 раз.
// -
// Default: "3"
// Minimum: "0.000000"
fv_freq_msg "3"

// Настройки Hudа
// -
// Default: "0 255 0 -1.0 0.75 0 0.0 6.0 0.1 0.2"
fv_hud_settings "0 255 0 -1.0 0.75 0 0.0 6.0 0.1 0.2"
Код:
; "start" "end" "flags" "ignore"
; to use . in front of the flags to check each flag.
; use a space to separate groups of flags. Searches until the first match
[Holliday Vip]
"24.08.23 16:00" "25.08.23 16:00" "tm" "tm"
"08.03 00:00" "09.03 00:00" "tm" "tm" ; every year
; "start" "end" "flags" "ignore"
; to use . in front of the flags to check each flag.
; use a space to separate groups of flags. Searches until the first match

[Nights Vip]
"22:00" "10:00" "bit" ".bit"   ; Monday
"22:00" "10:00" "bit" ".bit"
"22:00" "10:00" "bit" ".bit"
"22:00" "10:00" "bit" ".bit"
"22:00" "10:00" "bit" ".bit"
"" "10:00" "bit" ".bit"  off
"22:00" "10:00" "bit" ".bit"   ; Sunday

; "Steam/Ip/Name" "start" "end" "flags"
[Gifts Vip Steam]
"STEAM_0:1:751714418" "24.08.23 16:00" "30.08.23 16:00" "abit"
[Gifts Vip Name]
"NWC" "24.08.23 16:00" "30.08.23 16:00" "abit"
[Gifts Vip Ip]
"192.168.0.1" "24.08.23 16:00" "30.08.23 16:00" "abit"

;"type" "flags" "ignor"
; Type: "Steam" "NextClient" "GSClient" "Steam GSClient" "Steam NextClient" "NextClient Steam" "GSClient Steam" "NonSteam" "ALL"
; to use . in front of the flags to check each flag.
; use a space to separate groups of flags. Searches until the first match
[Client]
"steam" "a" "a"
"gsclient" "x" "x"
"nextclient" "a" "a"

; "CMD1 CMD2" "AutoClear Minutes" "Length Minutes" "flags" "ignore"
; don't use / ? ! .  (auto / ? ! .)
; use Auto Clear = 0 to use the viptest 1 time
; to use . in front of the flags to check each flag.
; use a space to separate groups of flags. Searches until the first match
[Test Vip]
"viptest testvip VIPTEST TESTVIP" "43200" "180" "bit" ".bit"
Код:
// Send chat
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
fv_send_chat "1"

// Show hud
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
fv_show_hud "1"

// Freq msg. N - every n round. 0 — show only 1 time.
// -
// Default: "3"
// Minimum: "0.000000"
fv_freq_msg "3"

// Hud settings
// -
// Default: "0 255 0 -1.0 0.75 0 0.0 6.0 0.1 0.2"
fv_hud_settings "0 255 0 -1.0 0.75 0 0.0 6.0 0.1 0.2"
API
Код:
// =========================== //
//           Native            //
// =========================== //

/**
* Check if is Holliday.
*
* @return           true/false
*/
native bool:fv_is_holliday();

/**
* Check if is Nights.
*
* @return           true/false
*/
native bool:fv_is_nights();

/**
* Check if is Gifts.
*
* @param iPlayer     index player
*
* @return           true/false
*/
native bool:fv_is_user_gifts(const iPlayer);

/**
* Gets holiday flags.
*
* @return               bitsum of flags
*/
native fv_get_holliday_flags();

/**
* Gets Nights flags.
*
* @return            bitsum of flags
*/
native fv_get_nights_flags();

/**
* Gets Gifts flags.
*
* @param iPlayer      index player
*
* @return               bitsum of flags
*/
native fv_get_gifts_flags(const iPlayer);

/**
* Gets Ignor Holliday flags.
*
* @param szBuffer       Destination string buffer to copy to
* @param iSize          Maximum length of the string buffer
*
* @return                The result length
*/
native fv_get_ignor_flags_holliday(szBuffer[], const iSize);

/**
* Gets Ignor Nigths flags.
*
* @param szBuffer       Destination string buffer to copy to
* @param iSize          Maximum length of the string buffer
*
* @return                The result length
*/
native fv_get_ignor_flags_nights(szBuffer[], const iSize);

/**
* Gets Unix time stamp for end Gifts.
*
* @param iPlayer      index player
*
* @return               Unix time stamp
*/
native fv_get_time_end_gifts(const iPlayer);

/**
* Gets original user flags.
*
* @param iPlayer      index player
*
* @return               bitsum of flags
*/
native fv_get_user_flags(const iPlayer);

/**
* Gets VipTest flags.
*
* @return               bitsum of flags
*/
native fv_get_viptest_flags();

/**
* Check if is GSClient.
*
* @param iPlayer     index player
*
* @return           true/false
*/
native bool:fv_is_user_gsclient(const iPlayer);

/**
* Gets Ignor VipTest flags.
*
* @param szBuffer       Destination string buffer to copy to
* @param iSize          Maximum length of the string buffer
*
* @return                The result length
*/
native fv_get_ignor_flags_viptest(szBuffer[], const iSize);

/**
* Check if using VipTest.
*
* @param iPlayer     index player
*
* @return           true/false
*/
native bool:fv_is_user_viptest(const iPlayer);

// =========================== //
//         Forwards            //
// =========================== //

/**
* Called when a player sets gift flags
*
* @param iPlayer        Client index
* @param szAuthid       Client authid
* @param bitflags       Client bitflags
* @param bitSetFlags    Set gift bitflags
*
* @noreturn
*/
forward FV_SetGifts(iPlayer, szAuthid[], iStart, iEnd, bitFlags, bitSetFlags);

/**
* Сalled when gift flags are taken away from the player
*
* @param iPlayer        Client index
* @param szAuthid       Client authid
* @param bitflags       Client bitflags
* @param bitSetFlags    Remove gift bitflags
*
* @noreturn
*/
forward FV_RemoveGifts(iPlayer, szAuthid[], bitFlags, bitSetFlags);

/**
* Called when night mode starts
*
* @param iStart         Unix start time
* @param iEnd           Unix end time
* @param bitSetFlags    Set night bitflags
* @param szIgnorFlags   Night ignor flags
*
* @noreturn
*/
forward FV_StartNights(iStart, iEnd, bitSetFlags, szIgnorFlags[]);

/**
* Called when night mode end
*
* @param bitSetFlags    Remove night bitflags
* @param szIgnorFlags   Night ignor flags
*
* @noreturn
*/
forward FV_EndNights(bitFlags, szIgnorFlags[]);

/**
* Called when holliday mode starts
*
* @param iStart         Unix start time
* @param iEnd           Unix end time
* @param bitSetFlags    Set holliday bitflags
* @param szIgnorFlags   Holliday ignor flags
*
* @noreturn
*/
forward FV_StartHolliday(iStart, iEnd, bitSetFlags, szIgnorFlags[]);

/**
* Called when holliday mode end
*
* @param bitSetFlags    Remove holliday bitflags
* @param szIgnorFlags   Holliday ignor flags
*
* @noreturn
*/
forward FV_EndHolliday(bitFlags, szIgnorFlags[]);

/**
* Called when a player sets viptest flags
*
* @param iPlayer        Client index
* @param szAuthid       Client authid
* @param iTimeEnd       Unix end time
* @param bitflags       Client bitflags
* @param bitSetFlags    Set viptest bitflags
*
* @noreturn
*/
forward FV_SetVipTest(iPlayer, szAuthid[], iTimeEnd, bitFlags, bitSetFlags);

/**
* Сalled when viptest flags are taken away from the player
*
* @param iPlayer        Client index
* @param szAuthid       Client authid
* @param bitflags       Client bitflags
* @param bitSetFlags    Remove viptest bitflags
*
* @noreturn
*/
forward FV_RemoveVipTest(iPlayer, szAuthid[], bitFlags, bitSetFlags);

/**
* Called when a player sets clients flags
*
* @param iPlayer        Client index
* @param szAuthid       Client authid
* @param bitflags       Client bitflags
* @param bitSetFlags    Set clients bitflags
*
* @noreturn
*/
forward FV_SetClients(iPlayer, szAuthid[], bitFlags, bitSetFlags);

/**
* Сalled when clients flags are taken away from the player
*
* @param iPlayer        Client index
* @param szAuthid       Client authid
* @param bitflags       Client bitflags
* @param bitSetFlags    Remove clients bitflags
*
* @noreturn
*/
forward FV_RemoveClients(iPlayer, szAuthid[], bitFlags, bitSetFlags);

// =========================== //
//           Stocks            //
// =========================== //

/**
* Reading Hud settings (fixed)
*
* @param szHud         Array for reading settings
* @param iRed          Red saturation
* @param iGreen        Green saturation
* @param iBlue         Blue saturation
* @param x             Location of the message on the x axis in percent
* @param y             Location of the message on the y axis in percent
* @param effects       Display effect
* @param flFxTime      Duration of the effect
* @param flHoldTime    Time the message stays on screen
* @param flFadeInTime  Time it takes the message to fully appear (fade-in)
* @param flFadeOut     Time it takes the message to fully disappear (fade-out)
*
* @noreturn
*/
stock UTIL_ReadHudSettings(const szHud[], &iRed = 255, &iGreen = 255, &iBlue = 255, &Float: x = 0.1, &Float: y = 0.3, &effects,
    &Float: flFxTime, &Float: flHoldTime, &Float: flFadeInTime, &Float: flFadeOut)
{
    new iStart, iEnd;
    iRed = strtol(szHud, iEnd); iStart += iEnd;
    iGreen = strtol(szHud[iStart], iEnd); iStart += iEnd;
    iBlue = strtol(szHud[iStart], iEnd); iStart += iEnd;
    x = strtof(szHud[iStart], iEnd); iStart += iEnd;
    y = strtof(szHud[iStart], iEnd); iStart += iEnd;
    effects = strtol(szHud[iStart], iEnd); iStart += iEnd;
    flFxTime = strtof(szHud[iStart], iEnd); iStart += iEnd;
    flHoldTime = strtof(szHud[iStart], iEnd); iStart += iEnd;
    flFadeInTime = strtof(szHud[iStart], iEnd); iStart += iEnd;
    flFadeOut = strtof(szHud[iStart]);
}

/**
* Checking for flags
*
* @note If there is a dot in front of the flags, then each flag is checked,
*       otherwise at least one of them is present. Separation of groups
*       separated by a space. https://dev-cs.ru/threads/222/post-158636
*
* @param bitFlags         Сhecked flags
* @param szIgnor          Trigger flags
*
* @return                 true/false
*/
stock bool: UTIL_IsIgnorFlags(bitFlags, szIgnor[])
{
    new iPos, szFlags[32];

    while (iPos != -1)
    {
        iPos = argparse(szIgnor, iPos, szFlags, charsmax(szFlags));

        if (replace(szFlags, charsmax(szFlags), ".", ""))
        {
            if (bitFlags == (bitFlags | read_flags(szFlags))) return true;
        }
        else
        {
            if (bitFlags & read_flags(szFlags)) return true;
        }
    }

    return false;
}

/**
* Checks which of the specified flags the player does not have
*
* @note Checks which of the specified flags the player does not have.
*       Original: https://dev-cs.ru/threads/222/post-158636
*
* @param iPlayer          Client index
* @param bitFlags         Bitsum of specified flags
* @param szOther          String for copying flags that the user does not have
*
* @return                 Bitsum Flags that the user does not have
*/
stock UTIL_GetOtherFlags(const iPlayer, bitFlags, szOther[])
{
    bitFlags &= ~get_user_flags(iPlayer);               
    get_flags(bitFlags, szOther, 31);
    return bitFlags;
}

/**
* Issues flags that the user does not have from the specified ones
*
* @param iPlayer          Client index
* @param bitFlags         Flags to be issued to the user
*
* @return                 Flags that will be issued to the user
*/
stock add_user_flags(const iPlayer, bitFlags)
{
    bitFlags &= ~get_user_flags(iPlayer);
    set_user_flags(iPlayer, bitFlags);

    return bitFlags;
}

/**
* Gets the number of the day of the week
*
* @return                 Number of the day of the week
*/
stock UTIL_GetWeekDay()
{
    new szTime[4];
    get_time("%w", szTime, charsmax(szTime));
    return str_to_num(szTime);
}

/**
* Checking the current time in the specified interval
*
* @note Checking for the time in the specified interval
*       Original: https://dev-cs.ru/threads/222/post-158636
*
* @param iStart           Start time (unix)
* @param iEnd             End time (unix)
*
* @return                 true/false
*/
stock bool: UTIL_IsTimeWithin(const iStart, const iEnd)
{
    new iSysTime = get_systime();

    if (iStart <= iSysTime && iSysTime <= iEnd) return true;
    return false;
}

/**
* Checking that the creation time and duration have passed
*
* @param iCreated         Created time (unix)
* @param iLength          Length (unix)
*
* @return                 true/false
*/
stock bool: UTIL_IsTimePassed(const iCreated, const iLength)
{
    if (iCreated + iLength <= get_systime()) return true;
    return false;
}

/**
* Checks the string for the presence of the chat command symbol and deletes it
*
* @param szBuffer       Destination string buffer to copy to
* @param iSize          Maximum length of the string buffer
*
* @return            true/false
*/
stock bool: UTIL_IsDefaultChatCmd(szBuffer[], const iSize)
{
    switch (szBuffer[0])
    {
        case '/': {replace_all(szBuffer, iSize, "/", "");}
        case '!': {replace_all(szBuffer, iSize, "!", "");}
        case '.': {replace_all(szBuffer, iSize, ".", "");}
        case '?': {replace_all(szBuffer, iSize, "?", "");}
        default: {return false;}
    }

    return true;
}
Сверху Снизу