Помошь в Добавления Флага

Статус
В этой теме нельзя размещать новые ответы.

gesk1995

Пользователь
Регистрация
8 Июн 2017
Сообщения
339
Симпатии
12
Пол
Мужской
Хочу сделать что бы в чат и в Дхуд выводило К нам Присоединилась [Девушка*]+[VIP] помогите добавить второй флаг , то я сам пробывал считает только флаг Т как вип ,
Помогите сделать так что бы считалось 2 флага как у Админа + вип

public taskJoin( taskid )
{
if( !is_user_admin( taskid ) )
return PLUGIN_HANDLED;

new s_Name[32], iSuperAdmin, iVipAdmin, iVip, iAdmin, iFlags;

get_user_name( taskid , s_Name , charsmax( s_Name ) );
StartCheckPlayerAccess(taskid);

iFlags = get_user_flags(taskid);
iSuperAdmin = ((iFlags & ADMIN_LEVEL_H) && (iFlags & ADMIN_BAN) && (iFlags & ADMIN_RCON)) ? 1:0;
iVipAdmin = ((iFlags & ADMIN_LEVEL_H) && (iFlags & ADMIN_BAN)) ? 1:0;
iVip = (iFlags & ADMIN_LEVEL_H) ? 1:0;
iAdmin = (iFlags & ADMIN_BAN) ? 1:0;

if (iSuperAdmin)
{
client_print_color(0, taskid, "%L", LANG_PLAYER, "SUPER_CONNECT_CHAT", s_Name);
set_dhudmessage(51, 153, 255, -1.0, 0.13, 0, 6.0, 5.0)
show_dhudmessage( 0 , "%L" , LANG_PLAYER , "SUPER_CONNECT_HUD" , s_Name );
}
else if (iVipAdmin)
{
client_print_color(0, taskid, "%L", LANG_PLAYER, "VIP_ADMIN_CONNECT_CHAT", s_Name);

set_dhudmessage(0, 255, 0, -1.0, 0.13, 0, 6.0, 5.0)
show_dhudmessage( 0 , "%L" , LANG_PLAYER , "VIP_ADMIN_CONNECT_HUD" , s_Name );
}
else if(iVip)
{
client_print_color( 0 , taskid , "%L" , LANG_PLAYER , "VIP_CONNECT_CHAT" , s_Name );

set_dhudmessage(205, 102, 0, -1.0, 0.13, 0, 6.0, 5.0)
show_dhudmessage( 0 , "%L" , LANG_PLAYER , "VIP_CONNECT_HUD" , s_Name );
}
else if (iAdmin)
{
client_print_color( 0 , taskid , "%L" , LANG_PLAYER , "ADMIN_CONNECT_CHAT" , s_Name );

set_dhudmessage(255, 255, 0, -1.0, 0.13, 0, 6.0, 5.0)
show_dhudmessage( 0 , "%L" , LANG_PLAYER , "ADMIN_CONNECT_HUD" , s_Name );
}
else if(get_user_flags(taskid) & ADMIN_LEVEL_G)
{
client_print_color( 0 , taskid , "%L" , LANG_PLAYER , "WOMEN_CONNECT_CHAT" , s_Name );

set_dhudmessage(153, 51, 153, -1.0, 0.13, 0, 6.0, 5.0)
show_dhudmessage( 0 , "%L" , LANG_PLAYER , "WOMEN_CONNECT_HUD" , s_Name );
}
 

To be or not to be

Пользователь
Регистрация
9 Июн 2017
Сообщения
1.215
Симпатии
304
Можешь эти строки как КОД прикрепить?
 

To be or not to be

Пользователь
Регистрация
9 Июн 2017
Сообщения
1.215
Симпатии
304

Вложения

gesk1995

Пользователь
Регистрация
8 Июн 2017
Сообщения
339
Симпатии
12
Пол
Мужской
To be or not to be, нету тут такова , а что так код нельзя посмотреть ?
 

To be or not to be

Пользователь
Регистрация
9 Июн 2017
Сообщения
1.215
Симпатии
304
gesk1995, можно, но вот такой код слегка не приятен на глаз :D[DOUBLEPOST=1511881014][/DOUBLEPOST]gesk1995, у девушки какой флаг по мимо вип есть?
 

To be or not to be

Пользователь
Регистрация
9 Июн 2017
Сообщения
1.215
Симпатии
304
gesk1995, какой у девушки флаг есть по мимо вип?
 

gesk1995

Пользователь
Регистрация
8 Июн 2017
Сообщения
339
Симпатии
12
Пол
Мужской
S@To be or not to be, ADMIN_LEVEL_G (S)
 

To be or not to be

Пользователь
Регистрация
9 Июн 2017
Сообщения
1.215
Симпатии
304
gesk1995, iGirl+Vip = ((iFlags & ADMIN_LEVEL_H) && (iFlags & ADMIN_LEVEL_G)) ? 1:0;[DOUBLEPOST=1511881521][/DOUBLEPOST]Поставь выше простой випки
 

gesk1995

Пользователь
Регистрация
8 Июн 2017
Сообщения
339
Симпатии
12
Пол
Мужской
To be or not to be,
в чём может быть проблема Этого плагина ?[DOUBLEPOST=1511900425][/DOUBLEPOST]To be or not to be, Кодировка в Текстовом Ок , и в Плагине тоже)
 

Вложения

spanjbob4ik

Пользователь
Регистрация
27 Сен 2017
Сообщения
17
Симпатии
0
To be or not to be,
в чём может быть проблема Этого плагина ?[DOUBLEPOST=1511900425][/DOUBLEPOST]To be or not to be, Кодировка в Текстовом Ок , и в Плагине тоже)


stock Color_Print(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

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, get_user_msgid("SayText"), _, players)
write_byte(players);
write_string(msg);
message_end();
}
}
}
}
 

gesk1995

Пользователь
Регистрация
8 Июн 2017
Сообщения
339
Симпатии
12
Пол
Мужской
spanjbob4ik, А в чём именно проблема ?
 

BeasT

Anubis
Пользователь
Регистрация
26 Июн 2017
Сообщения
390
Симпатии
53
Пол
Мужской

gesk1995

Пользователь
Регистрация
8 Июн 2017
Сообщения
339
Симпатии
12
Пол
Мужской
BeasT, Спасибо , не видел , буду Знать :DDD
 

gesk1995

Пользователь
Регистрация
8 Июн 2017
Сообщения
339
Симпатии
12
Пол
Мужской
spanjbob4ik, по русски напиши что делать с Этим ?
 

To be or not to be

