При запуске сервера не загружаются 2 конфига

Сообщения
81
Реакции
24
Ошибка
При запуске сервера не загружаются 2 конфига от плагинов amxmodx/congis/voteban.cfg и amxmodx/congis/ideal_vip.cfg
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5241 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Jan 30 2019 07:09:07
Built from: https://github.com/alliedmodders/amxmodx/commit/2110037
Build ID: 5241:2110037
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.4.0.668-dev
Build date: 09:47:42 Sep 29 2018 (1631)
Build from: https://github.com/dreamstalker/rehlds/commit/89be216
ReGamedll
ReGameDLL version: 5.7.0.322-dev
Build date: 11:41:14 Jan 13 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/7398bb7
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
Список метамодулей
[ 1] VoiceTranscoder  RUN   -    vtc.so                    v2017RC3        ini  ANY   ANY  
[ 2] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5241 ini Start ANY
[ 3] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 4] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 5] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 6] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 7] Fun RUN - fun_amxx_i386.so v1.9.0.5241 pl2 ANY ANY
[ 8] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5241 pl2 ANY ANY
[ 9] CSX RUN - csx_amxx_i386.so v1.9.0.5241 pl2 ANY ANY
[10] Engine RUN - engine_amxx_i386.so v1.9.0.5241 pl2 ANY ANY
[11] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5241 pl2 ANY ANY
[12] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5241 pl2 ANY ANY
[13] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5241 pl2 ANY ANY
[14] MySQL RUN - mysql_amxx_i386.so v1.9.0.5241 pl2 ANY ANY
[15] SQLite RUN - sqlite_amxx_i386.so v1.9.0.5241 pl2 ANY ANY
[16] VTC AMXX API RUN - VtcApi_amxx_i386.so v2017 RC2 pl2 ANY ANY
[17] ReAPI RUN - reapi_amxx_i386.so v5.8.0.165-dev pl2 ANY Never
Список плагинов
[  1] [183] AMXBans RBS       18.10.13    SKAJIbnEJIb & La  amxbans_rbs.amx  running  
[ 2] [183] Cvar on Map 18.05.29 SKAJIbnEJIb cvar_on_map.amx running
[ 3] Map Manager RU 1.2.2 Mistrick mapmanager_ru.a running
[ 4] HLDS Weapon FIX 1.1 [WPMG]PRoSToTeM@ hldsweaponfix.a running
[ 5] VoteBan 1.2 StockX voteban.amxx running
[ 6] Admin Commands 1.9.0.5241 AMXX Dev Team admincmd.amxx running
[ 7] Admin Help 1.9.0.5241 AMXX Dev Team adminhelp.amxx running
[ 8] [183] Skill ELO 18.03.24 SKAJIbnEJIb skill_elo.amxx running
[ 9] Menus Front-End 18.12.18 AMXX Dev Team & amxmodmenu_rbs. running
[ 10] Commands Menu 1.9.0.5241 AMXX Dev Team cmdmenu.amxx running
[ 11] Players Menu 1.9.0.5241 AMXX Dev Team plmenu.amxx running
[ 12] [183] MapsMenu RBS 17.10.30 AMXX Dev Team & mapsmenu_rbs.am running
[ 13] Admin Chat 1.9.0.5241 AMXX Dev Team adminchat.amxx running
[ 14] Scrolling Message 1.9.0.5241 AMXX Dev Team scrollmsg.amxx running
[ 15] Info. Messages 1.9.0.5241 AMXX Dev Team imessage.amxx running
[ 16] CS Misc. Stats 1.8.2 AMXX Dev Team miscstats.amxx running
[ 17] MultiJump 1.1 twistedeuphoria multijump.amxx running
[ 18] AMXX Gag 1.3 xPaw & Exolent gagmenu.amxx running
[ 19] [183] BonusMenu RBS 18.08.06BE SKAJIbnEJIb bonusmenu_rbs.a running
[ 20] [183] Army Ranks Ultim 18.05.15 SKAJIbnEJIb army_ranks_ulti running
[ 21] [183] Chat RBS 19.02.22 SKAJIbnEJIb chat_rbs.amxx running
[ 22] [183] Stats Configurat 18.05.15 SKAJIbnEJIb & AM statscfg_rbs.am running
[ 23] [183] StatsX RBS 18.03.24 SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 24] [183] CsStats MySQL 18.08.09 SKAJIbnEJIb csstats_mysql.a running
[ 25] [183] AR Vampire 17.08.22 SKAJIbnEJIb ar_vampire.amxx running
[ 26] [183] No Team Flash 17.10.30 SKAJIbnEJIb NoTeamFlash.amx running
[ 27] [183] Ultimate Flags 18.12.16 SKAJIbnEJIb ultimate_flags. running
[ 28] [183] Stimulation RBS 18.08.08BE SKAJIbnEJIb stimulation_rbs running
[ 29] [183] BonusTime RBS 18.10.10 SKAJIbnEJIb bonustime_rbs.a running
[ 30] [183] Ultimate Weapons 18.08.08BE SKAJIbnEJIb ultimate_weapon running
[ 31] [183] AC Spectator ESP 17.08.09 SKAJIbnEJIb & Ko ac_esp.amxx running
[ 32] Autoresponder/Advertis 0.5 MaximusBrood ad_manager.amxx running
[ 33] [183] Damager RBS 17.12.22 SKAJIbnEJIb damager_rbs.amx running
[ 34] Reset_Score 1.0 9 rpamm!? resetscore.amxx running
[ 35] Admin Check 1.51 OneEyed admin_check.amx running
[ 36] Chat Colour Menu 1.0 hk colourmenu.amxx running
[ 37] Ultimate Sounds 1.7 Dizzy / Bmann_42 ultimate_sounds running
[ 38] Hide 'Fire in the hole 1.1 xPaw & SKAJIbnEJ hide_fith.amxx running
[ 39] [183] Parachute RBS 17.12.12 KRoT@L/JTP10181 parachute_rbs.a running
[ 40] Weapons MaxClip 0.3.0 ConnorMcLeod weapons_maxclip running
[ 41] Smoke FIX 0.1 many Smoke_FIX.amxx running
[ 42] Silly C4 1.1 Cheap_Suit sillyc4.amxx running
[ 43] [183] Screen Player 19.02.22 SKAJIbnEJIb screen_player.a running
[ 44] Weaponmenu 1.0 UNREAL weaponmenu_new. running
[ 45] GHW Auto Message Displ 2.1 GHW_Chronic reklama.amxx running
[ 46] Bomb Timer 3.2 Twe3k plent_bomb.amxx running
[ 47] AFK Manager v1.4d Leon McVeran afk_manager.amx running
[ 48] [183] Ultimate Knife 18.12.21 SKAJIbnEJIb ultimate_knife. running
[ 49] Map Spawns Editor 1.0.16 iG_os Map_Spawns_Edit running
[ 50] MultiManager Fix 1.5 Asmodai & UFPS.T multimanager_fi running
[ 51] No Name Change 0.1.1 VEN no_name_change. running
[ 52] Auto recording demo 2.0 IzI | Bonaqua (R amx_autodemorec running
[ 53] Permanent message 1.1 He3aBuCuM permanent_messa running
[ 54] [183] SlayLosers RBS 18.10.13 SKAJIbnEJIb & d3 slaylosers_rbs. running
[ 55] [183] VoteRR RBS 17.08.11 kalash1k & SKAJI voterr_rbs.amxx running
[ 56] [183] Spect Bot 17.08.28 SKAJIbnEJIb & Bo SpectBot.amxx running
[ 57] [ReAPI] IDEAL VIP by W 1.4.6 Wikiname (Remake VIP.amxx running
[ 58] Join_Music 1.2.3 White Panther join.amxx running
[ 59] Mode 2x2 1.8 s1lent mode.amxx running
[ 60] ComboSprites 0.5 Chrescoe1 combo_sprtes.am running
[ 61] Death Sprite 1.0 DarkGL skull.amxx running
[ 62] Flashbang Dynamic Ligh 0.21 Avalanche flashbang_dligh running
[ 63] Kill Effect 0.2 neugomon kill_effect.amx running
[ 64] [183] Servers List 17.10.30 Sho0ter & SKAJIb servers_list.am running
[ 65] Slots Reservation 1.9.0.5241 AMXX Dev Team adminslots.amxx running
[ 66] [ZL] CoreFunction 2.0.2 Alexander.3 zl_core.amxx running
[ 67] ScorpionBoss 1.0.1 Alexander.3 zl_boss_scorpio stopped
Здравствуйте, столкнулся с такой проблемой при запуске сервера не загружаются 2 конфига от плагинов addons/amxmodx/congis/voteban.cfg и addons/amxmodx/congis/ideal_vip.cfg После смены карты работают нормально. Со всеми остальными плагинами проблем нет. server.cfg загружается нормально. Пробовал прописывать в amxx.cfg Так exec voteban.cfg и так exec addons/amxmodx/congis/voteban.cfg Не помогло. Подскажите в какую сторону нужно капать?
 
Сообщения
81
Реакции
24
present, Прописывал не помогло
10 Июн 2019
Pokemoshka, Прошу прощения за опечатку Совершил когда писал текст на форум. На самом деле путь был правильный когда писал в amxx.cfg и server.cfg

Такой exec addons/amxmodx/configs/voteban.cfg

Сейчас на всякий случай ещё раз всё проверил Не помогло. Интересно то что другие ведь конфиги загружаются.
 
Сообщения
1,420
Реакции
2,511
Помог
58 раз(а)
Как узнали что не загружаются?
 
Сообщения
81
Реакции
24
Как узнали что не загружаются?
Те что настройки в конфиге они не работают при старте сервера, после смены карты начинают работать
10 Июн 2019
Изначально идут настройки которые в исходники указаны потом когда карта меняется начинают работать те что в конфиге
 
Сообщения
1,420
Реакции
2,511
Помог
58 раз(а)
Те что настройки в конфиге они не работают при старте сервера, после смены карты начинают работать
10 Июн 2019
Изначально идут настройки которые в исходники указаны потом когда карта меняется начинают работать те что в конфиге
Возможно потому что они читаются только при старте плагина, который вызывается раньше чем загрузка amxx.cfg. Соотвественно если так, то после загрузки значение меняется и применяется при следующей загрузке плагина (смена карты).
 
Сообщения
2,491
Реакции
2,794
Помог
61 раз(а)
sas333, исходник плагина предоставьте. А также смотрите значения кваров в консоли
 
Сообщения
81
Реакции
24
w0w, Если это так, то как можно это исправить?
10 Июн 2019
fantom,
#include <amxmodx>
#include <reapi>

#define PLUGIN "[ReAPI] IDEAL VIP by Wikiname"
#define VERSION "1.4.8"
#define AUTHOR "Wikiname (Remake from Ba/lePa)"

//------------------------------------ Основные настройки плагина ------------------------------------------//

#define FLAG_ADMIN ADMIN_BAN // Флаг админа (только для уведомлений)
#define FLAG_VIP ADMIN_LEVEL_H // флаг доступа к функциям плагина (доступ к VIP-меню)
#define MUSIC // Если звук при входе админа не нужен, то поставьте // перед #define
//#define NO_THRUE_DAMAGE // Раскомментируйте, чтобы урон показывал только, если видно соперника
//#define EXP_SHOW // Раскомментировать, если используете Admin loader от Neugomon или F@ntom
#if defined EXP_SHOW
#define EXP_SHOW_TYPE 1 // 1 - Admin Loader by Neugomon (2.3), 2 - AdminLoad by Fant0M (3.8.2)
#endif

//------------------------------------------ Конец настроек -----------------------------------------------//
#define VIP_TAG (1<<2)
#define MAX_TEXT_LENGTH 200
#if AMXX_VERSION_NUM < 183
#include <dhudmessage>
#define MAX_NAME_LENGTH 32
#endif
#if defined NO_THRUE_DAMAGE
#include <engine>
#endif

#pragma semicolon 1

new bool:g_bBlockMap;

new g_Round, g_iWeapon[33], g_iVip ;
new cvar_connect, Float: cvar_x, Float: cvar_y;
new cvar_prefix;
new cvar_round, cvar_open, cvar_show, cvar_chat, cvar_pistols, cvar_funk, cvar_tab;
new Float: cvar_health, Float: cvar_health_head, Float: cvar_health_max;
new cvar_hud_hp;
new cvar_money, cvar_money_head;
new cvar_damage;
new cvar_awplimit;
#if defined EXP_SHOW
#if EXP_SHOW_TYPE == 1
native admin_expired(index);
#endif
#if EXP_SHOW_TYPE == 2
native adminload_get_expired(index);
#define admin_expired(%0) adminload_get_expired(%0);
#endif
#endif
new vip_opened[33];
new g_iSyncMsg;
new g_iMaxPlayers = 0;
new msgSayText;
new Float: g_iBuyTime, bool: g_iBuyTimeEnd;
new bool: g_Chosen[33] = false;

new g_PlayerPos[33];
new const Float:g_flCoords[][] = { {0.50, 0.42}, {0.56, 0.44}, {0.58, 0.50}, {0.56, 0.56}, {0.50, 0.58}, {0.44, 0.56}, {0.42, 0.50}, {0.44, 0.44} };

new string[32];
new szCvar[25];

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(PLUGIN, VERSION, AUTHOR);
register_cvar("reapi_ideal_vip_version", VERSION, FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED);

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


RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn", true);
RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed", true);

register_concmd("nightvision", "MainMenu");
register_concmd("vipmenu", "MainMenu");

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

g_iSyncMsg = CreateHudSyncObj();

msgSayText = get_user_msgid("SayText");
}
public plugin_cfg(){
new szConfigDir[128];

cvar_round = get_pcvar_num(register_cvar("amx_vipround", "2"));
cvar_open = get_pcvar_num(register_cvar("amx_vipzaround", "2"));
cvar_show = get_pcvar_num(register_cvar("amx_vipshow","0"));
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_float(register_cvar("amx_viphealth", "5.0"));
cvar_health_head = get_pcvar_float(register_cvar("amx_viphealth_head", "10.0"));
cvar_health_max = get_pcvar_float(register_cvar("amx_viphealth_max", "100.0"));
cvar_hud_hp = get_pcvar_num(register_cvar("amx_hudhp", "1"));
cvar_money = get_pcvar_num(register_cvar("amx_vipmoney", "300"));
cvar_money_head = get_pcvar_num(register_cvar("amx_vipmoney_head", "500"));
cvar_tab = get_pcvar_num(register_cvar("amx_viptab", "1"));
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", "!g[!tVIP SYSTEM!g]");
cvar_connect = register_cvar("amx_showconnect", "a");
cvar_awplimit = get_pcvar_num(register_cvar("amx_awproundlimit", "3"));
cvar_damage = get_pcvar_num(register_cvar("amx_vipdamager", "1"));

g_iBuyTime = get_cvar_float("mp_buytime");

get_pcvar_string(cvar_prefix, string, charsmax(string));
get_pcvar_string(cvar_connect, szCvar, charsmax(szCvar));


get_localinfo("amxx_configsdir", szConfigDir, charsmax(szConfigDir));

server_cmd("exec %s/ideal_vip.cfg", szConfigDir);
}

public admin_motd(id){

show_motd(id, "adminka.txt", "Как купить админку");

return PLUGIN_CONTINUE;
}

public vip_motd(id){

show_motd(id, "vipka.txt", "Как купить випку");

return PLUGIN_CONTINUE;
}

public client_putinserver(id){
g_iWeapon[id] = 0;

if(IsUserCool(id))
set_task(0.5, "vip_connect", id + 132);
}
public client_disconnected(id){
g_iWeapon[id] = 0;
g_Chosen[id] = false;
}

public vip_connect(TASKID){
new id = TASKID - 132;

#if defined MUSIC
client_cmd(0, "spk IDEAL_VIP/ideal_sound.wav");
#endif

new name[32]; get_user_name(id, name, charsmax(name));

new g_iRgb = random_num(1,255); //рандомные цвета для HUD и DHUD

const SHOW_CHAT = (1 << 0);
const SHOW_HUD = (1 << 1);
const SHOW_DHUD = (1 << 2);

new user_flags = get_user_flags(id) & FLAG_ADMIN;
new show_flags = read_flags(szCvar);

if(show_flags & SHOW_CHAT)
{
ChatColor(0, "%L", id, (user_flags) ? "ADMIN_CONNECT_CHAT" : "VIP_CONNECT_CHAT", string, name);
}
if(show_flags & SHOW_HUD)
{
set_hudmessage(g_iRgb, g_iRgb, g_iRgb, cvar_x, cvar_y, 0, 0.0, 6.0, 0.0, 0.0, -1);
show_hudmessage(0, "%L", id, (user_flags) ? "ADMIN_CONNECT_HUD" : "VIP_CONNECT_HUD", name);
}
if(show_flags & SHOW_DHUD)
{
set_dhudmessage(g_iRgb, g_iRgb, g_iRgb, cvar_x, cvar_y, 1, 0.0, 6.0, 0.0, 0.0);
show_dhudmessage(0, "%L", id, (user_flags) ? "ADMIN_CONNECT_HUD" : "VIP_CONNECT_HUD", name);
}
}

public EventRoundStart()
{
set_task(g_iBuyTime * 60.0, "offBuyTime");
g_iBuyTimeEnd = false;
g_Round++;
}

public offBuyTime() g_iBuyTimeEnd = true;

public EventRoundRestart() g_Round = 0;





public CBasePlayer_Spawn(const id)
{
vip_opened[id] = 0;

if(!g_bBlockMap)
{
if(IsUserCool(id))
{
if(g_Round == 0) FirstMenu(id);

if(is_user_alive(id))
{
if(cvar_funk == 1) task_funk(id);

if(cvar_show == 1 && !get_member(id, m_bHasPrimary) && g_Round >= cvar_round) MainMenu(id);
}
}
}
}

public CBasePlayer_Killed(iVictim, iKiller)
{
if(!g_bBlockMap)
{
if(IsUserCool(iVictim))
if(!g_Chosen[iVictim])
set_task(1.0, "FirstMenu", iVictim);
}
if(IsUserCool(iKiller))
{
if(is_user_alive(iKiller))
{
static Float:attackerHp, Float:addHp;
attackerHp = Float:get_entvar(iKiller, var_health);
addHp = get_member(iVictim, m_bHeadshotKilled) ? cvar_health_head : cvar_health;
attackerHp += addHp;
if (cvar_hud_hp == 1)
{
set_hudmessage(0, 255, 0, -1.0, 0.20, 0, 1.0, 1.0, 0.1, 0.1, -1);
ShowSyncHudMsg(iKiller, g_iSyncMsg, "+%d HP ( VIP )", floatround(addHp));
}
if ( get_member(iVictim, m_bHeadshotKilled) )
rg_add_account(iKiller, cvar_money_head, AS_ADD, true);
else
rg_add_account(iKiller, cvar_money, AS_ADD, true);
set_entvar(iKiller, var_health, attackerHp > cvar_health_max ? cvar_health_max : attackerHp);
if(attackerHp >= cvar_health_max) return HC_CONTINUE;
}
}
return HC_CONTINUE;
}

public EventDamage(iVictim)
{
if(cvar_damage == 0) return;
static iKiller;
iKiller = get_user_attacker(iVictim);
if (cvar_damage != 2)
if(!IsUserCool(iKiller)) return;
if(!iVictim || iVictim > g_iMaxPlayers) return;
if(!iKiller || iKiller > g_iMaxPlayers) return;
if(iVictim == iKiller) return;
#if defined NO_THRUE_DAMAGE
if(!ent_sees_ent(iKiller, iVictim)) return;
#endif

new iPos = ++g_PlayerPos[iKiller];
if(iPos == sizeof(g_flCoords))
{
iPos = g_PlayerPos[iKiller] = 0;
}
set_hudmessage(random(255), random(255), random(255), Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.0, 1.0, 0.0, 0.0);
ShowSyncHudMsg(iKiller, g_iSyncMsg, "%i^n", read_data(2));

}

GiveDefaultItems( id, secondary_weapon, itask = 1 ) {
if( itask ) task_funk(id);
switch( secondary_weapon ) {
case 0: {
FirstMenu(id);
}
case 1: {
rg_give_item(id, "weapon_deagle", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_DEAGLE, 35);
}
case 2: {
rg_give_item(id, "weapon_glock18", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_GLOCK18, 120);
}
case 3: {
rg_give_item(id, "weapon_usp", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_USP, 100);
}
}
}

public task_funk(id){
rg_give_item(id, "weapon_knife", GT_REPLACE);
rg_give_item(id, "item_thighpack");
rg_give_item(id, "weapon_hegrenade");
rg_give_item(id, "weapon_flashbang");
rg_give_item(id, "weapon_flashbang");
rg_give_item(id, "weapon_smokegrenade");
rg_give_item(id, "item_assaultsuit", GT_REPLACE);

if(cvar_pistols)
{
GiveDefaultItems( id, g_iWeapon[id], .itask = 0);
}
}

public MainMenu(id){
new signals[2]; get_member(id, m_signals, signals);
if(g_bBlockMap)
{
ChatColor(id, "%L", id, "VIP_WARNING6", string);
}
else if(!IsUserCool(id))
{
ChatColor(id, "%L", id, "VIP_WARNING4", string);
}
else if(g_iBuyTimeEnd)
{
ChatColor(id, "%L", id, "VIP_WARNING8", string);
}
else if(!(signals[1] & (1 << 0)))
{
ChatColor(id, "%L", id, "VIP_WARNING9", string);
}
else
{
if(is_user_alive(id))
{
if(vip_opened[id] < cvar_open || cvar_open == 0)
{
if(g_Round >= cvar_round)
{
new szTitle[128], szName[32], szPistol[32], szMenuMulti[64];
get_user_name(id, szName, charsmax(szName));

switch(g_iWeapon[id])
{
case 0: szPistol = "NONE";
case 1: szPistol = "Deagle";
case 2: szPistol = "Glock";
case 3: szPistol = "Usp";
}
#if defined EXP_SHOW
new exp = admin_expired(id);
if(exp > 0)
{
new systime = get_systime();
if(exp - systime > 0)
{
if((exp - systime) / 86400 > 0)
formatex(szTitle, charsmax(szTitle), "\rVIP меню \w[\dby Wikiname\w]^n\wПривет, [\y%s\w]^n\wОсталось \y%d \wдней \w[\rVIP\w]\y-\wки ^n", szName, ((exp - systime) / 86400));
else formatex(szTitle, charsmax(szTitle), "\rVIP меню \w[\dby Wikiname\w]^n\wПривет, [\y%s\w]^n\rПоследний \wдень \w[\rVIP\w]\y-\wки ^n", szName);
}
}
else if(exp == 0)
formatex(szTitle, charsmax(szTitle), "\rVIP меню \w[\dby Wikiname\w]^n\wПривет, [\y%s\w]^n\w[\rVIP\w] \y- \wПрава \yбессрочны ^n", szName);
#else
formatex(szTitle, charsmax(szTitle), "\rVIP меню \w[\dby Wikiname\w]^n\wПривет, [\y%s\w]", szName);
#endif
new i_Menu = menu_create(szTitle, "MainMenu_Handler", 1);

formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU1", szPistol);
menu_additem(i_Menu, szMenuMulti, "1", 0);

formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU2", szPistol);
menu_additem(i_Menu, szMenuMulti, "2", 0);

formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU3", szPistol);
menu_additem(i_Menu, szMenuMulti, "3", 0);

formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU4", szPistol);
menu_additem(i_Menu, szMenuMulti, "4", 0);

formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU5", szPistol);
menu_additem(i_Menu, szMenuMulti, "5", 0);

menu_addblank(i_Menu, 0);

formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU6");
menu_additem(i_Menu, szMenuMulti, "6", 0);

menu_addblank(i_Menu, 1);

menu_setprop(i_Menu, MPROP_EXITNAME, "\rВыход");
menu_display(id, i_Menu, 0);
}
else
{
if(cvar_round == 2)
{
ChatColor(id, "%L", id, "VIP_WARNING5", string, cvar_round);
return PLUGIN_HANDLED;
}
else
{
ChatColor(id, "%L", id, "VIP_WARNING1", string, cvar_round);
return PLUGIN_HANDLED;
}
}
}
else
ChatColor(id, "%L", id, "VIP_WARNING2", string);
}
else
ChatColor(id, "%L", id, "VIP_WARNING3", string);
}
return PLUGIN_HANDLED;
}
public MainMenu_Handler(id, iMenu, item){
if(item == MENU_EXIT)
{
menu_destroy(iMenu);

return PLUGIN_HANDLED;
}

new szData[6], szName[60], iAccess, iCallback;
menu_item_getinfo(iMenu, item, iAccess, szData, charsmax(szData), szName, charsmax(szName), iCallback);
get_user_name(id, szName, charsmax(szName));

new iKey = str_to_num(szData);
if (iKey !=3)
{
vip_opened[id]++;
GiveDefaultItems( id, g_iWeapon[id] );
}
switch(iKey)
{
case 1:
{
rg_give_item(id, "weapon_m4a1", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_M4A1, 90);

if(cvar_chat == 1)
ChatColor(0, "%L", id, "VIP_M4A1", string, szName);
}
case 2:
{
rg_give_item(id, "weapon_ak47", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_AK47, 90);

if(cvar_chat == 1)
ChatColor(0, "%L", id, "VIP_AK47", string, szName);
}
case 3:
{
if(g_Round >= cvar_awplimit)
{
rg_give_item(id, "weapon_awp", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_AWP, 30);
vip_opened[id]++;
GiveDefaultItems( id, g_iWeapon[id] );

if(cvar_chat == 1)
ChatColor(0, "%L", id, "VIP_AWP", string, szName);

}
else
{
ChatColor(id, "%L", id, "VIP_WARNING7", string, cvar_awplimit);
}
}
case 4:
{
rg_give_item(id, "weapon_famas", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_FAMAS, 90);

if(cvar_chat == 1)
ChatColor(0, "%L", id, "VIP_FAMAS", string, szName);
}
case 5:
{
rg_give_item(id, "weapon_scout", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_SCOUT, 90);

if(cvar_chat == 1)
ChatColor(0, "%L", id, "VIP_SCOUT", string, szName);
}
case 6:
{
FirstMenu(id);
}
}

menu_destroy(iMenu);
return PLUGIN_HANDLED;
}

public FirstMenu(id){
if(!is_user_connected(id))
return;

new i_Menu = menu_create("\yЧто вы предпочитаете?", "FirstMenu_Handler");

menu_additem(i_Menu, "\wDeagle", "1", 0);
menu_additem(i_Menu, "\wGlock", "2", 0);
menu_additem(i_Menu, "\wUsp", "3", 0);


menu_setprop(i_Menu, MPROP_EXITNAME, "\rВыход");
menu_display(id, i_Menu, 0);
}
public FirstMenu_Handler(id, iMenu, item){
if(item == MENU_EXIT)
{
menu_destroy(iMenu);
return PLUGIN_HANDLED;
}

new szData[6], szName[60], iAccess, iCallback;

menu_item_getinfo(iMenu, item, iAccess, szData, charsmax(szData), szName, charsmax(szName), iCallback);

new iKey = str_to_num(szData);
g_Chosen[id] = true;
g_iWeapon[id] = iKey;

switch(iKey)
{
case 1:
{
rg_give_item(id, "weapon_deagle", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_DEAGLE, 35);
}
case 2:
{
rg_give_item(id, "weapon_glock18", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_GLOCK18, 120);
}
case 3:
{
rg_give_item(id, "weapon_usp", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_USP, 100);
}
}

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(2, ARG_BYTE, VIP_TAG);
}
}

