Помогите вырезать Лишнее из плагина

Сообщения
37
Реакции
2
Предупреждения
100
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Всем привет, помогите вырезать пожалуйста , say /adminka , vipka , Админ модели, DAMAGER , Хочу сделать плагин как можно
15 Янв 2018
Код:
#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];

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

    new const SUPER_ADMIN_FLAGS = ADMIN_BAN | ADMIN_RCON | ADMIN_LEVEL_H;
    new const WOMEN_ADMIN_FLAGS = ADMIN_BAN | ADMIN_LEVEL_G;
    new const VIP_ADMIN_FLAGS = ADMIN_BAN | ADMIN_LEVEL_H;
    new const WOMEN_VIP_FLAGS = ADMIN_LEVEL_H | ADMIN_LEVEL_G;

    new iFlags = get_user_flags(taskid);
    new bool:isSuperAdmin = bool:((iFlags & SUPER_ADMIN_FLAGS) == SUPER_ADMIN_FLAGS);
    new bool:isVipAdmin = bool:((iFlags & VIP_ADMIN_FLAGS) == VIP_ADMIN_FLAGS);
    new bool:isWomenAdmin = bool:((iFlags & WOMEN_ADMIN_FLAGS) == WOMEN_ADMIN_FLAGS);
    new bool:isWomenVip = bool:((iFlags & WOMEN_VIP_FLAGS) == WOMEN_VIP_FLAGS);
    new bool:isAdmin = bool:(iFlags & ADMIN_BAN);
    new bool:isVip = bool:(iFlags & ADMIN_LEVEL_H);
    new bool:isWomen = bool:(iFlags & ADMIN_LEVEL_G);

    if (isSuperAdmin)
    {
        ChatColor(0, "%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(isWomenAdmin)
    {   
        ChatColor(0, "%L" , LANG_PLAYER , "WOMEN_ADMIN_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_ADMIN_CONNECT_HUD" , s_Name );
    }
    else if (isVipAdmin)
    {
        ChatColor(0, "%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 (isWomenVip)
    {
        ChatColor(0, "%L", LANG_PLAYER, "VIP_WOMEN_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_WOMEN_CONNECT_HUD" , s_Name );
    }
    else if (isAdmin)
    {
        ChatColor(0, "%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(isVip)
    {
        ChatColor(0, "%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(isWomen)
    {   
        ChatColor(0, "%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] )
    {
        ChatColor( id ,  "%L" , id , "WP_MENU_DISABLE" );
        return PLUGIN_HANDLED;
    }

    if( !gi_PLAccessData[id][access_wpmenu] )
    {
        ChatColor( id , "%L" , id ,"NO_ACC" );
        return PLUGIN_HANDLED;
    }

    if( gb_WeaponChoosed[id] )
    {
        ChatColor( id , "%L" , id , "ALREADY_CHOOSED" );
        return PLUGIN_HANDLED;
    }

    if( g_iRoundNumber > gs_serverdata[wp_menu_round] )
    {
        menu_display( id , gi_WPMenuIndex );
    }
    else
    {
        ChatColor( id , "^%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)
}

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, "!t", "^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[i]))
            {
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
                write_byte(players[i]);
                write_string(msg);
                message_end();
            }
        }
    }
}
 

Вложения

Сообщения
43
Реакции
14
Помог
3 раз(а)
gyka4, Зачем вырезать? Плагины же по отдельности эти все есть adminka vip damager, и админ модели тоже есть плагин custom models вроде как называется
 
Сообщения
258
Реакции
262
Помог
5 раз(а)
gyka4, где ваши попытки вырезать лишний код самостоятельно? Либо напрягитесь сами для себя же, либо заказывайте услугу за ваши средства вот тут.
 
  • Нравится
Реакции: REVO
Сообщения
37
Реакции
2
Предупреждения
100
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
keter, мне нужно weaponmenu а то что я прошу вырезать , оно мне не нужно !!
 
Сообщения
2,751
Реакции
3,016
Помог
61 раз(а)
gyka4, снизьте тон. И прочьтите зелёноую табличку сверху.
 
  • Нравится
Реакции: REVO
Сообщения
37
Реакции
2
Предупреждения
100
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
wopox1337, вы что то перепутали , я его не повышал , Я просто сказал то что человек не понял)
 
Сообщения
957
Реакции
1,185
Помог
52 раз(а)
gyka4, так и все же, где попытки самостоятельного редактирования кода? Где описание ошибок? Где логи? Или Вам почудилось что это раздел "То же что и покупка, но нахаляву"?
 
  • Нравится
Реакции: REVO
Сообщения
2,491
Реакции
2,794
Помог
61 раз(а)
Код:
#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:AccessMoney, Array:AccessStartItems,
Array:AccessVipTag, Array:AccessWPMenu, Array:AccessVampire, Array:AccessScreenFade;

enum _: admin_data
{
    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_money, // +
    bool:access_startitems, // +
    bool:access_viptag, //
    bool:access_wpmenu, // +
    bool:access_vampire, // +
    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;
new gi_WPMenuIndex;

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

    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" );

    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 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_money; 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(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;
        }
    }
}

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

    new s_Name[32];

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

    new const SUPER_ADMIN_FLAGS = ADMIN_BAN | ADMIN_RCON | ADMIN_LEVEL_H;
    new const WOMEN_ADMIN_FLAGS = ADMIN_BAN | ADMIN_LEVEL_G;
    new const VIP_ADMIN_FLAGS = ADMIN_BAN | ADMIN_LEVEL_H;
    new const WOMEN_VIP_FLAGS = ADMIN_LEVEL_H | ADMIN_LEVEL_G;

    new iFlags = get_user_flags(taskid);
    new bool:isSuperAdmin = bool:((iFlags & SUPER_ADMIN_FLAGS) == SUPER_ADMIN_FLAGS);
    new bool:isVipAdmin = bool:((iFlags & VIP_ADMIN_FLAGS) == VIP_ADMIN_FLAGS);
    new bool:isWomenAdmin = bool:((iFlags & WOMEN_ADMIN_FLAGS) == WOMEN_ADMIN_FLAGS);
    new bool:isWomenVip = bool:((iFlags & WOMEN_VIP_FLAGS) == WOMEN_VIP_FLAGS);
    new bool:isAdmin = bool:(iFlags & ADMIN_BAN);
    new bool:isVip = bool:(iFlags & ADMIN_LEVEL_H);
    new bool:isWomen = bool:(iFlags & ADMIN_LEVEL_G);

    if (isSuperAdmin)
    {
        ChatColor(0, "%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(isWomenAdmin)
    {   
        ChatColor(0, "%L" , LANG_PLAYER , "WOMEN_ADMIN_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_ADMIN_CONNECT_HUD" , s_Name );
    }
    else if (isVipAdmin)
    {
        ChatColor(0, "%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 (isWomenVip)
    {
        ChatColor(0, "%L", LANG_PLAYER, "VIP_WOMEN_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_WOMEN_CONNECT_HUD" , s_Name );
    }
    else if (isAdmin)
    {
        ChatColor(0, "%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(isVip)
    {
        ChatColor(0, "%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(isWomen)
    {   
        ChatColor(0, "%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_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 EventDeathMsg( )
{
    static attacker;

    attacker = read_data( 1 );
    
    if( gs_serverdata[vampire_enable] && gi_PLAccessData[attacker][access_vampire] )
    {
        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( );

    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;
    }
    
    AccessMoney = ArrayCreate(1);
    AccessStartItems = ArrayCreate(1);
    AccessVipTag = ArrayCreate(1);
    AccessWPMenu = ArrayCreate(1);
    AccessVampire = 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 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 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 , "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] )
    {
        ChatColor( id ,  "%L" , id , "WP_MENU_DISABLE" );
        return PLUGIN_HANDLED;
    }

    if( !gi_PLAccessData[id][access_wpmenu] )
    {
        ChatColor( id , "%L" , id ,"NO_ACC" );
        return PLUGIN_HANDLED;
    }

    if( gb_WeaponChoosed[id] )
    {
        ChatColor( id , "%L" , id , "ALREADY_CHOOSED" );
        return PLUGIN_HANDLED;
    }

    if( g_iRoundNumber > gs_serverdata[wp_menu_round] )
    {
        menu_display( id , gi_WPMenuIndex );
    }
    else
    {
        ChatColor( id , "^%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)
}

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, "!t", "^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[i]))
            {
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
                write_byte(players[i]);
                write_string(msg);
                message_end();
            }
        }
    }
}
 
Сообщения
37
Реакции
2
Предупреждения
100
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
fantom, fantom, Большое спасибо тебе за помощь , а че за ошибка подскажи пожалуйста)
 

Вложения

Сообщения
94
Реакции
64
Помог
5 раз(а)
человек просит вырезать лишнее при этом даже не пробовал компилировать перед этим ) а если по теме, то не хватает в папке include нужного dhudmessage.inc если я не ошибаюсь. Или в исходник вначале добавь #include <dhudmessage>
 
Сообщения
37
Реакции
2
Предупреждения
100
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Dager, та как то работало и без этого "#include <dhudmessage>" но спасибо за ответ , всё работает)
 
Сообщения
2,143
Реакции
1,225
Помог
44 раз(а)
gyka4, если amxmodx версии 1.8.2, то нужно подключить библиотеку dhudmessage, т.к. в коде используются нативы с этой библиотеки. Но, если версия 1.8.3, то ничего не нужно подключать, т.к. данные нативы были впилены в библиотеку amxmodx. Но, я по магическому шару могу определить, что у вас 1.8.2 версия и есть 2 выхода из ситуации:
1) Подключить библиотеку dhudmessage
2) Переименовать нативы с dhud, на деффолтный hud (+аргументы поправить).
 
Сообщения
37
Реакции
2
Предупреждения
100
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Minni, Я ужее сделал ,спасибо )
 

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

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