Пользователь
Регистрация
9 Июн 2017
Сообщения
1.215
Симпатии
304
gesk1995, он бред написал, не в тему.
Что конкретно не так с плагином?
Ты дал скриншот, а мы еще должны догадываться, что же тут не так?
 

gesk1995

Пользователь
Регистрация
8 Июн 2017
Сообщения
339
Симпатии
12
Пол
Мужской
To be or not to be,
Код:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <fakemeta>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "Weapon Admin Menu"
#define VERSION "0.1"
#define AUTHOR "Nesquik"

new Array:AccessModel, Array:AccessMoney, Array:AccessStartItems,
Array:AccessVipTag, Array:AccessWPMenu, Array:AccessVampire,
Array:AccessDamager, Array:AccessScreenFade;

enum _: admin_data
{
    model_t[64],
    model_ct[64],
    model_index_t,
    model_index_ct,
    bool:money_enable,
    money,
    vampire_enable,
    vampire_hp,
    vampire_max,
    wp_menu_round,
    bool:wp_menu_enable,
    screen_fade_msgid,
    connect_sound[64]
}

enum _: pl_data
{
    bool:access_model, // +
    bool:access_money, // +
    bool:access_startitems, // +
    bool:access_viptag, //
    bool:access_wpmenu, // +
    bool:access_vampire, // +
    bool:access_damager, //
    bool:access_screen_fade, // +
}

new bool:gi_PLAccessData[33][pl_data];

new const g_sItemNames[][] =
{
    "WP_AK47",
    "WP_M4A1",
    "WP_FAMAS",
    "WP_AWP",
    "WP_SCOUT",
    "WP_AUG",
    "WP_M249",
    "WP_GALIL"
};

new const g_sEntNames[][] =
{
    "weapon_ak47",
    "weapon_m4a1" ,
    "weapon_famas",
    "weapon_awp",
    "weapon_scout",
    "weapon_aug",
    "weapon_m249",
    "weapon_galil"
}

new gs_serverdata[ admin_data ];
new const g_iAmmoWP[] = {90, 90, 90, 30, 90, 90, 200, 90}

new g_iRoundNumber;
new bool:gb_WeaponChoosed[33];

const OFFSET_LINUX = 5
const OFFSET_MODELINDEX = 491 // Orangutanz

const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)

new Float:gf_TaskJoin, g_MsgSync;
new gi_WPMenuIndex;

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)

    register_clcmd( "say /adminka" , "WP_Adminka" );

    register_event( "Damage" , "WP_TakeDamage_Post" , "b", "2!0", "3=0", "4!0" );
    register_clcmd( "weaponmenu" , "WP_GeneralMenu" );

    gs_serverdata[screen_fade_msgid] = get_user_msgid( "ScreenFade" );

    register_logevent( "WP_RoundStart" , 2, "1=Round_Start" );
    register_event( "DeathMsg" , "EventDeathMsg" , "1!0" );
    register_event( "TextMsg", "WP_RoundRestart" , "a" , "2=#Game_commencing" , "2=#Game_will_restart_in" );

    register_dictionary( "weaponmenu.txt" );

    g_MsgSync = CreateHudSyncObj( );

    WP_BuildWeaponMenu( );

    gf_TaskJoin = 1.0
}

public WP_BuildWeaponMenu()
{
    new s_Text[96], s_Key[3];
    new i_Size;

    i_Size = charsmax( s_Text );

    formatex( s_Text , charsmax( s_Text ) , "%L" , LANG_PLAYER , "WP_TITLE" );
    gi_WPMenuIndex = menu_create( s_Text , "WP_MenuFuncWeapons" );

    for( new i = 0; i < sizeof g_sItemNames; i++ )
    {
        s_Key[0] = i;

        formatex( s_Text , i_Size , "%L" , LANG_PLAYER , g_sItemNames[i] );
        menu_additem( gi_WPMenuIndex , s_Text , s_Key );
    }

    formatex( s_Text , i_Size , "%L" , LANG_PLAYER , "MENU_EXIT" );
    menu_setprop( gi_WPMenuIndex , MPROP_EXITNAME , s_Text );

    formatex( s_Text , i_Size , "%L" , LANG_PLAYER , "MENU_BACK" );
    menu_setprop( gi_WPMenuIndex , MPROP_BACKNAME , s_Text );

    formatex( s_Text , i_Size , "%L" , LANG_PLAYER , "MENU_NEXT" );
    menu_setprop( gi_WPMenuIndex , MPROP_NEXTNAME , s_Text );
}

public WP_Adminka( id )
    show_motd( id , "Buy Admin" , "adminka.txt" );

public WP_TakeDamage_Post( id )
{
    static damage, pid;
    damage = read_data(2);

    if( gi_PLAccessData[id][access_damager] )
    {
        set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1);
        ShowSyncHudMsg(id, g_MsgSync, "%d", damage);
    }

    pid = get_user_attacker(id);
    if( is_user_connected(pid) )
    {
        if( gi_PLAccessData[pid][access_damager] )
        {
            set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, 1);
            ShowSyncHudMsg(pid, g_MsgSync, "%d", damage);
        }
    }
}

public client_putinserver( id )
{
    RemoveAccessData(id);

    if( !is_user_bot( id ) && !is_user_hltv( id ) )
        set_task( gf_TaskJoin , "taskJoin" , id );
}

public RemoveAccessData(id)
{
    for(new i = access_model; i <= access_screen_fade; i++)
        gi_PLAccessData[id][i] = false;
}

