Статус темы:
Закрыта.
  1. pm-04 Пользователь

    Регистрация:
    02.02.16
    Сообщения:
    603
    Симпатии:
    79
    Пол:
    Мужской
    Вот исходник
    PHP:
    #include <amxmodx>
    #include <amxmisc>
    #include <cstrike>
    #include <fun>
    #include <fakemeta>
    #include <fakemeta_util>
    #include <hamsandwich>
    #include <dhudmessage>
    #define PLUGIN "IDEAL VIP by Ba/lePa"
    #define VERSION "3.2"
    #define AUTHOR "Ba/lePa"
    #define VIP_TAG (1<<2)            // vip в таблицу
    #define vip_flag ADMIN_LEVEL_H      // флаг доступа
    #define music // Если звук при входе админа не нужен, то поставьте // перед #define
    #define MAX_TEXT_LENGTH                200
    #define MAX_NAME_LENGTH                40
    #pragma semicolon 1
    new bool:g_bBlockMap;
    new 
    g_Roundg_iWeapon[33], g_iVip ;
    new 
    g_iPlayerBomb[33] = false;
    new 
    cvar_connectcvar_redcvar_greencvar_blueFloatcvar_xFloatcvar_y;
    new 
    cvar_prefix;
    new 
    cvar_roundcvar_opencvar_showcvar_chatcvar_pistolscvar_funkcvar_tab;
    new 
    cvar_healthcvar_health_headcvar_health_max;
    new 
    cvar_moneycvar_money_head;
    new 
    cvar_music;
    new 
    cvar_damagecvar_hudsek;
    new 
    vip_opened[33];
    new 
    g_iMaxPlayers 0;
    new 
    msgSayText;
    new 
    g_iPistols[6] = {CSW_USPCSW_GLOCK18CSW_ELITECSW_FIVESEVENCSW_P228CSW_DEAGLE};
    new 
    boolg_Chosen[33] = false;
    new 
    string[32];
    new 
    hud;
    public 
    plugin_precache(){
       if(
    IsBlockMap())
       {
          
    g_bBlockMap true;
          return;
       }
       
       
    #if defined(music)
          
    precache_sound("IDEAL_VIP/ideal_sound.wav");
       
    #endif
    }
    public 
    plugin_init(){     
       
    register_plugin(PLUGINVERSIONAUTHOR);
           
       if(
    g_bBlockMap)
          
    server_cmd("amxx pause IDEAL_VIP.amxx");
       
       
    register_dictionary("ideal_vip.txt");
       
       
    g_iMaxPlayers get_maxplayers();
       
       
    register_message(get_user_msgid"ScoreAttrib" ), "msgScoreAttrib");
       
       
    register_event("HLTV""EventRoundStart""a""1=0""2=0");
       
    register_event("TextMsg""EventRoundRestart""a""2=#Game_will_restart_in","2=#Game_Commencing");
       
    register_event("Damage""EventDamage""b""2!0""3=0""4!0");
       
       
    RegisterHam(Ham_Killed"player""HamPlayerKilled_Post"1);
       
    RegisterHam(Ham_Spawn"player""HamSpawn_Post"1);
       
    register_clcmd("say /vipmenu""MainMenu");
       
    register_clcmd("say_team /vipmenu""MainMenu");
       
       
    register_clcmd("say /vip_menu""MainMenu");
       
    register_clcmd("say_team /vip_menu""MainMenu");
       
       
    register_clcmd("vipmenu""MainMenu");
       
       
    register_clcmd("say /vips""vip_online");
       
    register_clcmd("say_team /vips""vip_online");
       
       
    register_clcmd("say /adminka""admin_motd");
       
    register_clcmd("say_team /adminka""admin_motd");
       
       
    register_clcmd("say /vipka""vip_motd");
       
    register_clcmd("say_team /vipka""vip_motd");
       
       
    msgSayText get_user_msgid("SayText");
       
    hud CreateHudSyncObj();
    }
    public 
    plugin_cfg(){
       new 
    szConfigDir[128];
       
       
    get_localinfo("amxx_configsdir"szConfigDircharsmax(szConfigDir));
       
       
    server_cmd("exec %s/ideal_vip.cfg"szConfigDir);
       
       
    cvar_round          =    get_pcvar_num(register_cvar("amx_vipround""2"));
       
    cvar_open          =    get_pcvar_num(register_cvar("amx_vipzaround""8"));
       
    cvar_show          =    get_pcvar_num(register_cvar("amx_vipshow","1"));
       
    cvar_chat          =    get_pcvar_num(register_cvar("amx_chatshow""0"));
       
    cvar_pistols       =    get_pcvar_num(register_cvar("amx_vipautopistols""1"));
       
    cvar_funk          =    get_pcvar_num(register_cvar("amx_vipautoset""1"));
       
    cvar_health       =    get_pcvar_num(register_cvar("amx_viphealth""0"));
       
    cvar_health_head    =    get_pcvar_num(register_cvar("amx_viphealth_head""0"));
       
    cvar_health_max    =    get_pcvar_num(register_cvar("amx_viphealth_max""100"));
       
    cvar_money          =    get_pcvar_num(register_cvar("amx_vipmoney""0"));
       
    cvar_money_head    =    get_pcvar_num(register_cvar("amx_vipmoney_head""0"));
       
    cvar_tab         =   get_pcvar_num(register_cvar("amx_viptab""1"));
       
    cvar_connect       =   get_pcvar_num(register_cvar("amx_showconnect""1"));
       
    cvar_red         =   get_pcvar_num(register_cvar("amx_vipRED""100"));
       
    cvar_green         =   get_pcvar_num(register_cvar("amx_vipGREEN""100"));
       
    cvar_blue         =   get_pcvar_num(register_cvar("amx_vipBLUE""100"));
       
    cvar_x            =   get_pcvar_float(register_cvar("amx_vipXcoord""-1.0"));
       
    cvar_y            =   get_pcvar_float(register_cvar("amx_vipYcoord""0.6"));
       
    cvar_prefix         =   register_cvar("amx_vip_prefix""!y[!gVIP!y]");
       
    #if defined(music)
          
    cvar_music         =   get_pcvar_num(register_cvar("amx_vipMusic""1"));
       
    #endif
       
    cvar_damage         =   get_pcvar_num(register_cvar("amx_vipdamager""1"));
       
    cvar_hudsek         =   get_pcvar_num(register_cvar("amx_viphudsek""5.0"));
       
       
    get_pcvar_string(cvar_prefixstringcharsmax(string));
    }
    public 
    admin_motd(idlevelcid){
       if(!
    cmd_access(idlevelcid1))
          return 
    PLUGIN_CONTINUE;
           
       
    show_motd(id"adminka.txt""Как купить админку");
       
       return 
    PLUGIN_CONTINUE;
    }
    public 
    vip_motd(idlevelcid){
       if(!
    cmd_access(idlevelcid1))
          return 
    PLUGIN_CONTINUE;
           
       
    show_motd(id"vipka.txt""Как купить випку");
       
       return 
    PLUGIN_CONTINUE;
    }
    public 
    client_putinserver(id){
       
    client_cmd(id"bind ^"F5^" ^"vipmenu^"");
       
    g_iWeapon[id] = 0;
       
       if(
    IsUserCool(id))
          
    set_task(0.5"vip_connect"id 132);
    }
    public 
    client_disconnect(id){
       
    g_iWeapon[id] = 0;
       
    g_Chosen[id] = false;
    }
    public 
    vip_connect(TASKID){
       new 
    id TASKID 132;
       
       
    #if defined(music)
          
    if(cvar_music)
             
    client_cmd(0"spk IDEAL_VIP/ideal_sound.wav");
       
    #endif
       
       
    new name[32]; get_user_name(idnamecharsmax(name));
       
       switch(
    cvar_connect)
       {
          case 
    1:
          {
             
    ChatColor(0"%L"id"VIP_CONNECT"stringname);   
          }
          case 
    2:
          {
             
    set_hudmessage(cvar_redcvar_greencvar_bluecvar_xcvar_y00.05.00.00.0, -1);
             
    show_hudmessage(0"%L"id"VIP_CONNECT1"name);
          }
          case 
    3:
          {
             
    set_dhudmessage(cvar_redcvar_greencvar_bluecvar_xcvar_y00.05.00.00.0false);
             
    show_dhudmessage(0"%L"id"VIP_CONNECT1"name);
          }
          case 
    4:
          {
             
    ChatColor(0"%L"id"VIP_CONNECT"string,  name);
             
             
    set_hudmessage(cvar_redcvar_greencvar_bluecvar_xcvar_y00.05.00.00.0, -1);
             
    show_hudmessage(0"%L"id"VIP_CONNECT1"name);
          }
          case 
    5:
          {
             
    ChatColor(0"%L"id"VIP_CONNECT"string,  name);
             
             
    set_dhudmessage(cvar_redcvar_greencvar_bluecvar_xcvar_y00.05.00.00.0false);
             
    show_dhudmessage(0"%L"id"VIP_CONNECT1"name);         
          }
       }
    }
           
    public 
    EventRoundStart() g_Round++;   
    public 
    EventRoundRestart() g_Round 0;
       
    public 
    EventDamage(id){
       if(
    cvar_damage == 0)
          return;
       
       if(!
    is_user_connected(id))
          return;
       
       new 
    iVictim id;
       new 
    iKiller get_user_attacker(id);
       
       if(
    iVictim == iKiller)
          return;
       
       if(!
    IsUserCool(iKiller) && !IsUserCool(iVictim))
          return;
           
       if(
    get_user_team(iKiller) == get_user_team(iVictim))
          return;
       
       new 
    iDamage read_data(2);
       
       if(
    iDamage <= 0)
          return;
       
       if(
    IsUserCool(iVictim))
       {
          
    set_hudmessage(255000.60.500.0float(cvar_hudsek), 0.00.01);
          
    ShowSyncHudMsg(iVictimhud"%d"iDamage);
       }
       if(
    IsUserCool(iKiller))
       {
          
    set_hudmessage(01002550.40.500.0float(cvar_hudsek), 0.00.02);
          
    ShowSyncHudMsg(iKillerhud"%d"iDamage);
       }
    }   
       
    public 
    HamSpawn_Post(id){
       
    g_iPlayerBomb[id] = false;
       
    vip_opened[id] = 0;
       
       if(
    IsUserCool(id))
       {
          if(
    g_Round == 0FirstMenu(id);
             
          if(
    is_user_alive(id))
          {
             if(
    cvar_funk == 1task_funk(id);
             
             if(
    cvar_show == && g_Round >= cvar_roundMainMenu(id);
          }
       }
    }
    public 
    HamPlayerKilled_Post(iVictimiKillercorpse){
       static const 
    m_LastHitGroup 75;
       
       if(
    IsUserCool(iVictim))
          if(!
    g_Chosen[iVictim])
             
    set_task(1.0"FirstMenu"iVictim);
             
       if(
    IsUserCool(iKiller))
       {
          if(
    is_user_alive(iKiller))
          {
             if( 
    get_pdata_intiVictimm_LastHitGroup ) == HIT_HEAD)
             {
                
    set_user_health(iKillerget_user_health(iKiller) + cvar_health_head);
                if(
    get_user_health(iKiller) > cvar_health_max)
                   
    set_user_health(iKillercvar_health_max);
                
    cs_set_user_money(iKillercs_get_user_money(iKiller) + cvar_money_head);
             }
             else
             {
                
    set_user_health(iKillerget_user_health(iKiller) + cvar_health);
                if(
    get_user_health(iKiller) > cvar_health_max)
                   
    set_user_health(iKillercvar_health_max);
                
    cs_set_user_money(iKillercs_get_user_money(iKiller) + cvar_money);
             }
          }
       }
    }
    public 
    task_funk(id){
       
    give_item(id"weapon_knife");
       
    give_item(id"item_thighpack");
       
    give_item(id"weapon_hegrenade");
       
    give_item(id"weapon_flashbang");
       
    give_item(id"weapon_flashbang");
       
    give_item(id"weapon_smokegrenade");
       
    give_item(id"item_assaultsuit");
       
       if(
    g_iPlayerBomb[id])
       {
          
    fm_give_item(id"weapon_c4");
          
    cs_set_user_plant(id);
          
    g_iPlayerBomb[id] = false;
       }
       
       if(
    cvar_pistols)
       {
          for(new 
    06i++) fm_strip_user_gun(idg_iPistols[i]);
             
          switch(
    g_iWeapon[id])
          {
             case 
    0:
             {
                
    FirstMenu(id);
             }
             case 
    1:
             {
                
    give_item(id"weapon_deagle");
                
    cs_set_user_bpammo(idCSW_DEAGLE35);
             }
             case 
    2:
             {
                
    give_item(id"weapon_usp");
                
    cs_set_user_bpammo(idCSW_USP100);
             }
             case 
    3:
             {
                
    give_item(id"weapon_glock18");
                
    cs_set_user_bpammo(idCSW_GLOCK18120);
             }
          }
       }
    }
    public 
    MainMenu(id){
       if(
    IsUserCool(id))
       {
          if(
    is_user_alive(id))
          {
             if(
    vip_opened[id] < cvar_open || cvar_open == 0)
             {
                if(
    g_Round >= cvar_round)
                {
                   new 
    szTitle[64], szName[32], szPistol[32], szMenuMulti[64];               
                   
    get_user_name(idszNamecharsmax(szName));
                   
                   switch(
    g_iWeapon[id])
                   {
                      case 
    0szPistol "NONE";
                      case 
    1szPistol "Deagle";
                      case 
    2szPistol "Usp";
                      case 
    3szPistol "Glock";
                   }
                   
                   
    formatex(szTitlecharsmax(szTitle), "%L"id"VIP_MENU"szName);     
                   new 
    i_Menu menu_create(szTitle"MainMenu_Handler"1);
             
                   
    formatex(szMenuMulticharsmax(szMenuMulti), "%L"id"ITEM_MENU1"szPistol);
                   
    menu_additem(i_MenuszMenuMulti"1"0);
                   
                   
    formatex(szMenuMulticharsmax(szMenuMulti), "%L"id"ITEM_MENU2"szPistol);
                   
    menu_additem(i_MenuszMenuMulti"2"0);
                   
                   
    formatex(szMenuMulticharsmax(szMenuMulti), "%L"id"ITEM_MENU3"szPistol);
                   
    menu_additem(i_MenuszMenuMulti"3"0);
                   
                   
    formatex(szMenuMulticharsmax(szMenuMulti), "%L"id"ITEM_MENU4"szPistol);
                   
    menu_additem(i_MenuszMenuMulti"4"0);
                   
                   
    formatex(szMenuMulticharsmax(szMenuMulti), "%L"id"ITEM_MENU5"szPistol);
                   
    menu_additem(i_MenuszMenuMulti"5"0);
             
                   
    menu_addblank(i_Menu0);
                   
                   
    formatex(szMenuMulticharsmax(szMenuMulti), "%L"id"ITEM_MENU6");
                   
    menu_additem(i_MenuszMenuMulti"6"0);
                   
                   
    menu_addblank(i_Menu1);
                   
    menu_setprop(i_MenuMPROP_EXITNAME"Выход");
                   
    menu_display(idi_Menu0);   
                }
                else
                {               
                   if(
    cvar_round == 2)     
                   {
                      
    ChatColor(id"%L"id"VIP_WARNING5"stringcvar_round);
                      return 
    PLUGIN_HANDLED;
                   }
                   else
                   {
                      
    ChatColor(id"%L"id"VIP_WARNING1"stringcvar_round);
                      return 
    PLUGIN_HANDLED;
                   }
                }
             }
             else
                
    ChatColor(id"%L"id"VIP_WARNING2"string);
          }
          else
             
    ChatColor(id"%L"id"VIP_WARNING3"string);
       }
       else
          
    ChatColor(id"%L"id"VIP_WARNING4"string);
           
       return 
    PLUGIN_HANDLED;
    }
    public 
    MainMenu_Handler(idiMenuitem){
       if(
    item == MENU_EXIT)
       {
          
    menu_destroy(iMenu);
           
          return 
    PLUGIN_HANDLED;
       }
       
       new 
    szData[6], szName[60], iAccessiCallback;
       
    menu_item_getinfo(iMenuitemiAccessszDatacharsmax(szData), szNamecharsmax(szName), iCallback);
       
    get_user_name(idszNamecharsmax(szName));
       
       new 
    iKey str_to_num(szData);       
       switch(
    iKey)
       {
          case 
    1:
          {
             
    vip_opened[id]++;
             if(
    user_has_weapon(idCSW_C4))
                
    g_iPlayerBomb[id] = true;
                 
             
    strip_user_weapons(id);
             
    task_funk(id);
             switch(
    g_iWeapon[id])
             {
                case 
    0:
                {
                   
    FirstMenu(id);
                }           
                case 
    1:
                {
                   
    give_item(id"weapon_deagle");
                   
    cs_set_user_bpammo(idCSW_DEAGLE35);
                }
                case 
    2:
                {   
                   
    give_item(id"weapon_usp");
                   
    cs_set_user_bpammo(idCSW_USP100);
                }
                case 
    3:
                {
                   
    give_item(id"weapon_glock18");
                   
    cs_set_user_bpammo(idCSW_GLOCK18120);
                }
             }
             
             
    give_item(id"weapon_m4a1");
             
    cs_set_user_bpammo(idCSW_M4A190);
             
             if(
    cvar_chat == 1)
                
    ChatColor(0"%L"id"VIP_M4A1"stringszName);
          }
          case 
    2:
          {
             
    vip_opened[id]++;
             if(
    user_has_weapon(idCSW_C4))
                
    g_iPlayerBomb[id] = true;
             
    strip_user_weapons(id);
             
    task_funk(id);
             
             switch(
    g_iWeapon[id])
             {
                case 
    0:
                {
                   
    FirstMenu(id);
                }           
                case 
    1:
                {
                   
    give_item(id"weapon_deagle");
                   
    cs_set_user_bpammo(idCSW_DEAGLE35);
                }
                case 
    2:
                {   
                   
    give_item(id"weapon_usp");
                   
    cs_set_user_bpammo(idCSW_USP100);
                }
                case 
    3:
                {
                   
    give_item(id"weapon_glock18");
                   
    cs_set_user_bpammo(idCSW_GLOCK18120);
                }
             }
             
             
    give_item(id"weapon_ak47");
             
    cs_set_user_bpammo(idCSW_AK4790);
             
             if(
    cvar_chat == 1)
                
    ChatColor(0"%L"id"VIP_AK47"stringszName);         
          }
          case 
    3:
          {
             
    vip_opened[id]++;
             if(
    user_has_weapon(idCSW_C4))
                
    g_iPlayerBomb[id] = true;
             
    strip_user_weapons(id);
             
    task_funk(id);
             
             switch(
    g_iWeapon[id])
             {
                case 
    0:
                {
                   
    FirstMenu(id);
                }           
                case 
    1:
                {
                   
    give_item(id"weapon_deagle");
                   
    cs_set_user_bpammo(idCSW_DEAGLE35);
                }
                case 
    2:
                {   
                   
    give_item(id"weapon_usp");
                   
    cs_set_user_bpammo(idCSW_USP100);
                }
                case 
    3:
                {
                   
    give_item(id"weapon_glock18");
                   
    cs_set_user_bpammo(idCSW_GLOCK18120);
                }
             }
             
             
    give_item(id"weapon_awp");
             
    cs_set_user_bpammo(idCSW_AWP30);
             
             if(
    cvar_chat == 1)
                
    ChatColor(0"%L"id"VIP_AWP"stringszName);     
          }
          case 
    4:
          {
             
    vip_opened[id]++;
             if(
    user_has_weapon(idCSW_C4))
                
    g_iPlayerBomb[id] = true;
             
    strip_user_weapons(id);
             
    task_funk(id);
             
             switch(
    g_iWeapon[id])
             {
                case 
    0:
                {
                   
    FirstMenu(id);
                }           
                case 
    1:
                {
                   
    give_item(id"weapon_deagle");
                   
    cs_set_user_bpammo(idCSW_DEAGLE35);
                }
                case 
    2:
                {   
                   
    give_item(id"weapon_usp");
                   
    cs_set_user_bpammo(idCSW_USP100);
                }
                case 
    3:
                {
                   
    give_item(id"weapon_glock18");
                   
    cs_set_user_bpammo(idCSW_GLOCK18120);
                }
             }
             
             
    give_item(id"weapon_famas");
             
    cs_set_user_bpammo(idCSW_FAMAS90);
             
             if(
    cvar_chat == 1)
                
    ChatColor(0"%L"id"VIP_FAMAS"stringszName);   
          }
          case 
    5:
          {
             
    vip_opened[id]++;
             if(
    user_has_weapon(idCSW_C4))
                
    g_iPlayerBomb[id] = true;
             
    strip_user_weapons(id);
             
    task_funk(id);
             
             switch(
    g_iWeapon[id])
             {
                case 
    0:
                {
                   
    FirstMenu(id);
                }           
                case 
    1:
                {
                   
    give_item(id"weapon_deagle");
                   
    cs_set_user_bpammo(idCSW_DEAGLE35);
                }
                case 
    2:
                {   
                   
    give_item(id"weapon_usp");
                   
    cs_set_user_bpammo(idCSW_USP100);
                }
                case 
    3:
                {
                   
    give_item(id"weapon_glock18");
                   
    cs_set_user_bpammo(idCSW_GLOCK18120);
                }
             }
             
             
    give_item(id"weapon_scout");
             
    cs_set_user_bpammo(idCSW_SCOUT90);
             
             if(
    cvar_chat == 1)
                
    ChatColor(0"%L"id"VIP_SCOUT"stringszName);
          }     
          case 
    6:
          {
             
    FirstMenu(id);
          }
       }
       
       
    menu_destroy(iMenu);
       return 
    PLUGIN_HANDLED;
    }
    public 
    FirstMenu(id){
       if(!
    is_user_connected(id))
          return;
           
       new 
    i_Menu menu_create("\rЧто вы предпочитаете?""FirstMenu_Handler");
       
    menu_additem(i_Menu"\yDeagle""1"0);
       
    menu_additem(i_Menu"\yGlock""2"0);
       
    menu_additem(i_Menu"\rUsp""3"0);
       
       
       
    menu_setprop(i_MenuMPROP_EXITNAME"Выход");
       
    menu_display(idi_Menu0);
    }
    public 
    FirstMenu_Handler(idiMenuitem){
       if(
    item == MENU_EXIT)
       {
          
    menu_destroy(iMenu);
          return 
    PLUGIN_HANDLED;
       }
       
       new 
    szData[6], szName[60], iAccessiCallback;
       
       
    menu_item_getinfo(iMenuitemiAccessszDatacharsmax(szData), szNamecharsmax(szName), iCallback);
       
       new 
    iKey str_to_num(szData);
       
       for(new 
    06i++)
          
    fm_strip_user_gun(idg_iPistols[i]);
       
       switch(
    iKey)
       {
          case 
    1:
          {
             
    g_Chosen[id] = true;
             
    g_iWeapon[id] = 1;
             
    give_item(id"weapon_deagle");
             
    cs_set_user_bpammo(idCSW_DEAGLE35);
          }
          case 
    2:
          {
             
    g_Chosen[id] = true;
             
    g_iWeapon[id] = 3;
             
    give_item(id"weapon_glock18");
             
    cs_set_user_bpammo(idCSW_GLOCK18120);
          }
          case 
    3:
          {
             
    g_Chosen[id] = true;
             
    g_iWeapon[id] = 2;
             
    give_item(id"weapon_usp");
             
    cs_set_user_bpammo(idCSW_USP100);
          }
       }
       
       
    menu_destroy(iMenu);
       return 
    PLUGIN_CONTINUE;
    }
    public 
    msgScoreAttrib(const MsgId, const MsgType, const MsgDest){
       if(
    cvar_tab)
       {
          if(
    IsUserCool(get_msg_arg_int(1)) && !get_msg_arg_int(2))
             
    set_msg_arg_int(2ARG_BYTEVIP_TAG);
       }
    }
    public 
    vip_online(id){
       
    g_iVip 0;
       
       new 
    Lenmessage[512], name[32];
       new 
    iPlayer;
       for(
    iPlayer 1iPlayer <= g_iMaxPlayersiPlayer++)
       {
          if(
    IsUserCool(iPlayer))
          {
             
    g_iVip++;
             
    get_user_name(iPlayernamecharsmax(name));
             if(
    g_iVip == 1)
                
    Len += format(message[Len], 511 Len"%s"name);
             else
                
    Len += format(message[Len], 511 Len" , %s"name);
          }
       }
       if(
    g_iVip 1)
          
    ChatColor(id"%L"id"VIP_ONLINE"string);
       else
          
    ChatColor(id"%s: !t%s"stringmessage);
    }
    stock ChatColor(const id, const input[], any:...){
       new 
    iCount 1iPlayers[32];
       static 
    szMsg[191];
       
    vformat(szMsg190input3);
       
       
    replace_all(szMsg190"!g""^4"); // Green Color
       
    replace_all(szMsg190"!y""^1"); // Default Color
       
    replace_all(szMsg190"!t""^3"); // Team Color
       
       
    if (idiPlayers[0] = id; else get_players(iPlayersiCount"ch");
       {
          for(new 
    iPlayer 0iPlayer iCountiPlayer++ )
          {
             if( 
    is_user_connected(iPlayers[iPlayer]) )
             {
                
    message_begin(MSG_ONE_UNRELIABLEmsgSayText_iPlayers[iPlayer]);
                
    write_byte(iPlayers[iPlayer]);
                
    write_string(szMsg);
                
    message_end();
             }
          }
       }
    }
    stock IsBlockMap(){
       new 
    got_lineline_numlen;
       new 
    cfgdir[MAX_TEXT_LENGTH];
       new 
    cfgpath[MAX_TEXT_LENGTH];
       new 
    mapname[MAX_NAME_LENGTH];
       new 
    txt[MAX_TEXT_LENGTH];
       
    get_localinfo("amxx_configsdir"cfgdircharsmax(cfgdir));
       
    get_mapname(mapnameMAX_NAME_LENGTH-1);
       
    format(cfgpathMAX_TEXT_LENGTH"%s/ideal_block_maps.ini"cfgdir);
       if (
    file_exists(cfgpath))
       {
          
    got_line read_file(cfgpathline_numtxtMAX_TEXT_LENGTH-1len);
          while (
    got_line>0)
          {
             if (
    equali(txtmapname)) return 1;
             
    line_num++;
             
    got_line read_file(cfgpathline_numtxtMAX_TEXT_LENGTH-1len);
          }
       }
       return 
    0;
    }
    stock boolIsUserCool(const id){
       if(!
    is_user_connected(id))
          return 
    false;
       
       if((
    get_user_flags(id) & vip_flag))
          return 
    true;
           
       return 
    false;
    }
    Надо чтобы на закрытых картах не было amxx pause IDEAL_VIP.amxx а просто выводилось
    "На этой карте не действует VIP - меню"
     
  2. pm-04 Пользователь

    Регистрация:
    02.02.16
    Сообщения:
    603
    Симпатии:
    79
    Пол:
    Мужской
    Вроде сделал, поправьте если не то
    PHP:
    #include <amxmodx>
    #include <amxmisc>
    #include <cstrike>
    #include <fun>
    #include <fakemeta>
    #include <fakemeta_util>
    #include <hamsandwich>
    #include <dhudmessage>
    #define PLUGIN "IDEAL VIP by Ba/lePa"
    #define VERSION "3.2"
    #define AUTHOR "Ba/lePa"
    #define VIP_TAG (1<<2)            // vip в таблицу
    #define vip_flag ADMIN_LEVEL_H      // флаг доступа
    #define music // Если звук при входе админа не нужен, то поставьте // перед #define
    #define MAX_TEXT_LENGTH                200
    #define MAX_NAME_LENGTH                40
    #pragma semicolon 1
    new bool:g_bBlockMap;
    new 
    g_Roundg_iWeapon[33], g_iVip ;
    new 
    g_iPlayerBomb[33] = false;
    new 
    cvar_connectcvar_redcvar_greencvar_blueFloatcvar_xFloatcvar_y;
    new 
    cvar_prefix;
    new 
    cvar_roundcvar_opencvar_showcvar_chatcvar_pistolscvar_funkcvar_tab;
    new 
    cvar_healthcvar_health_headcvar_health_max;
    new 
    cvar_moneycvar_money_head;
    new 
    cvar_music;
    new 
    cvar_damagecvar_hudsek;
    new 
    vip_opened[33];
    new 
    g_iMaxPlayers 0;
    new 
    msgSayText;
    new 
    g_iPistols[6] = {CSW_USPCSW_GLOCK18CSW_ELITECSW_FIVESEVENCSW_P228CSW_DEAGLE};
    new 
    boolg_Chosen[33] = false;
    new 
    string[32];
    new 
    hud;
    public 
    plugin_precache(){
       if(
    IsBlockMap())
       {
          
    g_bBlockMap true;
          return;
       }
       
       
    #if defined(music)
          
    precache_sound("IDEAL_VIP/ideal_sound.wav");
       
    #endif
    }
    public 
    plugin_init(){     
       
    register_plugin(PLUGINVERSIONAUTHOR);
       
       
    register_dictionary("ideal_vip.txt");
       
       
    g_iMaxPlayers get_maxplayers();
       
       
    register_message(get_user_msgid"ScoreAttrib" ), "msgScoreAttrib");
       
       
    register_event("HLTV""EventRoundStart""a""1=0""2=0");
       
    register_event("TextMsg""EventRoundRestart""a""2=#Game_will_restart_in","2=#Game_Commencing");
       
    register_event("Damage""EventDamage""b""2!0""3=0""4!0");
       
       
    RegisterHam(Ham_Killed"player""HamPlayerKilled_Post"1);
       
    RegisterHam(Ham_Spawn"player""HamSpawn_Post"1);

       
    register_clcmd("say /vipmenu""MainMenu");
       
    register_clcmd("say_team /vipmenu""MainMenu");
       
       
    register_clcmd("say /vip_menu""MainMenu");
       
    register_clcmd("say_team /vip_menu""MainMenu");
       
       
    register_clcmd("vipmenu""MainMenu");
       
       
    register_clcmd("say /vips""vip_online");
       
    register_clcmd("say_team /vips""vip_online");
       
       
    register_clcmd("say /adminka""admin_motd");
       
    register_clcmd("say_team /adminka""admin_motd");
       
       
    register_clcmd("say /vipka""vip_motd");
       
    register_clcmd("say_team /vipka""vip_motd");
       
       
    msgSayText get_user_msgid("SayText");
       
    hud CreateHudSyncObj();
    }
    public 
    plugin_cfg(){
       new 
    szConfigDir[128];
       
       
    get_localinfo("amxx_configsdir"szConfigDircharsmax(szConfigDir));
       
       
    server_cmd("exec %s/ideal_vip.cfg"szConfigDir);
       
       
    cvar_round          =    get_pcvar_num(register_cvar("amx_vipround""2"));
       
    cvar_open          =    get_pcvar_num(register_cvar("amx_vipzaround""8"));
       
    cvar_show          =    get_pcvar_num(register_cvar("amx_vipshow","1"));
       
    cvar_chat          =    get_pcvar_num(register_cvar("amx_chatshow""0"));
       
    cvar_pistols       =    get_pcvar_num(register_cvar("amx_vipautopistols""1"));
       
    cvar_funk          =    get_pcvar_num(register_cvar("amx_vipautoset""1"));
       
    cvar_health       =    get_pcvar_num(register_cvar("amx_viphealth""0"));
       
    cvar_health_head    =    get_pcvar_num(register_cvar("amx_viphealth_head""0"));
       
    cvar_health_max    =    get_pcvar_num(register_cvar("amx_viphealth_max""100"));
       
    cvar_money          =    get_pcvar_num(register_cvar("amx_vipmoney""0"));
       
    cvar_money_head    =    get_pcvar_num(register_cvar("amx_vipmoney_head""0"));
       
    cvar_tab         =   get_pcvar_num(register_cvar("amx_viptab""1"));
       
    cvar_connect       =   get_pcvar_num(register_cvar("amx_showconnect""1"));
       
    cvar_red         =   get_pcvar_num(register_cvar("amx_vipRED""100"));
       
    cvar_green         =   get_pcvar_num(register_cvar("amx_vipGREEN""100"));
       
    cvar_blue         =   get_pcvar_num(register_cvar("amx_vipBLUE""100"));
       
    cvar_x            =   get_pcvar_float(register_cvar("amx_vipXcoord""-1.0"));
       
    cvar_y            =   get_pcvar_float(register_cvar("amx_vipYcoord""0.6"));
       
    cvar_prefix         =   register_cvar("amx_vip_prefix""!y[!gVIP!y]");
       
    #if defined(music)
          
    cvar_music         =   get_pcvar_num(register_cvar("amx_vipMusic""1"));
       
    #endif
       
    cvar_damage         =   get_pcvar_num(register_cvar("amx_vipdamager""1"));
       
    cvar_hudsek         =   get_pcvar_num(register_cvar("amx_viphudsek""5.0"));
       
       
    get_pcvar_string(cvar_prefixstringcharsmax(string));
    }
    public 
    admin_motd(idlevelcid){
       if(!
    cmd_access(idlevelcid1))
          return 
    PLUGIN_CONTINUE;
           
       
    show_motd(id"adminka.txt""Как купить админку");
       
       return 
    PLUGIN_CONTINUE;
    }
    public 
    vip_motd(idlevelcid){
       if(!
    cmd_access(idlevelcid1))
          return 
    PLUGIN_CONTINUE;
           
       
    show_motd(id"vipka.txt""Как купить випку");
       
       return 
    PLUGIN_CONTINUE;
    }
    public 
    client_putinserver(id){
       
    client_cmd(id"bind ^"F5^" ^"vipmenu^"");
       
    g_iWeapon[id] = 0;
       
       if(
    IsUserCool(id))
          
    set_task(0.5"vip_connect"id 132);
    }
    public 
    client_disconnect(id){
       
    g_iWeapon[id] = 0;
       
    g_Chosen[id] = false;
    }
    public 
    vip_connect(TASKID){
       new 
    id TASKID 132;
       
       
    #if defined(music)
          
    if(cvar_music)
             
    client_cmd(0"spk IDEAL_VIP/ideal_sound.wav");
       
    #endif
       
       
    new name[32]; get_user_name(idnamecharsmax(name));
       
       switch(
    cvar_connect)
       {
          case 
    1:
          {
             
    ChatColor(0"%L"id"VIP_CONNECT"stringname);   
          }
          case 
    2:
          {
             
    set_hudmessage(cvar_redcvar_greencvar_bluecvar_xcvar_y00.05.00.00.0, -1);
             
    show_hudmessage(0"%L"id"VIP_CONNECT1"name);
          }
          case 
    3:
          {
             
    set_dhudmessage(cvar_redcvar_greencvar_bluecvar_xcvar_y00.05.00.00.0false);
             
    show_dhudmessage(0"%L"id"VIP_CONNECT1"name);
          }
          case 
    4:
          {
             
    ChatColor(0"%L"id"VIP_CONNECT"string,  name);
             
             
    set_hudmessage(cvar_redcvar_greencvar_bluecvar_xcvar_y00.05.00.00.0, -1);
             
    show_hudmessage(0"%L"id"VIP_CONNECT1"name);
          }
          case 
    5:
          {
             
    ChatColor(0"%L"id"VIP_CONNECT"string,  name);
             
             
    set_dhudmessage(cvar_redcvar_greencvar_bluecvar_xcvar_y00.05.00.00.0false);
             
    show_dhudmessage(0"%L"id"VIP_CONNECT1"name);         
          }
       }
    }
           
    public 
    EventRoundStart() g_Round++;   
    public 
    EventRoundRestart() g_Round 0;
       
    public 
    EventDamage(id){
       if(
    cvar_damage == 0)
          return;
       
       if(!
    is_user_connected(id))
          return;
       
       new 
    iVictim id;
       new 
    iKiller get_user_attacker(id);
       
       if(
    iVictim == iKiller)
          return;
       
       if(!
    IsUserCool(iKiller) && !IsUserCool(iVictim))
          return;
           
       if(
    get_user_team(iKiller) == get_user_team(iVictim))
          return;
       
       new 
    iDamage read_data(2);
       
       if(
    iDamage <= 0)
          return;
       
       if(
    IsUserCool(iVictim))
       {
          
    set_hudmessage(255000.60.500.0float(cvar_hudsek), 0.00.01);
          
    ShowSyncHudMsg(iVictimhud"%d"iDamage);
       }
       if(
    IsUserCool(iKiller))
       {
          
    set_hudmessage(01002550.40.500.0float(cvar_hudsek), 0.00.02);
          
    ShowSyncHudMsg(iKillerhud"%d"iDamage);
       }
    }   
       
    public 
    HamSpawn_Post(id){
       
    g_iPlayerBomb[id] = false;
       
    vip_opened[id] = 0;
       
       if(
    IsUserCool(id))
       {
          if(
    g_Round == 0FirstMenu(id);
             
          if(
    is_user_alive(id))
          {
             if(
    cvar_funk == 1task_funk(id);
             
             if(
    cvar_show == && g_Round >= cvar_roundMainMenu(id);
          }
       }
    }
    public 
    HamPlayerKilled_Post(iVictimiKillercorpse){
       static const 
    m_LastHitGroup 75;
       
       if(
    IsUserCool(iVictim))
          if(!
    g_Chosen[iVictim])
             
    set_task(1.0"FirstMenu"iVictim);
             
       if(
    IsUserCool(iKiller))
       {
          if(
    is_user_alive(iKiller))
          {
             if( 
    get_pdata_intiVictimm_LastHitGroup ) == HIT_HEAD)
             {
                
    set_user_health(iKillerget_user_health(iKiller) + cvar_health_head);
                if(
    get_user_health(iKiller) > cvar_health_max)
                   
    set_user_health(iKillercvar_health_max);
                
    cs_set_user_money(iKillercs_get_user_money(iKiller) + cvar_money_head);
             }
             else
             {
                
    set_user_health(iKillerget_user_health(iKiller) + cvar_health);
                if(
    get_user_health(iKiller) > cvar_health_max)
                   
    set_user_health(iKillercvar_health_max);
                
    cs_set_user_money(iKillercs_get_user_money(iKiller) + cvar_money);
             }
          }
       }
    }
    public 
    task_funk(id){
       
    give_item(id"weapon_knife");
       
    give_item(id"item_thighpack");
       
    give_item(id"weapon_hegrenade");
       
    give_item(id"weapon_flashbang");
       
    give_item(id"weapon_flashbang");
       
    give_item(id"weapon_smokegrenade");
       
    give_item(id"item_assaultsuit");
       
       if(
    g_iPlayerBomb[id])
       {
          
    fm_give_item(id"weapon_c4");
          
    cs_set_user_plant(id);
          
    g_iPlayerBomb[id] = false;
       }
       
       if(
    cvar_pistols)
       {
          for(new 
    06i++) fm_strip_user_gun(idg_iPistols[i]);
             
          switch(
    g_iWeapon[id])
          {
             case 
    0:
             {
                
    FirstMenu(id);
             }
             case 
    1:
             {
                
    give_item(id"weapon_deagle");
                
    cs_set_user_bpammo(idCSW_DEAGLE35);
             }
             case 
    2:
             {
                
    give_item(id"weapon_usp");
                
    cs_set_user_bpammo(idCSW_USP100);
             }
             case 
    3:
             {
                
    give_item(id"weapon_glock18");
                
    cs_set_user_bpammo(idCSW_GLOCK18120);
             }
          }
       }
    }
    public 
    MainMenu(id){
        if(
    g_bBlockMap)
        {
            
    ChatColor(id"%L"id"VIP_WARNING6"string);
        }
        else
        {
            if(
    IsUserCool(id))
            {
              if(
    is_user_alive(id))
              {
                 if(
    vip_opened[id] < cvar_open || cvar_open == 0)
                 {
                    if(
    g_Round >= cvar_round)
                    {
                       new 
    szTitle[64], szName[32], szPistol[32], szMenuMulti[64];               
                       
    get_user_name(idszNamecharsmax(szName));
                       
                       switch(
    g_iWeapon[id])
                       {
                          case 
    0szPistol "NONE";
                          case 
    1szPistol "Deagle";
                          case 
    2szPistol "Usp";
                          case 
    3szPistol "Glock";
                       }
                       
                       
    formatex(szTitlecharsmax(szTitle), "%L"id"VIP_MENU"szName);     
                       new 
    i_Menu menu_create(szTitle"MainMenu_Handler"1);
                 
                       
    formatex(szMenuMulticharsmax(szMenuMulti), "%L"id"ITEM_MENU1"szPistol);
                       
    menu_additem(i_MenuszMenuMulti"1"0);
                       
                       
    formatex(szMenuMulticharsmax(szMenuMulti), "%L"id"ITEM_MENU2"szPistol);
                       
    menu_additem(i_MenuszMenuMulti"2"0);
                       
                       
    formatex(szMenuMulticharsmax(szMenuMulti), "%L"id"ITEM_MENU3"szPistol);
                       
    menu_additem(i_MenuszMenuMulti"3"0);
                       
                       
    formatex(szMenuMulticharsmax(szMenuMulti), "%L"id"ITEM_MENU4"szPistol);
                       
    menu_additem(i_MenuszMenuMulti"4"0);
                       
                       
    formatex(szMenuMulticharsmax(szMenuMulti), "%L"id"ITEM_MENU5"szPistol);
                       
    menu_additem(i_MenuszMenuMulti"5"0);
                 
                       
    menu_addblank(i_Menu0);
                       
                       
    formatex(szMenuMulticharsmax(szMenuMulti), "%L"id"ITEM_MENU6");
                       
    menu_additem(i_MenuszMenuMulti"6"0);
                       
                       
    menu_addblank(i_Menu1);
         
                       
    menu_setprop(i_MenuMPROP_EXITNAME"Выход");
                       
    menu_display(idi_Menu0);   
                    }
                    else
                    {               
                       if(
    cvar_round == 2)     
                       {
                          
    ChatColor(id"%L"id"VIP_WARNING5"stringcvar_round);
                          return 
    PLUGIN_HANDLED;
                       }
                       else
                       {
                          
    ChatColor(id"%L"id"VIP_WARNING1"stringcvar_round);
                          return 
    PLUGIN_HANDLED;
                       }
                    }
                 }
                 else
                    
    ChatColor(id"%L"id"VIP_WARNING2"string);
              }
              else
                 
    ChatColor(id"%L"id"VIP_WARNING3"string);
           }
            else
                
    ChatColor(id"%L"id"VIP_WARNING4"string);
        }     
        return 
    PLUGIN_HANDLED;
    }
    public 
    MainMenu_Handler(idiMenuitem){
       if(
    item == MENU_EXIT)
       {
          
    menu_destroy(iMenu);
           
          return 
    PLUGIN_HANDLED;
       }
       
       new 
    szData[6], szName[60], iAccessiCallback;
       
    menu_item_getinfo(iMenuitemiAccessszDatacharsmax(szData), szNamecharsmax(szName), iCallback);
       
    get_user_name(idszNamecharsmax(szName));
       
       new 
    iKey str_to_num(szData);       
       switch(
    iKey)
       {
          case 
    1:
          {
             
    vip_opened[id]++;
             if(
    user_has_weapon(idCSW_C4))
                
    g_iPlayerBomb[id] = true;
                 
             
    strip_user_weapons(id);
             
    task_funk(id);
             switch(
    g_iWeapon[id])
             {
                case 
    0:
                {
                   
    FirstMenu(id);
                }           
                case 
    1:
                {
                   
    give_item(id"weapon_deagle");
                   
    cs_set_user_bpammo(idCSW_DEAGLE35);
                }
                case 
    2:
                {   
                   
    give_item(id"weapon_usp");
                   
    cs_set_user_bpammo(idCSW_USP100);
                }
                case 
    3:
                {
                   
    give_item(id"weapon_glock18");
                   
    cs_set_user_bpammo(idCSW_GLOCK18120);
                }
             }
             
             
    give_item(id"weapon_m4a1");
             
    cs_set_user_bpammo(idCSW_M4A190);
             
             if(
    cvar_chat == 1)
                
    ChatColor(0"%L"id"VIP_M4A1"stringszName);
          }
          case 
    2:
          {
             
    vip_opened[id]++;
             if(
    user_has_weapon(idCSW_C4))
                
    g_iPlayerBomb[id] = true;
             
    strip_user_weapons(id);
             
    task_funk(id);
             
             switch(
    g_iWeapon[id])
             {
                case 
    0:
                {
                   
    FirstMenu(id);
                }           
                case 
    1:
                {
                   
    give_item(id"weapon_deagle");
                   
    cs_set_user_bpammo(idCSW_DEAGLE35);
                }
                case 
    2:
                {   
                   
    give_item(id"weapon_usp");
                   
    cs_set_user_bpammo(idCSW_USP100);
                }
                case 
    3:
                {
                   
    give_item(id"weapon_glock18");
                   
    cs_set_user_bpammo(idCSW_GLOCK18120);
                }
             }
             
             
    give_item(id"weapon_ak47");
             
    cs_set_user_bpammo(idCSW_AK4790);
             
             if(
    cvar_chat == 1)
                
    ChatColor(0"%L"id"VIP_AK47"stringszName);         
          }
          case 
    3:
          {
             
    vip_opened[id]++;
             if(
    user_has_weapon(idCSW_C4))
                
    g_iPlayerBomb[id] = true;
             
    strip_user_weapons(id);
             
    task_funk(id);
             
             switch(
    g_iWeapon[id])
             {
                case 
    0:
                {
                   
    FirstMenu(id);
                }           
                case 
    1:
                {
                   
    give_item(id"weapon_deagle");
                   
    cs_set_user_bpammo(idCSW_DEAGLE35);
                }
                case 
    2:
                {   
                   
    give_item(id"weapon_usp");
                   
    cs_set_user_bpammo(idCSW_USP100);
                }
                case 
    3:
                {
                   
    give_item(id"weapon_glock18");
                   
    cs_set_user_bpammo(idCSW_GLOCK18120);
                }
             }
             
             
    give_item(id"weapon_awp");
             
    cs_set_user_bpammo(idCSW_AWP30);
             
             if(
    cvar_chat == 1)
                
    ChatColor(0"%L"id"VIP_AWP"stringszName);     
          }
          case 
    4:
          {
             
    vip_opened[id]++;
             if(
    user_has_weapon(idCSW_C4))
                
    g_iPlayerBomb[id] = true;
             
    strip_user_weapons(id);
             
    task_funk(id);
             
             switch(
    g_iWeapon[id])
             {
                case 
    0:
                {
                   
    FirstMenu(id);
                }           
                case 
    1:
                {
                   
    give_item(id"weapon_deagle");
                   
    cs_set_user_bpammo(idCSW_DEAGLE35);
                }
                case 
    2:
                {   
                   
    give_item(id"weapon_usp");
                   
    cs_set_user_bpammo(idCSW_USP100);
                }
                case 
    3:
                {
                   
    give_item(id"weapon_glock18");
                   
    cs_set_user_bpammo(idCSW_GLOCK18120);
                }
             }
             
             
    give_item(id"weapon_famas");
             
    cs_set_user_bpammo(idCSW_FAMAS90);
             
             if(
    cvar_chat == 1)
                
    ChatColor(0"%L"id"VIP_FAMAS"stringszName);   
          }
          case 
    5:
          {
             
    vip_opened[id]++;
             if(
    user_has_weapon(idCSW_C4))
                
    g_iPlayerBomb[id] = true;
             
    strip_user_weapons(id);
             
    task_funk(id);
             
             switch(
    g_iWeapon[id])
             {
                case 
    0:
                {
                   
    FirstMenu(id);
                }           
                case 
    1:
                {
                   
    give_item(id"weapon_deagle");
                   
    cs_set_user_bpammo(idCSW_DEAGLE35);
                }
                case 
    2:
                {   
                   
    give_item(id"weapon_usp");
                   
    cs_set_user_bpammo(idCSW_USP100);
                }
                case 
    3:
                {
                   
    give_item(id"weapon_glock18");
                   
    cs_set_user_bpammo(idCSW_GLOCK18120);
                }
             }
             
             
    give_item(id"weapon_scout");
             
    cs_set_user_bpammo(idCSW_SCOUT90);
             
             if(
    cvar_chat == 1)
                
    ChatColor(0"%L"id"VIP_SCOUT"stringszName);
          }     
          case 
    6:
          {
             
    FirstMenu(id);
          }
       }
       
       
    menu_destroy(iMenu);
       return 
    PLUGIN_HANDLED;
    }
    public 
    FirstMenu(id){
       if(!
    is_user_connected(id))
          return;
           
       new 
    i_Menu menu_create("\rЧто вы предпочитаете?""FirstMenu_Handler");
       
    menu_additem(i_Menu"\yDeagle""1"0);
       
    menu_additem(i_Menu"\yGlock""2"0);
       
    menu_additem(i_Menu"\rUsp""3"0);
       
       
       
    menu_setprop(i_MenuMPROP_EXITNAME"Выход");
       
    menu_display(idi_Menu0);
    }
    public 
    FirstMenu_Handler(idiMenuitem){
       if(
    item == MENU_EXIT)
       {
          
    menu_destroy(iMenu);
          return 
    PLUGIN_HANDLED;
       }
       
       new 
    szData[6], szName[60], iAccessiCallback;
       
       
    menu_item_getinfo(iMenuitemiAccessszDatacharsmax(szData), szNamecharsmax(szName), iCallback);
       
       new 
    iKey str_to_num(szData);
       
       for(new 
    06i++)
          
    fm_strip_user_gun(idg_iPistols[i]);
       
       switch(
    iKey)
       {
          case 
    1:
          {
             
    g_Chosen[id] = true;
             
    g_iWeapon[id] = 1;
             
    give_item(id"weapon_deagle");
             
    cs_set_user_bpammo(idCSW_DEAGLE35);
          }
          case 
    2:
          {
             
    g_Chosen[id] = true;
             
    g_iWeapon[id] = 3;
             
    give_item(id"weapon_glock18");
             
    cs_set_user_bpammo(idCSW_GLOCK18120);
          }
          case 
    3:
          {
             
    g_Chosen[id] = true;
             
    g_iWeapon[id] = 2;
             
    give_item(id"weapon_usp");
             
    cs_set_user_bpammo(idCSW_USP100);
          }
       }
       
       
    menu_destroy(iMenu);
       return 
    PLUGIN_CONTINUE;
    }
    public 
    msgScoreAttrib(const MsgId, const MsgType, const MsgDest){
       if(
    cvar_tab)
       {
          if(
    IsUserCool(get_msg_arg_int(1)) && !get_msg_arg_int(2))
             
    set_msg_arg_int(2ARG_BYTEVIP_TAG);
       }
    }
    public 
    vip_online(id){
       
    g_iVip 0;
       
       new 
    Lenmessage[512], name[32];
       new 
    iPlayer;
       for(
    iPlayer 1iPlayer <= g_iMaxPlayersiPlayer++)
       {
          if(
    IsUserCool(iPlayer))
          {
             
    g_iVip++;
             
    get_user_name(iPlayernamecharsmax(name));
             if(
    g_iVip == 1)
                
    Len += format(message[Len], 511 Len"%s"name);
             else
                
    Len += format(message[Len], 511 Len" , %s"name);
          }
       }
       if(
    g_iVip 1)
          
    ChatColor(id"%L"id"VIP_ONLINE"string);
       else
          
    ChatColor(id"%s: !t%s"stringmessage);
    }
    stock ChatColor(const id, const input[], any:...){
       new 
    iCount 1iPlayers[32];
       static 
    szMsg[191];
       
    vformat(szMsg190input3);
       
       
    replace_all(szMsg190"!g""^4"); // Green Color
       
    replace_all(szMsg190"!y""^1"); // Default Color
       
    replace_all(szMsg190"!t""^3"); // Team Color
       
       
    if (idiPlayers[0] = id; else get_players(iPlayersiCount"ch");
       {
          for(new 
    iPlayer 0iPlayer iCountiPlayer++ )
          {
             if( 
    is_user_connected(iPlayers[iPlayer]) )
             {
                
    message_begin(MSG_ONE_UNRELIABLEmsgSayText_iPlayers[iPlayer]);
                
    write_byte(iPlayers[iPlayer]);
                
    write_string(szMsg);
                
    message_end();
             }
          }
       }
    }
    stock IsBlockMap(){
       new 
    got_lineline_numlen;
       new 
    cfgdir[MAX_TEXT_LENGTH];
       new 
    cfgpath[MAX_TEXT_LENGTH];
       new 
    mapname[MAX_NAME_LENGTH];
       new 
    txt[MAX_TEXT_LENGTH];
       
    get_localinfo("amxx_configsdir"cfgdircharsmax(cfgdir));
       
    get_mapname(mapnameMAX_NAME_LENGTH-1);
       
    format(cfgpathMAX_TEXT_LENGTH"%s/ideal_block_maps.ini"cfgdir);
       if (
    file_exists(cfgpath))
       {
          
    got_line read_file(cfgpathline_numtxtMAX_TEXT_LENGTH-1len);
          while (
    got_line>0)
          {
             if (
    equali(txtmapname)) return 1;
             
    line_num++;
             
    got_line read_file(cfgpathline_numtxtMAX_TEXT_LENGTH-1len);
          }
       }
       return 
    0;
    }
    stock boolIsUserCool(const id){
       if(!
    is_user_connected(id))
          return 
    false;
       
       if((
    get_user_flags(id) & vip_flag))
          return 
    true;
           
       return 
    false;
    }
     
  3. pm-04 Пользователь

    Регистрация:
    02.02.16
    Сообщения:
    603
    Симпатии:
    79
    Пол:
    Мужской
    Всем спасибо, сам сделал, вопрос решен, тему можно закрывать!
     
Статус темы:
Закрыта.