public vip_online(id){
g_iVip = 0;

new Len, message[512], name[32];
new iPlayer;

for(iPlayer = 1; iPlayer <= g_iMaxPlayers; iPlayer++)
{
if(IsUserCool(iPlayer))
{
g_iVip++;
get_user_name(iPlayer, name, charsmax(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 !gОнлайн : !t%s", string, message);
}

stock ChatColor(const id, const input[], any:...){
new iCount = 1, iPlayers[32];
static szMsg[191];
vformat(szMsg, 190, input, 3);

replace_all(szMsg, 190, "!g", "^4"); // Green Color
replace_all(szMsg, 190, "!y", "^1"); // Default Color
replace_all(szMsg, 190, "!t", "^3"); // Team Color

if (id) iPlayers[0] = id; else get_players(iPlayers, iCount, "ch");
{
for(new iPlayer = 0; iPlayer < iCount; iPlayer++ )
{
if( is_user_connected(iPlayers[iPlayer]) )
{
message_begin(MSG_ONE_UNRELIABLE, msgSayText, _, iPlayers[iPlayer]);
write_byte(iPlayers[iPlayer]);
write_string(szMsg);
message_end();
}
}
}
}
stock IsBlockMap(){
new got_line, line_num, len;
new cfgdir[MAX_TEXT_LENGTH];
new cfgpath[MAX_TEXT_LENGTH];
new mapname[MAX_NAME_LENGTH];
new txt[MAX_TEXT_LENGTH];

get_localinfo("amxx_configsdir", cfgdir, charsmax(cfgdir));
get_mapname(mapname, MAX_NAME_LENGTH-1);

format(cfgpath, MAX_TEXT_LENGTH, "%s/ideal_block_maps.ini", cfgdir);

if (file_exists(cfgpath))
{
got_line = read_file(cfgpath, line_num, txt, MAX_TEXT_LENGTH-1, len);
while (got_line>0)
{
if (equali(txt, mapname)) return 1;
line_num++;
got_line = read_file(cfgpath, line_num, txt, MAX_TEXT_LENGTH-1, len);
}
}
return 0;
}
stock bool: IsUserCool(const id){
if(!is_user_connected(id))
return false;

if((get_user_flags(id) & FLAG_VIP))
return true;

return false;
}

stock bool:ent_sees_ent(iEnt, iEnt2)
{
static Float:fEntOrigin[3], Float:fEnt2Origin[3], Float:fResult[3];
entity_get_vector(iEnt, EV_VEC_origin, fEntOrigin);
entity_get_vector(iEnt2, EV_VEC_origin, fEnt2Origin);
return trace_line(iEnt, fEntOrigin, fEnt2Origin, fResult) == iEnt2;
}
 
Сообщения
2,288
Реакции
1,740
Помог
31 раз(а)
w0w, Если это так, то как можно это исправить?
10 Июн 2019
fantom,
#include <amxmodx>
#include <reapi>

#define PLUGIN "[ReAPI] IDEAL VIP by Wikiname"
#define VERSION "1.4.8"
#define AUTHOR "Wikiname (Remake from Ba/lePa)"

//------------------------------------ Основные настройки плагина ------------------------------------------//

#define FLAG_ADMIN ADMIN_BAN // Флаг админа (только для уведомлений)
#define FLAG_VIP ADMIN_LEVEL_H // флаг доступа к функциям плагина (доступ к VIP-меню)
#define MUSIC // Если звук при входе админа не нужен, то поставьте // перед #define
//#define NO_THRUE_DAMAGE // Раскомментируйте, чтобы урон показывал только, если видно соперника
//#define EXP_SHOW // Раскомментировать, если используете Admin loader от Neugomon или F@ntom
#if defined EXP_SHOW
#define EXP_SHOW_TYPE 1 // 1 - Admin Loader by Neugomon (2.3), 2 - AdminLoad by Fant0M (3.8.2)
#endif

//------------------------------------------ Конец настроек -----------------------------------------------//
#define VIP_TAG (1<<2)
#define MAX_TEXT_LENGTH 200
#if AMXX_VERSION_NUM < 183
#include <dhudmessage>
#define MAX_NAME_LENGTH 32
#endif
#if defined NO_THRUE_DAMAGE
#include <engine>
#endif

#pragma semicolon 1

new bool:g_bBlockMap;

new g_Round, g_iWeapon[33], g_iVip ;
new cvar_connect, Float: cvar_x, Float: cvar_y;
new cvar_prefix;
new cvar_round, cvar_open, cvar_show, cvar_chat, cvar_pistols, cvar_funk, cvar_tab;
new Float: cvar_health, Float: cvar_health_head, Float: cvar_health_max;
new cvar_hud_hp;
new cvar_money, cvar_money_head;
new cvar_damage;
new cvar_awplimit;
#if defined EXP_SHOW
#if EXP_SHOW_TYPE == 1
native admin_expired(index);
#endif
#if EXP_SHOW_TYPE == 2
native adminload_get_expired(index);
#define admin_expired(%0) adminload_get_expired(%0);
#endif
#endif
new vip_opened[33];
new g_iSyncMsg;
new g_iMaxPlayers = 0;
new msgSayText;
new Float: g_iBuyTime, bool: g_iBuyTimeEnd;
new bool: g_Chosen[33] = false;

new g_PlayerPos[33];
new const Float:g_flCoords[][] = { {0.50, 0.42}, {0.56, 0.44}, {0.58, 0.50}, {0.56, 0.56}, {0.50, 0.58}, {0.44, 0.56}, {0.42, 0.50}, {0.44, 0.44} };

new string[32];
new szCvar[25];

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(PLUGIN, VERSION, AUTHOR);
register_cvar("reapi_ideal_vip_version", VERSION, FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED);

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


RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn", true);
RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed", true);

register_concmd("nightvision", "MainMenu");
register_concmd("vipmenu", "MainMenu");

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

g_iSyncMsg = CreateHudSyncObj();

msgSayText = get_user_msgid("SayText");
}
public plugin_cfg(){
new szConfigDir[128];

cvar_round = get_pcvar_num(register_cvar("amx_vipround", "2"));
cvar_open = get_pcvar_num(register_cvar("amx_vipzaround", "2"));
cvar_show = get_pcvar_num(register_cvar("amx_vipshow","0"));
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_float(register_cvar("amx_viphealth", "5.0"));
cvar_health_head = get_pcvar_float(register_cvar("amx_viphealth_head", "10.0"));
cvar_health_max = get_pcvar_float(register_cvar("amx_viphealth_max", "100.0"));
cvar_hud_hp = get_pcvar_num(register_cvar("amx_hudhp", "1"));
cvar_money = get_pcvar_num(register_cvar("amx_vipmoney", "300"));
cvar_money_head = get_pcvar_num(register_cvar("amx_vipmoney_head", "500"));
cvar_tab = get_pcvar_num(register_cvar("amx_viptab", "1"));
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", "!g[!tVIP SYSTEM!g]");
cvar_connect = register_cvar("amx_showconnect", "a");
cvar_awplimit = get_pcvar_num(register_cvar("amx_awproundlimit", "3"));
cvar_damage = get_pcvar_num(register_cvar("amx_vipdamager", "1"));

g_iBuyTime = get_cvar_float("mp_buytime");

get_pcvar_string(cvar_prefix, string, charsmax(string));
get_pcvar_string(cvar_connect, szCvar, charsmax(szCvar));


get_localinfo("amxx_configsdir", szConfigDir, charsmax(szConfigDir));

server_cmd("exec %s/ideal_vip.cfg", szConfigDir);
}

public admin_motd(id){

show_motd(id, "adminka.txt", "Как купить админку");

return PLUGIN_CONTINUE;
}

public vip_motd(id){

show_motd(id, "vipka.txt", "Как купить випку");

return PLUGIN_CONTINUE;
}

public client_putinserver(id){
g_iWeapon[id] = 0;

if(IsUserCool(id))
set_task(0.5, "vip_connect", id + 132);
}
public client_disconnected(id){
g_iWeapon[id] = 0;
g_Chosen[id] = false;
}

public vip_connect(TASKID){
new id = TASKID - 132;

#if defined MUSIC
client_cmd(0, "spk IDEAL_VIP/ideal_sound.wav");
#endif

new name[32]; get_user_name(id, name, charsmax(name));

new g_iRgb = random_num(1,255); //рандомные цвета для HUD и DHUD

const SHOW_CHAT = (1 << 0);
const SHOW_HUD = (1 << 1);
const SHOW_DHUD = (1 << 2);

new user_flags = get_user_flags(id) & FLAG_ADMIN;
new show_flags = read_flags(szCvar);

if(show_flags & SHOW_CHAT)
{
ChatColor(0, "%L", id, (user_flags) ? "ADMIN_CONNECT_CHAT" : "VIP_CONNECT_CHAT", string, name);
}
if(show_flags & SHOW_HUD)
{
set_hudmessage(g_iRgb, g_iRgb, g_iRgb, cvar_x, cvar_y, 0, 0.0, 6.0, 0.0, 0.0, -1);
show_hudmessage(0, "%L", id, (user_flags) ? "ADMIN_CONNECT_HUD" : "VIP_CONNECT_HUD", name);
}
if(show_flags & SHOW_DHUD)
{
set_dhudmessage(g_iRgb, g_iRgb, g_iRgb, cvar_x, cvar_y, 1, 0.0, 6.0, 0.0, 0.0);
show_dhudmessage(0, "%L", id, (user_flags) ? "ADMIN_CONNECT_HUD" : "VIP_CONNECT_HUD", name);
}
}

public EventRoundStart()
{
set_task(g_iBuyTime * 60.0, "offBuyTime");
g_iBuyTimeEnd = false;
g_Round++;
}

public offBuyTime() g_iBuyTimeEnd = true;

public EventRoundRestart() g_Round = 0;





public CBasePlayer_Spawn(const id)
{
vip_opened[id] = 0;

if(!g_bBlockMap)
{
if(IsUserCool(id))
{
if(g_Round == 0) FirstMenu(id);

if(is_user_alive(id))
{
if(cvar_funk == 1) task_funk(id);

if(cvar_show == 1 && !get_member(id, m_bHasPrimary) && g_Round >= cvar_round) MainMenu(id);
}
}
}
}

public CBasePlayer_Killed(iVictim, iKiller)
{
if(!g_bBlockMap)
{
if(IsUserCool(iVictim))
if(!g_Chosen[iVictim])
set_task(1.0, "FirstMenu", iVictim);
}
if(IsUserCool(iKiller))
{
if(is_user_alive(iKiller))
{
static Float:attackerHp, Float:addHp;
attackerHp = Float:get_entvar(iKiller, var_health);
addHp = get_member(iVictim, m_bHeadshotKilled) ? cvar_health_head : cvar_health;
attackerHp += addHp;
if (cvar_hud_hp == 1)
{
set_hudmessage(0, 255, 0, -1.0, 0.20, 0, 1.0, 1.0, 0.1, 0.1, -1);
ShowSyncHudMsg(iKiller, g_iSyncMsg, "+%d HP ( VIP )", floatround(addHp));
}
if ( get_member(iVictim, m_bHeadshotKilled) )
rg_add_account(iKiller, cvar_money_head, AS_ADD, true);
else
rg_add_account(iKiller, cvar_money, AS_ADD, true);
set_entvar(iKiller, var_health, attackerHp > cvar_health_max ? cvar_health_max : attackerHp);
if(attackerHp >= cvar_health_max) return HC_CONTINUE;
}
}
return HC_CONTINUE;
}

public EventDamage(iVictim)
{
if(cvar_damage == 0) return;
static iKiller;
iKiller = get_user_attacker(iVictim);
if (cvar_damage != 2)
if(!IsUserCool(iKiller)) return;
if(!iVictim || iVictim > g_iMaxPlayers) return;
if(!iKiller || iKiller > g_iMaxPlayers) return;
if(iVictim == iKiller) return;
#if defined NO_THRUE_DAMAGE
if(!ent_sees_ent(iKiller, iVictim)) return;
#endif

new iPos = ++g_PlayerPos[iKiller];
if(iPos == sizeof(g_flCoords))
{
iPos = g_PlayerPos[iKiller] = 0;
}
set_hudmessage(random(255), random(255), random(255), Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.0, 1.0, 0.0, 0.0);
ShowSyncHudMsg(iKiller, g_iSyncMsg, "%i^n", read_data(2));

}

GiveDefaultItems( id, secondary_weapon, itask = 1 ) {
if( itask ) task_funk(id);
switch( secondary_weapon ) {
case 0: {
FirstMenu(id);
}
case 1: {
rg_give_item(id, "weapon_deagle", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_DEAGLE, 35);
}
case 2: {
rg_give_item(id, "weapon_glock18", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_GLOCK18, 120);
}
case 3: {
rg_give_item(id, "weapon_usp", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_USP, 100);
}
}
}

public task_funk(id){
rg_give_item(id, "weapon_knife", GT_REPLACE);
rg_give_item(id, "item_thighpack");
rg_give_item(id, "weapon_hegrenade");
rg_give_item(id, "weapon_flashbang");
rg_give_item(id, "weapon_flashbang");
rg_give_item(id, "weapon_smokegrenade");
rg_give_item(id, "item_assaultsuit", GT_REPLACE);

if(cvar_pistols)
{
GiveDefaultItems( id, g_iWeapon[id], .itask = 0);
}
}

public MainMenu(id){
new signals[2]; get_member(id, m_signals, signals);
if(g_bBlockMap)
{
ChatColor(id, "%L", id, "VIP_WARNING6", string);
}
else if(!IsUserCool(id))
{
ChatColor(id, "%L", id, "VIP_WARNING4", string);
}
else if(g_iBuyTimeEnd)
{
ChatColor(id, "%L", id, "VIP_WARNING8", string);
}
else if(!(signals[1] & (1 << 0)))
{
ChatColor(id, "%L", id, "VIP_WARNING9", string);
}
else
{
if(is_user_alive(id))
{
if(vip_opened[id] < cvar_open || cvar_open == 0)
{
if(g_Round >= cvar_round)
{
new szTitle[128], szName[32], szPistol[32], szMenuMulti[64];
get_user_name(id, szName, charsmax(szName));

switch(g_iWeapon[id])
{
case 0: szPistol = "NONE";
case 1: szPistol = "Deagle";
case 2: szPistol = "Glock";
case 3: szPistol = "Usp";
}
#if defined EXP_SHOW
new exp = admin_expired(id);
if(exp > 0)
{
new systime = get_systime();
if(exp - systime > 0)
{
if((exp - systime) / 86400 > 0)
formatex(szTitle, charsmax(szTitle), "\rVIP меню \w[\dby Wikiname\w]^n\wПривет, [\y%s\w]^n\wОсталось \y%d \wдней \w[\rVIP\w]\y-\wки ^n", szName, ((exp - systime) / 86400));
else formatex(szTitle, charsmax(szTitle), "\rVIP меню \w[\dby Wikiname\w]^n\wПривет, [\y%s\w]^n\rПоследний \wдень \w[\rVIP\w]\y-\wки ^n", szName);
}
}
else if(exp == 0)
formatex(szTitle, charsmax(szTitle), "\rVIP меню \w[\dby Wikiname\w]^n\wПривет, [\y%s\w]^n\w[\rVIP\w] \y- \wПрава \yбессрочны ^n", szName);
#else
formatex(szTitle, charsmax(szTitle), "\rVIP меню \w[\dby Wikiname\w]^n\wПривет, [\y%s\w]", szName);
#endif
new i_Menu = menu_create(szTitle, "MainMenu_Handler", 1);

formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU1", szPistol);
menu_additem(i_Menu, szMenuMulti, "1", 0);

formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU2", szPistol);
menu_additem(i_Menu, szMenuMulti, "2", 0);

formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU3", szPistol);
menu_additem(i_Menu, szMenuMulti, "3", 0);

formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU4", szPistol);
menu_additem(i_Menu, szMenuMulti, "4", 0);

formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU5", szPistol);
menu_additem(i_Menu, szMenuMulti, "5", 0);

menu_addblank(i_Menu, 0);

formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU6");
menu_additem(i_Menu, szMenuMulti, "6", 0);

menu_addblank(i_Menu, 1);

menu_setprop(i_Menu, MPROP_EXITNAME, "\rВыход");
menu_display(id, i_Menu, 0);
}
else
{
if(cvar_round == 2)
{
ChatColor(id, "%L", id, "VIP_WARNING5", string, cvar_round);
return PLUGIN_HANDLED;
}
else
{
ChatColor(id, "%L", id, "VIP_WARNING1", string, cvar_round);
return PLUGIN_HANDLED;
}
}
}
else
ChatColor(id, "%L", id, "VIP_WARNING2", string);
}
else
ChatColor(id, "%L", id, "VIP_WARNING3", string);
}
return PLUGIN_HANDLED;
}
public MainMenu_Handler(id, iMenu, item){
if(item == MENU_EXIT)
{
menu_destroy(iMenu);

return PLUGIN_HANDLED;
}

new szData[6], szName[60], iAccess, iCallback;
menu_item_getinfo(iMenu, item, iAccess, szData, charsmax(szData), szName, charsmax(szName), iCallback);
get_user_name(id, szName, charsmax(szName));

new iKey = str_to_num(szData);
if (iKey !=3)
{
vip_opened[id]++;
GiveDefaultItems( id, g_iWeapon[id] );
}
switch(iKey)
{
case 1:
{
rg_give_item(id, "weapon_m4a1", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_M4A1, 90);

if(cvar_chat == 1)
ChatColor(0, "%L", id, "VIP_M4A1", string, szName);
}
case 2:
{
rg_give_item(id, "weapon_ak47", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_AK47, 90);

if(cvar_chat == 1)
ChatColor(0, "%L", id, "VIP_AK47", string, szName);
}
case 3:
{
if(g_Round >= cvar_awplimit)
{
rg_give_item(id, "weapon_awp", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_AWP, 30);
vip_opened[id]++;
GiveDefaultItems( id, g_iWeapon[id] );

if(cvar_chat == 1)
ChatColor(0, "%L", id, "VIP_AWP", string, szName);

}
else
{
ChatColor(id, "%L", id, "VIP_WARNING7", string, cvar_awplimit);
}
}
case 4:
{
rg_give_item(id, "weapon_famas", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_FAMAS, 90);

if(cvar_chat == 1)
ChatColor(0, "%L", id, "VIP_FAMAS", string, szName);
}
case 5:
{
rg_give_item(id, "weapon_scout", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_SCOUT, 90);

if(cvar_chat == 1)
ChatColor(0, "%L", id, "VIP_SCOUT", string, szName);
}
case 6:
{
FirstMenu(id);
}
}

menu_destroy(iMenu);
return PLUGIN_HANDLED;
}

public FirstMenu(id){
if(!is_user_connected(id))
return;

new i_Menu = menu_create("\yЧто вы предпочитаете?", "FirstMenu_Handler");

menu_additem(i_Menu, "\wDeagle", "1", 0);
menu_additem(i_Menu, "\wGlock", "2", 0);
menu_additem(i_Menu, "\wUsp", "3", 0);


menu_setprop(i_Menu, MPROP_EXITNAME, "\rВыход");
menu_display(id, i_Menu, 0);
}
public FirstMenu_Handler(id, iMenu, item){
if(item == MENU_EXIT)
{
menu_destroy(iMenu);
return PLUGIN_HANDLED;
}

new szData[6], szName[60], iAccess, iCallback;

menu_item_getinfo(iMenu, item, iAccess, szData, charsmax(szData), szName, charsmax(szName), iCallback);

new iKey = str_to_num(szData);
g_Chosen[id] = true;
g_iWeapon[id] = iKey;

switch(iKey)
{
case 1:
{
rg_give_item(id, "weapon_deagle", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_DEAGLE, 35);
}
case 2:
{
rg_give_item(id, "weapon_glock18", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_GLOCK18, 120);
}
case 3:
{
rg_give_item(id, "weapon_usp", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_USP, 100);
}
}

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(2, ARG_BYTE, VIP_TAG);
}
}

public vip_online(id){
g_iVip = 0;

new Len, message[512], name[32];
new iPlayer;

for(iPlayer = 1; iPlayer <= g_iMaxPlayers; iPlayer++)
{
if(IsUserCool(iPlayer))
{
g_iVip++;
get_user_name(iPlayer, name, charsmax(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 !gОнлайн : !t%s", string, message);
}

stock ChatColor(const id, const input[], any:...){
new iCount = 1, iPlayers[32];
static szMsg[191];
vformat(szMsg, 190, input, 3);

replace_all(szMsg, 190, "!g", "^4"); // Green Color
replace_all(szMsg, 190, "!y", "^1"); // Default Color
replace_all(szMsg, 190, "!t", "^3"); // Team Color

if (id) iPlayers[0] = id; else get_players(iPlayers, iCount, "ch");
{
for(new iPlayer = 0; iPlayer < iCount; iPlayer++ )
{
if( is_user_connected(iPlayers[iPlayer]) )
{
message_begin(MSG_ONE_UNRELIABLE, msgSayText, _, iPlayers[iPlayer]);
write_byte(iPlayers[iPlayer]);
write_string(szMsg);
message_end();
}
}
}
}
stock IsBlockMap(){
new got_line, line_num, len;
new cfgdir[MAX_TEXT_LENGTH];
new cfgpath[MAX_TEXT_LENGTH];
new mapname[MAX_NAME_LENGTH];
new txt[MAX_TEXT_LENGTH];

get_localinfo("amxx_configsdir", cfgdir, charsmax(cfgdir));
get_mapname(mapname, MAX_NAME_LENGTH-1);

format(cfgpath, MAX_TEXT_LENGTH, "%s/ideal_block_maps.ini", cfgdir);

if (file_exists(cfgpath))
{
got_line = read_file(cfgpath, line_num, txt, MAX_TEXT_LENGTH-1, len);
while (got_line>0)
{
if (equali(txt, mapname)) return 1;
line_num++;
got_line = read_file(cfgpath, line_num, txt, MAX_TEXT_LENGTH-1, len);
}
}
return 0;
}
stock bool: IsUserCool(const id){
if(!is_user_connected(id))
return false;

if((get_user_flags(id) & FLAG_VIP))
return true;

return false;
}

stock bool:ent_sees_ent(iEnt, iEnt2)
{
static Float:fEntOrigin[3], Float:fEnt2Origin[3], Float:fResult[3];
entity_get_vector(iEnt, EV_VEC_origin, fEntOrigin);
entity_get_vector(iEnt2, EV_VEC_origin, fEnt2Origin);
return trace_line(iEnt, fEntOrigin, fEnt2Origin, fResult) == iEnt2;
}
Используйте функцию " вставить код"
 
Сообщения
81
Реакции
24
Используйте функцию " вставить код"
Спасибо понял

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

#define PLUGIN "[ReAPI] IDEAL VIP by Wikiname"
#define VERSION "1.4.8"
#define AUTHOR "Wikiname (Remake from Ba/lePa)"

//------------------------------------ Основные настройки плагина ------------------------------------------//

#define FLAG_ADMIN ADMIN_BAN         // Флаг админа (только для уведомлений)
#define FLAG_VIP ADMIN_LEVEL_H        // флаг доступа к функциям плагина (доступ к VIP-меню)
#define MUSIC // Если звук при входе админа не нужен, то поставьте // перед #define
//#define NO_THRUE_DAMAGE // Раскомментируйте, чтобы урон показывал только, если видно соперника
//#define EXP_SHOW // Раскомментировать, если используете Admin loader от Neugomon или F@ntom
#if defined EXP_SHOW
    #define EXP_SHOW_TYPE 1 // 1 - Admin Loader by Neugomon (2.3), 2 - AdminLoad by Fant0M (3.8.2)
#endif

//------------------------------------------ Конец настроек -----------------------------------------------//
#define VIP_TAG (1<<2)
#define MAX_TEXT_LENGTH    200
#if AMXX_VERSION_NUM < 183
    #include <dhudmessage>
    #define MAX_NAME_LENGTH    32
#endif
#if defined NO_THRUE_DAMAGE
    #include <engine>
#endif

#pragma semicolon 1

new bool:g_bBlockMap;

new g_Round, g_iWeapon[33], g_iVip ;
new cvar_connect, Float: cvar_x, Float: cvar_y;
new cvar_prefix;
new cvar_round, cvar_open, cvar_show, cvar_chat, cvar_pistols, cvar_funk, cvar_tab;
new Float: cvar_health, Float: cvar_health_head, Float: cvar_health_max;
new cvar_hud_hp;
new cvar_money, cvar_money_head;
new cvar_damage;
new cvar_awplimit;
#if defined EXP_SHOW
    #if EXP_SHOW_TYPE == 1
        native admin_expired(index);
    #endif
    #if EXP_SHOW_TYPE == 2
        native adminload_get_expired(index);
        #define admin_expired(%0) adminload_get_expired(%0);
    #endif
#endif
new vip_opened[33];
new g_iSyncMsg;
new g_iMaxPlayers = 0;
new msgSayText;
new Float: g_iBuyTime, bool: g_iBuyTimeEnd;
new bool: g_Chosen[33] = false;

new g_PlayerPos[33];
new const Float:g_flCoords[][] = { {0.50, 0.42}, {0.56, 0.44}, {0.58, 0.50}, {0.56, 0.56}, {0.50, 0.58}, {0.44, 0.56}, {0.42, 0.50}, {0.44, 0.44} };

new string[32];
new szCvar[25];

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(PLUGIN, VERSION, AUTHOR);
    register_cvar("reapi_ideal_vip_version", VERSION, FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED);

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

    
    RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn", true);
    RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed", true);
    
    register_concmd("nightvision", "MainMenu");
    register_concmd("vipmenu", "MainMenu");

    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("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");
    
    g_iSyncMsg = CreateHudSyncObj();
    
    msgSayText = get_user_msgid("SayText");
}
public plugin_cfg(){
    new szConfigDir[128];
    
    cvar_round             =     get_pcvar_num(register_cvar("amx_vipround", "2"));
    cvar_open             =     get_pcvar_num(register_cvar("amx_vipzaround", "2"));
    cvar_show             =     get_pcvar_num(register_cvar("amx_vipshow","0"));
    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_float(register_cvar("amx_viphealth", "5.0"));
    cvar_health_head     =     get_pcvar_float(register_cvar("amx_viphealth_head", "10.0"));
    cvar_health_max     =     get_pcvar_float(register_cvar("amx_viphealth_max", "100.0"));
    cvar_hud_hp            =    get_pcvar_num(register_cvar("amx_hudhp", "1"));
    cvar_money             =     get_pcvar_num(register_cvar("amx_vipmoney", "300"));
    cvar_money_head     =     get_pcvar_num(register_cvar("amx_vipmoney_head", "500"));
    cvar_tab            =    get_pcvar_num(register_cvar("amx_viptab", "1"));
    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", "!g[!tVIP SYSTEM!g]");
    cvar_connect         =    register_cvar("amx_showconnect", "a");
    cvar_awplimit        =    get_pcvar_num(register_cvar("amx_awproundlimit", "3"));
    cvar_damage         =   get_pcvar_num(register_cvar("amx_vipdamager", "1"));

    g_iBuyTime = get_cvar_float("mp_buytime");

    get_pcvar_string(cvar_prefix, string, charsmax(string));
    get_pcvar_string(cvar_connect, szCvar, charsmax(szCvar));
    
        
    get_localinfo("amxx_configsdir", szConfigDir, charsmax(szConfigDir));
    
    server_cmd("exec %s/ideal_vip.cfg", szConfigDir);
}

public admin_motd(id){

    show_motd(id, "adminka.txt", "Как купить админку");
    
    return PLUGIN_CONTINUE;
}

public vip_motd(id){

    show_motd(id, "vipka.txt", "Как купить випку");
    
    return PLUGIN_CONTINUE;
}

public client_putinserver(id){
    g_iWeapon[id] = 0;
    
    if(IsUserCool(id))
        set_task(0.5, "vip_connect", id + 132);
}
public client_disconnected(id){
    g_iWeapon[id] = 0;
    g_Chosen[id] = false;
}

public vip_connect(TASKID){
    new id = TASKID - 132;
    
#if defined MUSIC
    client_cmd(0, "spk IDEAL_VIP/ideal_sound.wav");
#endif
    
    new name[32]; get_user_name(id, name, charsmax(name));
    
    new g_iRgb = random_num(1,255);  //рандомные цвета для HUD и DHUD
    
    const SHOW_CHAT = (1 << 0);
    const SHOW_HUD = (1 << 1);
    const SHOW_DHUD = (1 << 2);

    new user_flags = get_user_flags(id) & FLAG_ADMIN;
    new show_flags = read_flags(szCvar);

    if(show_flags & SHOW_CHAT)
    {
        ChatColor(0, "%L", id, (user_flags) ? "ADMIN_CONNECT_CHAT" : "VIP_CONNECT_CHAT", string, name);
    }
    if(show_flags & SHOW_HUD)
    {
        set_hudmessage(g_iRgb, g_iRgb, g_iRgb, cvar_x, cvar_y, 0, 0.0, 6.0, 0.0, 0.0, -1);
        show_hudmessage(0, "%L", id, (user_flags) ? "ADMIN_CONNECT_HUD" : "VIP_CONNECT_HUD", name);
    }
    if(show_flags & SHOW_DHUD)
    {
        set_dhudmessage(g_iRgb, g_iRgb, g_iRgb, cvar_x, cvar_y, 1, 0.0, 6.0, 0.0, 0.0);
        show_dhudmessage(0, "%L", id, (user_flags) ? "ADMIN_CONNECT_HUD" : "VIP_CONNECT_HUD", name);
    }
}
        
public EventRoundStart()
{
   set_task(g_iBuyTime * 60.0, "offBuyTime");
   g_iBuyTimeEnd = false;
   g_Round++;
}

public offBuyTime() g_iBuyTimeEnd = true;

public EventRoundRestart() g_Round = 0;
    




public CBasePlayer_Spawn(const id)
{
    vip_opened[id] = 0;
    
    if(!g_bBlockMap)
    {
        if(IsUserCool(id))
        {
            if(g_Round == 0) FirstMenu(id);
                
            if(is_user_alive(id))
            {
                if(cvar_funk == 1) task_funk(id);
                
                if(cvar_show == 1 && !get_member(id, m_bHasPrimary) && g_Round >= cvar_round) MainMenu(id);
            }
        }
    }
}

public CBasePlayer_Killed(iVictim, iKiller)
{
    if(!g_bBlockMap)
        {
            if(IsUserCool(iVictim))
                if(!g_Chosen[iVictim])
                    set_task(1.0, "FirstMenu", iVictim);
        }       
    if(IsUserCool(iKiller))
        {
            if(is_user_alive(iKiller))
            {
                static Float:attackerHp, Float:addHp;
                attackerHp = Float:get_entvar(iKiller, var_health);
                addHp = get_member(iVictim, m_bHeadshotKilled) ? cvar_health_head : cvar_health;
                attackerHp += addHp;
                if (cvar_hud_hp == 1)
                {
                    set_hudmessage(0, 255, 0, -1.0, 0.20, 0, 1.0, 1.0, 0.1, 0.1, -1);
                    ShowSyncHudMsg(iKiller, g_iSyncMsg, "+%d HP ( VIP )", floatround(addHp));
                }
                if ( get_member(iVictim, m_bHeadshotKilled) )
                    rg_add_account(iKiller, cvar_money_head, AS_ADD, true);
                else   
                    rg_add_account(iKiller, cvar_money, AS_ADD, true);
                set_entvar(iKiller, var_health, attackerHp > cvar_health_max ? cvar_health_max : attackerHp);
                if(attackerHp >= cvar_health_max) return HC_CONTINUE;
            }
        }
    return HC_CONTINUE;
}

public EventDamage(iVictim)
{
    if(cvar_damage == 0) return;
    static iKiller;
    iKiller = get_user_attacker(iVictim);
    if (cvar_damage != 2)
        if(!IsUserCool(iKiller)) return;
    if(!iVictim || iVictim > g_iMaxPlayers) return;
    if(!iKiller || iKiller > g_iMaxPlayers) return;
    if(iVictim == iKiller) return;
#if defined NO_THRUE_DAMAGE
    if(!ent_sees_ent(iKiller, iVictim)) return;
#endif

    new iPos = ++g_PlayerPos[iKiller];
    if(iPos == sizeof(g_flCoords))
    {
        iPos = g_PlayerPos[iKiller] = 0;
    }
    set_hudmessage(random(255), random(255), random(255), Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.0, 1.0, 0.0, 0.0);
    ShowSyncHudMsg(iKiller, g_iSyncMsg, "%i^n", read_data(2));
    
}

GiveDefaultItems( id, secondary_weapon, itask = 1 ) {
    if( itask ) task_funk(id);
    switch( secondary_weapon ) {
        case 0: {
            FirstMenu(id);
        }
        case 1: {
            rg_give_item(id, "weapon_deagle", GT_REPLACE);
            rg_set_user_bpammo(id, WEAPON_DEAGLE, 35);
        }
        case 2: {
            rg_give_item(id, "weapon_glock18", GT_REPLACE);
            rg_set_user_bpammo(id, WEAPON_GLOCK18, 120);
        }
        case 3: {
            rg_give_item(id, "weapon_usp", GT_REPLACE);
            rg_set_user_bpammo(id, WEAPON_USP, 100);
        }
    }
}

public task_funk(id){
    rg_give_item(id, "weapon_knife", GT_REPLACE);
    rg_give_item(id, "item_thighpack");
    rg_give_item(id, "weapon_hegrenade");
    rg_give_item(id, "weapon_flashbang");
    rg_give_item(id, "weapon_flashbang");
    rg_give_item(id, "weapon_smokegrenade");
    rg_give_item(id, "item_assaultsuit", GT_REPLACE);
    
    if(cvar_pistols)
    {
        GiveDefaultItems( id, g_iWeapon[id], .itask = 0);
    }
}

public MainMenu(id){
    new signals[2]; get_member(id, m_signals, signals);
    if(g_bBlockMap)
    {
        ChatColor(id, "%L", id, "VIP_WARNING6", string);
    }
    else if(!IsUserCool(id))
    {
        ChatColor(id, "%L", id, "VIP_WARNING4", string);
    }
    else if(g_iBuyTimeEnd)
    {
        ChatColor(id, "%L", id, "VIP_WARNING8", string);
    }
    else if(!(signals[1] & (1 << 0)))
    {
        ChatColor(id, "%L", id, "VIP_WARNING9", string);
    }
    else
    {
        if(is_user_alive(id))
        {
            if(vip_opened[id] < cvar_open || cvar_open == 0)
            {
                if(g_Round >= cvar_round)
                {
                    new szTitle[128], szName[32], szPistol[32], szMenuMulti[64];                   
                    get_user_name(id, szName, charsmax(szName));
                
                    switch(g_iWeapon[id])
                    {
                        case 0: szPistol = "NONE";
                        case 1: szPistol = "Deagle";
                        case 2: szPistol = "Glock";
                        case 3: szPistol = "Usp";
                    }
#if defined EXP_SHOW
                    new exp = admin_expired(id);
                    if(exp > 0)
                    {
                        new systime = get_systime();
                        if(exp - systime > 0)
                            {
                                if((exp - systime) / 86400 > 0)
                                formatex(szTitle, charsmax(szTitle), "\rVIP меню \w[\dby Wikiname\w]^n\wПривет, [\y%s\w]^n\wОсталось \y%d \wдней \w[\rVIP\w]\y-\wки ^n", szName, ((exp - systime) / 86400));
                                else    formatex(szTitle, charsmax(szTitle), "\rVIP меню \w[\dby Wikiname\w]^n\wПривет, [\y%s\w]^n\rПоследний \wдень \w[\rVIP\w]\y-\wки ^n", szName);
                            }
                    }
                    else if(exp == 0)   
                        formatex(szTitle, charsmax(szTitle), "\rVIP меню \w[\dby Wikiname\w]^n\wПривет, [\y%s\w]^n\w[\rVIP\w] \y- \wПрава \yбессрочны ^n", szName);
#else
                        formatex(szTitle, charsmax(szTitle), "\rVIP меню \w[\dby Wikiname\w]^n\wПривет, [\y%s\w]", szName);
#endif
                        new i_Menu = menu_create(szTitle, "MainMenu_Handler", 1);
                
                        formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU1", szPistol);
                        menu_additem(i_Menu, szMenuMulti, "1", 0);
                        
                        formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU2", szPistol);
                        menu_additem(i_Menu, szMenuMulti, "2", 0);
                        
                        formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU3", szPistol);
                        menu_additem(i_Menu, szMenuMulti, "3", 0);
                        
                        formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU4", szPistol);
                        menu_additem(i_Menu, szMenuMulti, "4", 0);
                        
                        formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU5", szPistol);
                        menu_additem(i_Menu, szMenuMulti, "5", 0);
                
                        menu_addblank(i_Menu, 0);
                        
                        formatex(szMenuMulti, charsmax(szMenuMulti), "%L", id, "ITEM_MENU6");
                        menu_additem(i_Menu, szMenuMulti, "6", 0);
                        
                        menu_addblank(i_Menu, 1);

                        menu_setprop(i_Menu, MPROP_EXITNAME, "\rВыход");
                        menu_display(id, i_Menu, 0);   
                }
                else
                {                   
                    if(cvar_round == 2)       
                    {
                        ChatColor(id, "%L", id, "VIP_WARNING5", string, cvar_round);
                        return PLUGIN_HANDLED;
                    }
                    else
                    {
                        ChatColor(id, "%L", id, "VIP_WARNING1", string, cvar_round);
                        return PLUGIN_HANDLED;
                    }
                }
            }
            else
                ChatColor(id, "%L", id, "VIP_WARNING2", string);
        }
        else
            ChatColor(id, "%L", id, "VIP_WARNING3", string);
    }       
    return PLUGIN_HANDLED;
}
public MainMenu_Handler(id, iMenu, item){
    if(item == MENU_EXIT)
    {
        menu_destroy(iMenu);
        
        return PLUGIN_HANDLED;
    }
    
    new szData[6], szName[60], iAccess, iCallback;
    menu_item_getinfo(iMenu, item, iAccess, szData, charsmax(szData), szName, charsmax(szName), iCallback);
    get_user_name(id, szName, charsmax(szName));
    
    new iKey = str_to_num(szData);
    if (iKey !=3)
        {
            vip_opened[id]++;
            GiveDefaultItems( id, g_iWeapon[id] );
        }   
    switch(iKey)
    {
        case 1:
        {
            rg_give_item(id, "weapon_m4a1", GT_REPLACE);
            rg_set_user_bpammo(id, WEAPON_M4A1, 90);
            
            if(cvar_chat == 1)
                ChatColor(0, "%L", id, "VIP_M4A1", string, szName);
        }
        case 2:
        {
            rg_give_item(id, "weapon_ak47", GT_REPLACE);
            rg_set_user_bpammo(id, WEAPON_AK47, 90);
            
            if(cvar_chat == 1)
                ChatColor(0, "%L", id, "VIP_AK47", string, szName);           
        }
        case 3:
        {
            if(g_Round >= cvar_awplimit)
            {
                rg_give_item(id, "weapon_awp", GT_REPLACE);
                rg_set_user_bpammo(id, WEAPON_AWP, 30);
                vip_opened[id]++;
                GiveDefaultItems( id, g_iWeapon[id] );
                
                if(cvar_chat == 1)
                ChatColor(0, "%L", id, "VIP_AWP", string, szName);

            }
            else
            {
                ChatColor(id, "%L", id, "VIP_WARNING7", string, cvar_awplimit);
            }
        }
        case 4:
        {
            rg_give_item(id, "weapon_famas", GT_REPLACE);
            rg_set_user_bpammo(id, WEAPON_FAMAS, 90);
            
            if(cvar_chat == 1)
                ChatColor(0, "%L", id, "VIP_FAMAS", string, szName);   
        }
        case 5:
        {
            rg_give_item(id, "weapon_scout", GT_REPLACE);
            rg_set_user_bpammo(id, WEAPON_SCOUT, 90);
            
            if(cvar_chat == 1)
                ChatColor(0, "%L", id, "VIP_SCOUT", string, szName);
        }       
        case 6:
        {
            FirstMenu(id);
        }
    }
    
    menu_destroy(iMenu);
    return PLUGIN_HANDLED;
}

public FirstMenu(id){
    if(!is_user_connected(id))
        return;
        
    new i_Menu = menu_create("\yЧто вы предпочитаете?", "FirstMenu_Handler");

    menu_additem(i_Menu, "\wDeagle", "1", 0);
    menu_additem(i_Menu, "\wGlock", "2", 0);
    menu_additem(i_Menu, "\wUsp", "3", 0);
    
    
    menu_setprop(i_Menu, MPROP_EXITNAME, "\rВыход");
    menu_display(id, i_Menu, 0);
}
public FirstMenu_Handler(id, iMenu, item){
    if(item == MENU_EXIT)
    {
        menu_destroy(iMenu);
        return PLUGIN_HANDLED;
    }
    
    new szData[6], szName[60], iAccess, iCallback;
    
    menu_item_getinfo(iMenu, item, iAccess, szData, charsmax(szData), szName, charsmax(szName), iCallback);
    
    new iKey = str_to_num(szData);
    g_Chosen[id] = true;
    g_iWeapon[id] = iKey;
    
    switch(iKey)
    {
        case 1:
        {
            rg_give_item(id, "weapon_deagle", GT_REPLACE);
            rg_set_user_bpammo(id, WEAPON_DEAGLE, 35);
        }
        case 2:
        {
            rg_give_item(id, "weapon_glock18", GT_REPLACE);
            rg_set_user_bpammo(id, WEAPON_GLOCK18, 120);
        }
        case 3:
        {
            rg_give_item(id, "weapon_usp", GT_REPLACE);
            rg_set_user_bpammo(id, WEAPON_USP, 100);
        }
    }
    
    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(2, ARG_BYTE, VIP_TAG);
    }
}

public vip_online(id){
    g_iVip = 0;
    
    new Len, message[512], name[32];
    new iPlayer;

    for(iPlayer = 1; iPlayer <= g_iMaxPlayers; iPlayer++)
    {
        if(IsUserCool(iPlayer))
        {
            g_iVip++;
            get_user_name(iPlayer, name, charsmax(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 !gОнлайн : !t%s", string, message);
}

stock ChatColor(const id, const input[], any:...){
    new iCount = 1, iPlayers[32];
    static szMsg[191];
    vformat(szMsg, 190, input, 3);
    
    replace_all(szMsg, 190, "!g", "^4"); // Green Color
    replace_all(szMsg, 190, "!y", "^1"); // Default Color
    replace_all(szMsg, 190, "!t", "^3"); // Team Color
    
    if (id) iPlayers[0] = id; else get_players(iPlayers, iCount, "ch");
    {
        for(new iPlayer = 0; iPlayer < iCount; iPlayer++ )
        {
            if( is_user_connected(iPlayers[iPlayer]) )
            {
                message_begin(MSG_ONE_UNRELIABLE, msgSayText, _, iPlayers[iPlayer]);
                write_byte(iPlayers[iPlayer]);
                write_string(szMsg);
                message_end();
            }
        }
    }
}
stock IsBlockMap(){
    new got_line, line_num, len;
    new cfgdir[MAX_TEXT_LENGTH];
    new cfgpath[MAX_TEXT_LENGTH];
    new mapname[MAX_NAME_LENGTH];
    new txt[MAX_TEXT_LENGTH];

    get_localinfo("amxx_configsdir", cfgdir, charsmax(cfgdir));
    get_mapname(mapname, MAX_NAME_LENGTH-1);

    format(cfgpath, MAX_TEXT_LENGTH, "%s/ideal_block_maps.ini", cfgdir);

    if (file_exists(cfgpath))
    {
        got_line = read_file(cfgpath, line_num, txt, MAX_TEXT_LENGTH-1, len);
        while (got_line>0)
        {
            if (equali(txt, mapname)) return 1;
            line_num++;
            got_line = read_file(cfgpath, line_num, txt, MAX_TEXT_LENGTH-1, len);
        }
    }
    return 0;
}
stock bool: IsUserCool(const id){
    if(!is_user_connected(id))
        return false;
    
    if((get_user_flags(id) & FLAG_VIP))
        return true;
        
    return false;
}

stock bool:ent_sees_ent(iEnt, iEnt2)
{
    static Float:fEntOrigin[3], Float:fEnt2Origin[3], Float:fResult[3];
    entity_get_vector(iEnt, EV_VEC_origin, fEntOrigin);
    entity_get_vector(iEnt2, EV_VEC_origin, fEnt2Origin);
    return trace_line(iEnt, fEntOrigin, fEnt2Origin, fResult) == iEnt2;
}
 
Сообщения
333
Реакции
290
Помог
9 раз(а)
Беда с кварами. Зарегистрировал, получил значение, исполнил конфиг..
 
Сообщения
2,491
Реакции
2,794
Помог
61 раз(а)
sas333, в плагине беда. Создаются квары и сразе же получаются их значения. А только потом грузится конфиг.
 

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

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