public StartCheckPlayerAccess(id)
{
    new flags = get_user_flags(id);
    new index;

    for(index = 0; index < ArraySize(AccessModel); index++)
    {
        if(flags & ArrayGetCell(AccessModel, index))
        {
            gi_PLAccessData[id][access_model] = true
            break;
        }
        else
        {
            continue;
        }
    }

    for(index = 0; index < ArraySize(AccessMoney); index++)
    {
        if(flags & ArrayGetCell(AccessMoney, index))
        {
            gi_PLAccessData[id][access_money] = true;
            break;
        }
        else
        {
            continue;
        }
    }

    for(index = 0; index < ArraySize(AccessStartItems); index++)
    {
        if(flags & ArrayGetCell(AccessStartItems, index))
        {
            gi_PLAccessData[id][access_startitems] = true;
            break;
        }
        else
        {
            continue;
        }
    }

    for(index = 0; index < ArraySize(AccessVipTag); index++)
    {
        if(flags & ArrayGetCell(AccessVipTag, index))
        {
            gi_PLAccessData[id][access_viptag] = true;
            break;
        }
        else
        {
            continue;
        }
    }

    for(index = 0; index < ArraySize(AccessWPMenu); index++)
    {
        if(flags & ArrayGetCell(AccessWPMenu, index))
        {
            gi_PLAccessData[id][access_wpmenu] = true;
            break;
        }
        else
        {
            continue;
        }
    }

    for(index = 0; index < ArraySize(AccessVampire); index++)
    {
        if(flags & ArrayGetCell(AccessVampire, index))
        {
            gi_PLAccessData[id][access_vampire] = true;
            break;
        }
        else
        {
            continue;
        }
    }

    for(index = 0; index < ArraySize(AccessScreenFade); index++)
    {
        if(flags & ArrayGetCell(AccessScreenFade, index))
        {
            gi_PLAccessData[id][access_screen_fade] = true;
            break;
        }
        else
        {
            continue;
        }
    }

    for(index = 0; index < ArraySize(AccessDamager); index++)
    {
        if(flags & ArrayGetCell(AccessDamager, index))
        {
            gi_PLAccessData[id][access_damager] = true;
            break;
        }
        else
        {
            continue;
        }
    }
}

public taskJoin( taskid )
{
    if( !is_user_admin( taskid ) )
        return PLUGIN_HANDLED;

    new s_Name[32], iSuperAdmin, iVipAdmin, iVip, iAdmin, iFlags;

    get_user_name( taskid , s_Name , charsmax( s_Name ) );
    StartCheckPlayerAccess(taskid);

    iFlags = get_user_flags(taskid);
    iSuperAdmin = ((iFlags & ADMIN_LEVEL_H) && (iFlags & ADMIN_BAN) && (iFlags & ADMIN_RCON)) ? 1:0;
    iVipAdmin = ((iFlags & ADMIN_LEVEL_H) && (iFlags & ADMIN_BAN)) ? 1:0;
    iVip = (iFlags & ADMIN_LEVEL_H) ? 1:0;
    iAdmin = (iFlags & ADMIN_BAN) ? 1:0;

    if (iSuperAdmin)
    {
        client_print_color(0, taskid, "%L", LANG_PLAYER, "SUPER_CONNECT_CHAT", s_Name);
        set_dhudmessage(51, 153, 255, -1.0, 0.13, 0, 6.0, 5.0)
        show_dhudmessage( 0 , "%L" , LANG_PLAYER , "SUPER_CONNECT_HUD" , s_Name );
    }
    else if (iVipAdmin)
    {
        client_print_color(0, taskid, "%L", LANG_PLAYER, "VIP_ADMIN_CONNECT_CHAT", s_Name);

        set_dhudmessage(0, 255, 0, -1.0, 0.13, 0, 6.0, 5.0)
        show_dhudmessage( 0 , "%L" , LANG_PLAYER , "VIP_ADMIN_CONNECT_HUD" , s_Name );
    }
    else if(iVip)
    {
        client_print_color( 0 , taskid , "%L" , LANG_PLAYER , "VIP_CONNECT_CHAT" , s_Name );
    
        set_dhudmessage(205, 102, 0, -1.0, 0.13, 0, 6.0, 5.0)
        show_dhudmessage( 0 , "%L" , LANG_PLAYER , "VIP_CONNECT_HUD" , s_Name );
    }
    else if (iAdmin)
    {
        client_print_color( 0 , taskid , "%L" , LANG_PLAYER , "ADMIN_CONNECT_CHAT" , s_Name );
    
        set_dhudmessage(255, 255, 0, -1.0, 0.13, 0, 6.0, 5.0)
        show_dhudmessage( 0 , "%L" , LANG_PLAYER , "ADMIN_CONNECT_HUD" , s_Name );
    }
    else if(get_user_flags(taskid) & ADMIN_LEVEL_G)
    {   
        client_print_color( 0 , taskid , "%L" , LANG_PLAYER , "WOMEN_CONNECT_CHAT" , s_Name );
    
        set_dhudmessage(153, 51, 153, -1.0, 0.13, 0, 6.0, 5.0)
        show_dhudmessage( 0 , "%L" , LANG_PLAYER , "WOMEN_CONNECT_HUD" , s_Name );
    }

    if( strlen( gs_serverdata[connect_sound] ) > 0 )
        client_cmd( 0 , "; spk %s" , gs_serverdata[connect_sound] );

    return 1;
}

public WP_Spawn_Post( id )
{
    if( !is_user_connected( id ) )
        return -1;

    if( gi_PLAccessData[id][access_startitems] )
    {
        give_item( id , "weapon_hegrenade" );
        give_item( id , "weapon_flashbang" );
        give_item( id , "weapon_flashbang" );
        give_item( id , "weapon_smokegrenade" );

        cs_set_user_armor( id , 100 , CS_ARMOR_VESTHELM )

        if(user_has_weapon(id, CSW_DEAGLE)) cs_set_user_bpammo( id , CSW_DEAGLE , 35 );
        else
        {
            WP_DropWeapons(id, 2);

            give_item(id, "weapon_deagle");
            cs_set_user_bpammo( id , CSW_DEAGLE , 35 );
        }
    }

    if( gi_PLAccessData[id][access_model] && (strlen(gs_serverdata[model_t]) > 0 && strlen(gs_serverdata[model_ct]) > 0 ) )
        set_task( 0.1 , "ChangePlayerModel" , id );

    if( gi_PLAccessData[id][access_viptag] )
        set_task( 0.5 , "SetVipData" , id );

    return 1;
}

public SetVipData( taskid )
{
    message_begin( MSG_ALL , get_user_msgid("ScoreAttrib" ) )
    write_byte( taskid );
    write_byte( 4 );
    message_end( );
}

public ChangePlayerModel( taskid )
{
    cs_set_user_model( taskid , gs_serverdata[get_user_team(taskid) == 1 ? model_t:model_ct] );
    fm_cs_set_user_model_index( taskid , get_user_team( taskid ) == 1 ? gs_serverdata[model_index_t]:gs_serverdata[model_index_ct] );
}

public EventDeathMsg( )
{
    static attacker;

    attacker = read_data( 1 );
    
    if( gs_serverdata[vampire_enable] && gi_PLAccessData[attacker][access_damager] )
    {
        static i_Health;
        i_Health = get_user_health( attacker ) + gs_serverdata[vampire_hp];

        if( is_user_connected( attacker ) )
            set_user_health( attacker , i_Health > gs_serverdata[vampire_max] ? gs_serverdata[vampire_max]:i_Health );
    }

    if( gs_serverdata[money_enable] && gi_PLAccessData[attacker][access_money] && is_user_connected( attacker ) )
    {
        static i_Money;

        i_Money = cs_get_user_money( attacker ) + gs_serverdata[money];
        cs_set_user_money( attacker , clamp( i_Money , 0 , 16000 ) , 1 );
    }

    if( gi_PLAccessData[attacker][access_screen_fade] )
        ShowKillEffect( attacker , random_num( 0 , 255 ) , random_num( 0 , 255 ) , random_num( 0 , 255 ) );

    return PLUGIN_HANDLED;
}

ShowKillEffect( id , red , green , blue , alpha = 75)
{
    message_begin(MSG_ONE_UNRELIABLE, gs_serverdata[screen_fade_msgid], .player = id)
    write_short(1<<10)
    write_short(1<<10)
    write_short(0x0000)
    write_byte(red)
    write_byte(green)
    write_byte(blue)
    write_byte(alpha)
    message_end()
}

public plugin_precache( )
{
    load_data_from_file( );
    new s_Text[64];

    if( strlen( gs_serverdata[model_t] ) > 0 )
    {
        formatex( s_Text , charsmax( s_Text ) , "models/player/%s/%s.mdl" , gs_serverdata[model_t] , gs_serverdata[model_t] );
        gs_serverdata[model_index_t] = engfunc( EngFunc_PrecacheModel , s_Text );
    }

    if( strlen( gs_serverdata[model_ct] ) > 0 )
    {   
        formatex( s_Text , charsmax( s_Text ) , "models/player/%s/%s.mdl" , gs_serverdata[model_ct] , gs_serverdata[model_ct] );
        gs_serverdata[model_index_ct] = engfunc( EngFunc_PrecacheModel , s_Text );
    }

    if( strlen( gs_serverdata[connect_sound] ) > 0 )
        engfunc( EngFunc_PrecacheSound , gs_serverdata[connect_sound] );
}

public load_data_from_file( )
{
    new s_File[192];

    get_localinfo( "amxx_configsdir" , s_File , charsmax( s_File ) );
    format( s_File , charsmax( s_File ) , "%s/weaponmenu.ini" , s_File );

    if( !file_exists( s_File ) )
    {
        log_amx( "Can't find configuration file" );
        return PLUGIN_HANDLED;
    }

    new i_File = fopen( s_File , "rt" );
    if( !i_File )
    {
        log_amx( "Can't open file: %s" , s_File );
        return PLUGIN_HANDLED;
    }

    AccessModel = ArrayCreate(1);
    AccessMoney = ArrayCreate(1);
    AccessStartItems = ArrayCreate(1);
    AccessVipTag = ArrayCreate(1);
    AccessWPMenu = ArrayCreate(1);
    AccessVampire = ArrayCreate(1);
    AccessDamager = ArrayCreate(1);
    AccessScreenFade = ArrayCreate(1);

    new s_Text[1024], s_Value[960], s_Key[64];
    while( !feof( i_File ) )
    {
        fgets( i_File , s_Text , charsmax( s_Text ) );
        trim( s_Text );

        if( s_Text[ 0 ] == ';' || s_Text[ 0 ] == '#' || s_Text[ 0 ] == '/' || !strlen( s_Text ) )
        {
            continue;
        }

        strtok( s_Text , s_Key , charsmax( s_Key ) , s_Value , charsmax( s_Value ) , '=' );

        trim( s_Key );
        trim( s_Value );

        if( equal( s_Key , "FLAG MODEL" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);
                
                ArrayPushCell(AccessModel, read_flags(s_Key));
            }
        }
        else if( equal( s_Key , "FLAG VAMPIRE" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);

                ArrayPushCell(AccessVampire, read_flags(s_Key));
            }
        }
        else if( equal( s_Key , "FLAG MONEY" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);

                ArrayPushCell(AccessMoney, read_flags(s_Key));
            }
        }
        else if( equal( s_Key , "FLAG START ITEMS" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);

                ArrayPushCell(AccessStartItems, read_flags(s_Key));
            }
        }
        else if( equal( s_Key ,  "FLAG VIP TAG" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);

                ArrayPushCell(AccessVipTag, read_flags(s_Key));
            }
        }
        else if( equal( s_Key , "FLAG WP MENU" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);

                ArrayPushCell(AccessWPMenu, read_flags(s_Key));
            }
        }
        else if( equal( s_Key , "WP MENU ENABLE" ) )
            gs_serverdata[wp_menu_enable] = str_to_num( s_Value ) == 1 ? true:false;
        else if( equal( s_Key , "WP MENU ROUND" ) )
            gs_serverdata[wp_menu_round] = str_to_num( s_Value );
        else if( equal( s_Key , "FLAG DAMAGER" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);

                ArrayPushCell(AccessDamager, read_flags(s_Key));
            }
        }
        else if( equal( s_Key , "FLAG SCREEN FADE" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);

                ArrayPushCell(AccessScreenFade, read_flags(s_Key));
            }
        }
        else if( equal( s_Key , "VIP T MODEL" ) )
        {
            trim( s_Value );
            copy( gs_serverdata[model_t] , 63 , s_Value );
        }
        else if( equal( s_Key , "VIP CT MODEL" ) )
        {
            trim( s_Value );
            copy( gs_serverdata[model_ct] , 63 , s_Value );
        }
        else if( equal( s_Key , "KILL MONEY ENABLE" ) )
            gs_serverdata[money_enable] = str_to_num( s_Value ) == 1 ? true:false;
        else if( equal( s_Key , "KILL MONEY" ) )
            gs_serverdata[money] = str_to_num( s_Value );
        else if( equal( s_Key , "VAMPIRE ENABLE" ) )
            gs_serverdata[vampire_enable] = str_to_num( s_Value ) == 1 ? true:false;
        else if( equal( s_Key , "VAMPIRE HP" ) )
            gs_serverdata[vampire_hp] = str_to_num( s_Value );
        else if( equal( s_Key , "VAMPIRE MAX" ) )
            gs_serverdata[vampire_max] = str_to_num( s_Value );
        else if( equal( s_Key , "CONNECT SOUND" ) )
            copy( gs_serverdata[connect_sound] , 63 , s_Value );
    }

    return fclose( i_File );
}

public WP_RoundStart( )
{
    new sPlayers[32];
    new iCount, index;

    get_players( sPlayers, iCount, "ach" );
    for(new id = 0; id < iCount; id++)
    {
        index = sPlayers[id];
        switch( index )
        {
            case 1..8:set_task( 0.1 , "WP_Spawn_Post", index );
            case 9..16:set_task( 0.2 , "WP_Spawn_Post", index );
            case 17..24:set_task( 0.3 , "WP_Spawn_Post", index );
            case 25..32:set_task( 0.4 , "WP_Spawn_Post", index );
        }
    }

    arrayset( gb_WeaponChoosed , false , 33 );
    g_iRoundNumber++;
}

public WP_RoundRestart( )
{
    g_iRoundNumber = 0;
}

public WP_GeneralMenu( id )
{
    if( !gs_serverdata[wp_menu_enable] )
    {
        client_print_color( id , print_chat ,  "^1%L" , id , "WP_MENU_DISABLE" );
        return PLUGIN_HANDLED;
    }

    if( !gi_PLAccessData[id][access_wpmenu] )
    {
        client_print_color( id , print_chat , "^1%L" , id ,"NO_ACC" );
        return PLUGIN_HANDLED;
    }

    if( gb_WeaponChoosed[id] )
    {
        client_print_color( id , print_chat , "^1%L" , id , "ALREADY_CHOOSED" );
        return PLUGIN_HANDLED;
    }

    if( g_iRoundNumber > gs_serverdata[wp_menu_round] )
    {
        menu_display( id , gi_WPMenuIndex );
    }
    else
    {
        client_print_color( id , print_chat , "^1%L" , id ,"NO_ROUND" , gs_serverdata[wp_menu_round] )
    }

    return PLUGIN_HANDLED;
}

public WP_MenuFuncWeapons( id , menu , item )
{
    if( item == MENU_EXIT )
    {
        return -1;
    }

    new s_Key[3];
    new i_Data;

    menu_item_getinfo( menu , item , i_Data , s_Key , charsmax( s_Key ) , .callback = i_Data );
    item = s_Key[0];

    WP_DropWeapons( id , 1 );   
    gb_WeaponChoosed[id] = true;

    give_item( id , g_sEntNames[ item ] );
    cs_set_user_bpammo( id , get_weaponid( g_sEntNames[ item ] ) , g_iAmmoWP[item] );

    return PLUGIN_HANDLED;
}

stock WP_DropWeapons(id, drop)
{
    static s_Weapons[32], s_Name[32];
    static i_Num, index, i;

    i_Num = 0;
    get_user_weapons(id, s_Weapons, i_Num);

    for(i = 1; i < i_Num; i++)
    {
        index = s_Weapons[i];
        if( (1<<index) & PRIMARY_WEAPONS_BIT_SUM && drop == 1 || (1<<index) & SECONDARY_WEAPONS_BIT_SUM && drop == 2 )
        {
            get_weaponname(index, s_Name, charsmax(s_Name));
            engclient_cmd(id, "drop", s_Name);

            set_pev(id, pev_weapons, pev(id, pev_weapons) & ~(1<<index));
        }
    }
}

// Set the precached model index (updates hitboxes server side)
stock fm_cs_set_user_model_index(id, value)
{
    set_pdata_int(id, OFFSET_MODELINDEX, value, OFFSET_LINUX)
}
[DOUBLEPOST=1511903822][/DOUBLEPOST]To be or not to be, Нет Цвета в чате . должно быть Цветное сообщения в чате
 

BalbuR

Пользователь
Регистрация
26 Июл 2017
Сообщения
131
Симпатии
25
Пол
Мужской
у него client_print_color не срабатывает нормально
не знаю в чем причина
 

spanjbob4ik

Пользователь
Регистрация
27 Сен 2017
Сообщения
17
Симпатии
0
To be or not to be,
Код:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <fakemeta>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "Weapon Admin Menu"
#define VERSION "0.1"
#define AUTHOR "Nesquik"

new Array:AccessModel, Array:AccessMoney, Array:AccessStartItems,
Array:AccessVipTag, Array:AccessWPMenu, Array:AccessVampire,
Array:AccessDamager, Array:AccessScreenFade;

enum _: admin_data
{
    model_t[64],
    model_ct[64],
    model_index_t,
    model_index_ct,
    bool:money_enable,
    money,
    vampire_enable,
    vampire_hp,
    vampire_max,
    wp_menu_round,
    bool:wp_menu_enable,
    screen_fade_msgid,
    connect_sound[64]
}

enum _: pl_data
{
    bool:access_model, // +
    bool:access_money, // +
    bool:access_startitems, // +
    bool:access_viptag, //
    bool:access_wpmenu, // +
    bool:access_vampire, // +
    bool:access_damager, //
    bool:access_screen_fade, // +
}

new bool:gi_PLAccessData[33][pl_data];

new const g_sItemNames[][] =
{
    "WP_AK47",
    "WP_M4A1",
    "WP_FAMAS",
    "WP_AWP",
    "WP_SCOUT",
    "WP_AUG",
    "WP_M249",
    "WP_GALIL"
};

new const g_sEntNames[][] =
{
    "weapon_ak47",
    "weapon_m4a1" ,
    "weapon_famas",
    "weapon_awp",
    "weapon_scout",
    "weapon_aug",
    "weapon_m249",
    "weapon_galil"
}

new gs_serverdata[ admin_data ];
new const g_iAmmoWP[] = {90, 90, 90, 30, 90, 90, 200, 90}

new g_iRoundNumber;
new bool:gb_WeaponChoosed[33];

const OFFSET_LINUX = 5
const OFFSET_MODELINDEX = 491 // Orangutanz

const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)

new Float:gf_TaskJoin, g_MsgSync;
new gi_WPMenuIndex;

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)

    register_clcmd( "say /adminka" , "WP_Adminka" );

    register_event( "Damage" , "WP_TakeDamage_Post" , "b", "2!0", "3=0", "4!0" );
    register_clcmd( "weaponmenu" , "WP_GeneralMenu" );

    gs_serverdata[screen_fade_msgid] = get_user_msgid( "ScreenFade" );

    register_logevent( "WP_RoundStart" , 2, "1=Round_Start" );
    register_event( "DeathMsg" , "EventDeathMsg" , "1!0" );
    register_event( "TextMsg", "WP_RoundRestart" , "a" , "2=#Game_commencing" , "2=#Game_will_restart_in" );

    register_dictionary( "weaponmenu.txt" );

    g_MsgSync = CreateHudSyncObj( );

    WP_BuildWeaponMenu( );

    gf_TaskJoin = 1.0
}

public WP_BuildWeaponMenu()
{
    new s_Text[96], s_Key[3];
    new i_Size;

    i_Size = charsmax( s_Text );

    formatex( s_Text , charsmax( s_Text ) , "%L" , LANG_PLAYER , "WP_TITLE" );
    gi_WPMenuIndex = menu_create( s_Text , "WP_MenuFuncWeapons" );

    for( new i = 0; i < sizeof g_sItemNames; i++ )
    {
        s_Key[0] = i;

        formatex( s_Text , i_Size , "%L" , LANG_PLAYER , g_sItemNames[i] );
        menu_additem( gi_WPMenuIndex , s_Text , s_Key );
    }

    formatex( s_Text , i_Size , "%L" , LANG_PLAYER , "MENU_EXIT" );
    menu_setprop( gi_WPMenuIndex , MPROP_EXITNAME , s_Text );

    formatex( s_Text , i_Size , "%L" , LANG_PLAYER , "MENU_BACK" );
    menu_setprop( gi_WPMenuIndex , MPROP_BACKNAME , s_Text );

    formatex( s_Text , i_Size , "%L" , LANG_PLAYER , "MENU_NEXT" );
    menu_setprop( gi_WPMenuIndex , MPROP_NEXTNAME , s_Text );
}

public WP_Adminka( id )
    show_motd( id , "Buy Admin" , "adminka.txt" );

public WP_TakeDamage_Post( id )
{
    static damage, pid;
    damage = read_data(2);

    if( gi_PLAccessData[id][access_damager] )
    {
        set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1);
        ShowSyncHudMsg(id, g_MsgSync, "%d", damage);
    }

    pid = get_user_attacker(id);
    if( is_user_connected(pid) )
    {
        if( gi_PLAccessData[pid][access_damager] )
        {
            set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, 1);
            ShowSyncHudMsg(pid, g_MsgSync, "%d", damage);
        }
    }
}

public client_putinserver( id )
{
    RemoveAccessData(id);

    if( !is_user_bot( id ) && !is_user_hltv( id ) )
        set_task( gf_TaskJoin , "taskJoin" , id );
}

public RemoveAccessData(id)
{
    for(new i = access_model; i <= access_screen_fade; i++)
        gi_PLAccessData[id][i] = false;
}

public StartCheckPlayerAccess(id)
{
    new flags = get_user_flags(id);
    new index;

    for(index = 0; index < ArraySize(AccessModel); index++)
    {
        if(flags & ArrayGetCell(AccessModel, index))
        {
            gi_PLAccessData[id][access_model] = true
            break;
        }
        else
        {
            continue;
        }
    }

    for(index = 0; index < ArraySize(AccessMoney); index++)
    {
        if(flags & ArrayGetCell(AccessMoney, index))
        {
            gi_PLAccessData[id][access_money] = true;
            break;
        }
        else
        {
            continue;
        }
    }

    for(index = 0; index < ArraySize(AccessStartItems); index++)
    {
        if(flags & ArrayGetCell(AccessStartItems, index))
        {
            gi_PLAccessData[id][access_startitems] = true;
            break;
        }
        else
        {
            continue;
        }
    }

    for(index = 0; index < ArraySize(AccessVipTag); index++)
    {
        if(flags & ArrayGetCell(AccessVipTag, index))
        {
            gi_PLAccessData[id][access_viptag] = true;
            break;
        }
        else
        {
            continue;
        }
    }

    for(index = 0; index < ArraySize(AccessWPMenu); index++)
    {
        if(flags & ArrayGetCell(AccessWPMenu, index))
        {
            gi_PLAccessData[id][access_wpmenu] = true;
            break;
        }
        else
        {
            continue;
        }
    }

    for(index = 0; index < ArraySize(AccessVampire); index++)
    {
        if(flags & ArrayGetCell(AccessVampire, index))
        {
            gi_PLAccessData[id][access_vampire] = true;
            break;
        }
        else
        {
            continue;
        }
    }

    for(index = 0; index < ArraySize(AccessScreenFade); index++)
    {
        if(flags & ArrayGetCell(AccessScreenFade, index))
        {
            gi_PLAccessData[id][access_screen_fade] = true;
            break;
        }
        else
        {
            continue;
        }
    }

    for(index = 0; index < ArraySize(AccessDamager); index++)
    {
        if(flags & ArrayGetCell(AccessDamager, index))
        {
            gi_PLAccessData[id][access_damager] = true;
            break;
        }
        else
        {
            continue;
        }
    }
}

public taskJoin( taskid )
{
    if( !is_user_admin( taskid ) )
        return PLUGIN_HANDLED;

    new s_Name[32], iSuperAdmin, iVipAdmin, iVip, iAdmin, iFlags;

    get_user_name( taskid , s_Name , charsmax( s_Name ) );
    StartCheckPlayerAccess(taskid);

    iFlags = get_user_flags(taskid);
    iSuperAdmin = ((iFlags & ADMIN_LEVEL_H) && (iFlags & ADMIN_BAN) && (iFlags & ADMIN_RCON)) ? 1:0;
    iVipAdmin = ((iFlags & ADMIN_LEVEL_H) && (iFlags & ADMIN_BAN)) ? 1:0;
    iVip = (iFlags & ADMIN_LEVEL_H) ? 1:0;
    iAdmin = (iFlags & ADMIN_BAN) ? 1:0;

    if (iSuperAdmin)
    {
        client_print_color(0, taskid, "%L", LANG_PLAYER, "SUPER_CONNECT_CHAT", s_Name);
        set_dhudmessage(51, 153, 255, -1.0, 0.13, 0, 6.0, 5.0)
        show_dhudmessage( 0 , "%L" , LANG_PLAYER , "SUPER_CONNECT_HUD" , s_Name );
    }
    else if (iVipAdmin)
    {
        client_print_color(0, taskid, "%L", LANG_PLAYER, "VIP_ADMIN_CONNECT_CHAT", s_Name);

        set_dhudmessage(0, 255, 0, -1.0, 0.13, 0, 6.0, 5.0)
        show_dhudmessage( 0 , "%L" , LANG_PLAYER , "VIP_ADMIN_CONNECT_HUD" , s_Name );
    }
    else if(iVip)
    {
        client_print_color( 0 , taskid , "%L" , LANG_PLAYER , "VIP_CONNECT_CHAT" , s_Name );
   
        set_dhudmessage(205, 102, 0, -1.0, 0.13, 0, 6.0, 5.0)
        show_dhudmessage( 0 , "%L" , LANG_PLAYER , "VIP_CONNECT_HUD" , s_Name );
    }
    else if (iAdmin)
    {
        client_print_color( 0 , taskid , "%L" , LANG_PLAYER , "ADMIN_CONNECT_CHAT" , s_Name );
   
        set_dhudmessage(255, 255, 0, -1.0, 0.13, 0, 6.0, 5.0)
        show_dhudmessage( 0 , "%L" , LANG_PLAYER , "ADMIN_CONNECT_HUD" , s_Name );
    }
    else if(get_user_flags(taskid) & ADMIN_LEVEL_G)
    {  
        client_print_color( 0 , taskid , "%L" , LANG_PLAYER , "WOMEN_CONNECT_CHAT" , s_Name );
   
        set_dhudmessage(153, 51, 153, -1.0, 0.13, 0, 6.0, 5.0)
        show_dhudmessage( 0 , "%L" , LANG_PLAYER , "WOMEN_CONNECT_HUD" , s_Name );
    }

    if( strlen( gs_serverdata[connect_sound] ) > 0 )
        client_cmd( 0 , "; spk %s" , gs_serverdata[connect_sound] );

    return 1;
}

public WP_Spawn_Post( id )
{
    if( !is_user_connected( id ) )
        return -1;

    if( gi_PLAccessData[id][access_startitems] )
    {
        give_item( id , "weapon_hegrenade" );
        give_item( id , "weapon_flashbang" );
        give_item( id , "weapon_flashbang" );
        give_item( id , "weapon_smokegrenade" );

        cs_set_user_armor( id , 100 , CS_ARMOR_VESTHELM )

        if(user_has_weapon(id, CSW_DEAGLE)) cs_set_user_bpammo( id , CSW_DEAGLE , 35 );
        else
        {
            WP_DropWeapons(id, 2);

            give_item(id, "weapon_deagle");
            cs_set_user_bpammo( id , CSW_DEAGLE , 35 );
        }
    }

    if( gi_PLAccessData[id][access_model] && (strlen(gs_serverdata[model_t]) > 0 && strlen(gs_serverdata[model_ct]) > 0 ) )
        set_task( 0.1 , "ChangePlayerModel" , id );

    if( gi_PLAccessData[id][access_viptag] )
        set_task( 0.5 , "SetVipData" , id );

    return 1;
}

public SetVipData( taskid )
{
    message_begin( MSG_ALL , get_user_msgid("ScoreAttrib" ) )
    write_byte( taskid );
    write_byte( 4 );
    message_end( );
}

public ChangePlayerModel( taskid )
{
    cs_set_user_model( taskid , gs_serverdata[get_user_team(taskid) == 1 ? model_t:model_ct] );
    fm_cs_set_user_model_index( taskid , get_user_team( taskid ) == 1 ? gs_serverdata[model_index_t]:gs_serverdata[model_index_ct] );
}

public EventDeathMsg( )
{
    static attacker;

    attacker = read_data( 1 );
   
    if( gs_serverdata[vampire_enable] && gi_PLAccessData[attacker][access_damager] )
    {
        static i_Health;
        i_Health = get_user_health( attacker ) + gs_serverdata[vampire_hp];

        if( is_user_connected( attacker ) )
            set_user_health( attacker , i_Health > gs_serverdata[vampire_max] ? gs_serverdata[vampire_max]:i_Health );
    }

    if( gs_serverdata[money_enable] && gi_PLAccessData[attacker][access_money] && is_user_connected( attacker ) )
    {
        static i_Money;

        i_Money = cs_get_user_money( attacker ) + gs_serverdata[money];
        cs_set_user_money( attacker , clamp( i_Money , 0 , 16000 ) , 1 );
    }

    if( gi_PLAccessData[attacker][access_screen_fade] )
        ShowKillEffect( attacker , random_num( 0 , 255 ) , random_num( 0 , 255 ) , random_num( 0 , 255 ) );

    return PLUGIN_HANDLED;
}

ShowKillEffect( id , red , green , blue , alpha = 75)
{
    message_begin(MSG_ONE_UNRELIABLE, gs_serverdata[screen_fade_msgid], .player = id)
    write_short(1<<10)
    write_short(1<<10)
    write_short(0x0000)
    write_byte(red)
    write_byte(green)
    write_byte(blue)
    write_byte(alpha)
    message_end()
}

public plugin_precache( )
{
    load_data_from_file( );
    new s_Text[64];

    if( strlen( gs_serverdata[model_t] ) > 0 )
    {
        formatex( s_Text , charsmax( s_Text ) , "models/player/%s/%s.mdl" , gs_serverdata[model_t] , gs_serverdata[model_t] );
        gs_serverdata[model_index_t] = engfunc( EngFunc_PrecacheModel , s_Text );
    }

    if( strlen( gs_serverdata[model_ct] ) > 0 )
    {  
        formatex( s_Text , charsmax( s_Text ) , "models/player/%s/%s.mdl" , gs_serverdata[model_ct] , gs_serverdata[model_ct] );
        gs_serverdata[model_index_ct] = engfunc( EngFunc_PrecacheModel , s_Text );
    }

    if( strlen( gs_serverdata[connect_sound] ) > 0 )
        engfunc( EngFunc_PrecacheSound , gs_serverdata[connect_sound] );
}

public load_data_from_file( )
{
    new s_File[192];

    get_localinfo( "amxx_configsdir" , s_File , charsmax( s_File ) );
    format( s_File , charsmax( s_File ) , "%s/weaponmenu.ini" , s_File );

    if( !file_exists( s_File ) )
    {
        log_amx( "Can't find configuration file" );
        return PLUGIN_HANDLED;
    }

    new i_File = fopen( s_File , "rt" );
    if( !i_File )
    {
        log_amx( "Can't open file: %s" , s_File );
        return PLUGIN_HANDLED;
    }

    AccessModel = ArrayCreate(1);
    AccessMoney = ArrayCreate(1);
    AccessStartItems = ArrayCreate(1);
    AccessVipTag = ArrayCreate(1);
    AccessWPMenu = ArrayCreate(1);
    AccessVampire = ArrayCreate(1);
    AccessDamager = ArrayCreate(1);
    AccessScreenFade = ArrayCreate(1);

    new s_Text[1024], s_Value[960], s_Key[64];
    while( !feof( i_File ) )
    {
        fgets( i_File , s_Text , charsmax( s_Text ) );
        trim( s_Text );

        if( s_Text[ 0 ] == ';' || s_Text[ 0 ] == '#' || s_Text[ 0 ] == '/' || !strlen( s_Text ) )
        {
            continue;
        }

        strtok( s_Text , s_Key , charsmax( s_Key ) , s_Value , charsmax( s_Value ) , '=' );

        trim( s_Key );
        trim( s_Value );

        if( equal( s_Key , "FLAG MODEL" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);
               
                ArrayPushCell(AccessModel, read_flags(s_Key));
            }
        }
        else if( equal( s_Key , "FLAG VAMPIRE" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);

                ArrayPushCell(AccessVampire, read_flags(s_Key));
            }
        }
        else if( equal( s_Key , "FLAG MONEY" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);

                ArrayPushCell(AccessMoney, read_flags(s_Key));
            }
        }
        else if( equal( s_Key , "FLAG START ITEMS" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);

                ArrayPushCell(AccessStartItems, read_flags(s_Key));
            }
        }
        else if( equal( s_Key ,  "FLAG VIP TAG" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);

                ArrayPushCell(AccessVipTag, read_flags(s_Key));
            }
        }
        else if( equal( s_Key , "FLAG WP MENU" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);

                ArrayPushCell(AccessWPMenu, read_flags(s_Key));
            }
        }
        else if( equal( s_Key , "WP MENU ENABLE" ) )
            gs_serverdata[wp_menu_enable] = str_to_num( s_Value ) == 1 ? true:false;
        else if( equal( s_Key , "WP MENU ROUND" ) )
            gs_serverdata[wp_menu_round] = str_to_num( s_Value );
        else if( equal( s_Key , "FLAG DAMAGER" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);

                ArrayPushCell(AccessDamager, read_flags(s_Key));
            }
        }
        else if( equal( s_Key , "FLAG SCREEN FADE" ) )
        {
            while(s_Value[0] != 0 && strtok(s_Value, s_Key, charsmax(s_Key), s_Value, charsmax(s_Value), ','))
            {
                trim(s_Key);
                trim(s_Value);

                ArrayPushCell(AccessScreenFade, read_flags(s_Key));
            }
        }
        else if( equal( s_Key , "VIP T MODEL" ) )
        {
            trim( s_Value );
            copy( gs_serverdata[model_t] , 63 , s_Value );
        }
        else if( equal( s_Key , "VIP CT MODEL" ) )
        {
            trim( s_Value );
            copy( gs_serverdata[model_ct] , 63 , s_Value );
        }
        else if( equal( s_Key , "KILL MONEY ENABLE" ) )
            gs_serverdata[money_enable] = str_to_num( s_Value ) == 1 ? true:false;
        else if( equal( s_Key , "KILL MONEY" ) )
            gs_serverdata[money] = str_to_num( s_Value );
        else if( equal( s_Key , "VAMPIRE ENABLE" ) )
            gs_serverdata[vampire_enable] = str_to_num( s_Value ) == 1 ? true:false;
        else if( equal( s_Key , "VAMPIRE HP" ) )
            gs_serverdata[vampire_hp] = str_to_num( s_Value );
        else if( equal( s_Key , "VAMPIRE MAX" ) )
            gs_serverdata[vampire_max] = str_to_num( s_Value );
        else if( equal( s_Key , "CONNECT SOUND" ) )
            copy( gs_serverdata[connect_sound] , 63 , s_Value );
    }

    return fclose( i_File );
}

public WP_RoundStart( )
{
    new sPlayers[32];
    new iCount, index;

    get_players( sPlayers, iCount, "ach" );
    for(new id = 0; id < iCount; id++)
    {
        index = sPlayers[id];
        switch( index )
        {
            case 1..8:set_task( 0.1 , "WP_Spawn_Post", index );
            case 9..16:set_task( 0.2 , "WP_Spawn_Post", index );
            case 17..24:set_task( 0.3 , "WP_Spawn_Post", index );
            case 25..32:set_task( 0.4 , "WP_Spawn_Post", index );
        }
    }

    arrayset( gb_WeaponChoosed , false , 33 );
    g_iRoundNumber++;
}

public WP_RoundRestart( )
{
    g_iRoundNumber = 0;
}

public WP_GeneralMenu( id )
{
    if( !gs_serverdata[wp_menu_enable] )
    {
        client_print_color( id , print_chat ,  "^1%L" , id , "WP_MENU_DISABLE" );
        return PLUGIN_HANDLED;
    }

    if( !gi_PLAccessData[id][access_wpmenu] )
    {
        client_print_color( id , print_chat , "^1%L" , id ,"NO_ACC" );
        return PLUGIN_HANDLED;
    }

    if( gb_WeaponChoosed[id] )
    {
        client_print_color( id , print_chat , "^1%L" , id , "ALREADY_CHOOSED" );
        return PLUGIN_HANDLED;
    }

    if( g_iRoundNumber > gs_serverdata[wp_menu_round] )
    {
        menu_display( id , gi_WPMenuIndex );
    }
    else
    {
        client_print_color( id , print_chat , "^1%L" , id ,"NO_ROUND" , gs_serverdata[wp_menu_round] )
    }

    return PLUGIN_HANDLED;
}

public WP_MenuFuncWeapons( id , menu , item )
{
    if( item == MENU_EXIT )
    {
        return -1;
    }

    new s_Key[3];
    new i_Data;

    menu_item_getinfo( menu , item , i_Data , s_Key , charsmax( s_Key ) , .callback = i_Data );
    item = s_Key[0];

    WP_DropWeapons( id , 1 );  
    gb_WeaponChoosed[id] = true;

    give_item( id , g_sEntNames[ item ] );
    cs_set_user_bpammo( id , get_weaponid( g_sEntNames[ item ] ) , g_iAmmoWP[item] );

    return PLUGIN_HANDLED;
}

stock WP_DropWeapons(id, drop)
{
    static s_Weapons[32], s_Name[32];
    static i_Num, index, i;

    i_Num = 0;
    get_user_weapons(id, s_Weapons, i_Num);

    for(i = 1; i < i_Num; i++)
    {
        index = s_Weapons[i];
        if( (1<<index) & PRIMARY_WEAPONS_BIT_SUM && drop == 1 || (1<<index) & SECONDARY_WEAPONS_BIT_SUM && drop == 2 )
        {
            get_weaponname(index, s_Name, charsmax(s_Name));
            engclient_cmd(id, "drop", s_Name);

            set_pev(id, pev_weapons, pev(id, pev_weapons) & ~(1<<index));
        }
    }
}

// Set the precached model index (updates hitboxes server side)
stock fm_cs_set_user_model_index(id, value)
{
    set_pdata_int(id, OFFSET_MODELINDEX, value, OFFSET_LINUX)
}
[DOUBLEPOST=1511903822][/DOUBLEPOST]To be or not to be, Нет Цвета в чате . должно быть Цветное сообщения в чате
вот и хорошо я тебе же упоминул
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу