- Ошибка
-
Вип меню не открывается в начале каждого раунда, не могу понять в чем проблема
- ОС
- Windows
- Amx Mod X
-
AMX Mod X 1.9.0.5271
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.10.0.759-dev
Build date: 15:34:13 Jun 22 2021 (2628)
- ReGamedll
-
ReGameDLL version: 5.20.0.516-dev
Build date: 21:01:54 Jun 14 2021
- Версия Metamod
-
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 15:47:38 Aug 24 2018
- Список метамодулей
-
[ 1] SafeNameAndChat RUN - safenameandchat.dll v1.1 ini
ANY ANY
[ 2] Reunion RUN - reunion_mm.dll v0.1.0.137 ini
Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm.dll v0.1.6 ini
Start Never
[ 4] Revoice RUN - revoice_mm.dll v0.1.0.34 ini
Start Never
[ 5] AMX Mod X RUN - amxmodx_mm.dll v1.9.0.5271 ini
Start ANY
[ 6] Rechecker RUN - rechecker_mm.dll v2.5 ini
Chlvl ANY
[ 7] ReSemiclip RUN - resemiclip_mm.dll v2.3.9 ini
Chlvl ANY
[ 8] WHBlocker RUN - whblocker_mm.dll v1.5.697 ini
Chlvl ANY
[ 9] GeoIP RUN - geoip_amxx.dll v1.9.0.5271 pl5
ANY ANY
[10] CStrike RUN - cstrike_amxx.dll v1.9.0.5271 pl5
ANY ANY
[11] Ham Sandwich RUN - hamsandwich_amxx.dll v1.9.0.5271 pl5
ANY ANY
[12] Fun RUN - fun_amxx.dll v1.9.0.5271 pl5
ANY ANY
[13] FakeMeta RUN - fakemeta_amxx.dll v1.9.0.5271 pl5
ANY ANY
[14] Engine RUN - engine_amxx.dll v1.9.0.5271 pl5
ANY ANY
[15] CSX RUN - csx_amxx.dll v1.9.0.5271 pl5
ANY ANY
[16] ReAimDetector RUN - reaimdetector_amxx.dll v0.2.2 pl5
ANY Never
[17] ReAPI RUN - reapi_amxx.dll v5.19.0.217-dev pl5
ANY Never
- Список плагинов
-
name version author file st
atus
[ 1] Admin Base 1.9.0.5271 AMXX Dev Team admin.amxx ru
nning
[ 2] Admin Commands 1.9.0.5271 AMXX Dev Team admincmd.amxx ru
nning
[ 3] Slots Reservation 1.9.0.5271 AMXX Dev Team adminslots.amxx ru
nning
[ 4] Admin Menu 1.0 Krinj menufront.amxx ru
nning
[ 5] Commands Menu 1.9.0.5271 AMXX Dev Team cmdmenu.amxx ru
nning
[ 6] Players Menu 1.9.0.5271 AMXX Dev Team plmenu.amxx ru
nning
[ 7] Maps Menu 1.9.0.5271 AMXX Dev Team mapsmenu.amxx ru
nning
[ 8] Lite MapChooser 2.6 neygomon lite_mapchooser ru
nning
[ 9] Plugin Menu 1.9.0.5271 AMXX Dev Team pluginmenu.amxx ru
nning
[ 10] Admin Chat 1.9.0.5271 AMXX Dev Team adminchat.amxx ru
nning
[ 11] Scrolling Message 1.9.0.5271 AMXX Dev Team scrollmsg.amxx ru
nning
[ 12] Info. Messages 1.9.0.5271 AMXX Dev Team imessage.amxx ru
nning
[ 13] Admin Votes 1.9.0.5271 AMXX Dev Team adminvote.amxx ru
nning
[ 14] Pause Plugins 1.9.0.5271 AMXX Dev Team pausecfg.amxx ru
nning
[ 15] Stats Configuration 1.9.0.5271 AMXX Dev Team statscfg.amxx ru
nning
[ 16] Restrict Weapons 1.9.0.5271 AMXX Dev Team restmenu.amxx ru
nning
[ 17] StatsX 1.9.0.5271 AMXX Dev Team statsx.amxx ru
nning
[ 18] CS Stats Logging 1.9.0.5271 AMXX Dev Team stats_logging.a ru
nning
[ 19] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a ru
nning
[ 20] Reset Score by Krinj 1.0 Krinj resetscore.amxx ru
nning
[ 21] Server Menu by Krinj 1.0 Krinj server_menu.amx ru
nning
[ 22] Mute Menu by Krinj 1.0 Krinj mute.amxx ru
nning
[ 23] Rock The Vote by Krinj 1.0 Krinj rockthevote.amx ru
nning
[ 24] Vote Ban by Krinj 1.0 Krinj voteban.amxx ru
nning
[ 25] Hide Slash 1.0 HZ hide_slash.amxx ru
nning
[ 26] 'Fire in the hole' blo 1.0 xPaw hidefireintheho ru
nning
[ 27] Lite Translit 2.8 neygomon lite_translit.a ru
nning
[ 28] Kill Assists by Krinj 1.0 Krinj kill_assist.amx ru
nning
[ 29] HP Death 1.0 Krinj killa_hp.amxx ru
nning
[ 30] Parachute 1.0 maeStro parachute.amxx ru
nning
[ 31] Меню потти Only Locky pottimenu.amxx running
[ 32] Potti 1.40 p3tsin potti.amxx ru
nning
[ 33] Nice Knife 1.0 sector nice_knife.amxx ru
nning
[ 34] GunGame AMMO 2.2 Prayer gg_ammo.amxx ru
nning
[ 35] [ReAPI] Healthnade 0.0.2 F@nt0M reapi_healthnad ru
nning
[ 36] [AMXX] ViP Gold 1.0 Flymic24 amxx_vip_gold.a ru
nning
- Автор плагина
- Flymic24
- Версия плагина
- 1.0
- Исходный код
-
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta_util>
enum _:eVipType { Null = 0, ViP, ViPGold };
enum _:eGoldList{ Knife = 0, Deagle, Awp, Ak47, M4A1 };
#define VipFlag "t"
#define VipFlagGold "t"
#define MinRoundToOpenMenu 2
#define AWP_LIMIT 10
#define AK47_LIMIT 7
#define M4A1_LIMIT 7
#define Damage_Awp 1.0
#define Damage_Ak4 1.0
#define Damage_M4A1 1.0
#define Damage_Deagle 1.0
#define DROP_TYPE 2 // 1 - обычный дроп. 2 - удаляется из рук вообще
new szGoldV[eGoldList][32] = {
"models/gold/v_knife.mdl",
"models/gold/v_deagle.mdl",
"models/gold/v_awp.mdl",
"models/gold/v_ak47.mdl",
"models/gold/v_m4a1.mdl"
};
new szGoldP[eGoldList][32] = {
"models/gold/p_knife.mdl",
"models/gold/p_deagle.mdl",
"models/gold/p_awp.mdl",
"models/gold/p_ak47.mdl",
"models/gold/p_m4a1.mdl"
};
new szGoldW[eGoldList][32] = {
"",
"models/gold/w_deagle.mdl",
"models/gold/w_awp.mdl",
"models/gold/w_ak47.mdl",
"models/gold/w_m4a1.mdl"
};
enum _:eKeyGold{
_Deagle = 36895,
_Awp,
_Ak47,
_M4A1
};
enum _:eGoldCost{
Cost_Awp = 0,
Cost_Ak4 = 0,
Cost_M4A1 = 0
};
new iVipFlag[33], bool:bDefuse, iRoundNum;
public plugin_init()
{
register_plugin("[AMXX] ViP Gold", "1.0", "Flymic24");
register_event("TextMsg", "Event_RoundRestart", "a", "2&#Game_C", "2&#Game_w");
register_event("HLTV", "Event_RoundStart", "a", "1=0", "2=0");
register_message(get_user_msgid("ScoreAttrib"), "MessageScoreAttrib");
if(engfunc(EngFunc_FindEntityByString, FM_NULLENT, "classname", "func_bomb_target"))
bDefuse = true;
RegisterHam(Ham_Spawn, "player", "HamHook_Player_Spawn", true);
RegisterHam(Ham_Item_Deploy, "weapon_knife", "HamHook_Knife_Deploy", true);
RegisterHam(Ham_Item_Deploy, "weapon_ak47", "HamHook_Item_Deploy", true);
RegisterHam(Ham_Item_Deploy, "weapon_awp", "HamHook_Item_Deploy", true);
RegisterHam(Ham_Item_Deploy, "weapon_m4a1", "HamHook_Item_Deploy", true);
RegisterHam(Ham_Item_Deploy, "weapon_deagle","HamHook_Item_Deploy", true);
RegisterHam(Ham_Touch, "weapon_ak47", "HamHook_Item_AttachToPlayer", false);
RegisterHam(Ham_Touch, "weapon_m4a1", "HamHook_Item_AttachToPlayer", false);
RegisterHam(Ham_Touch, "weapon_awp", "HamHook_Item_AttachToPlayer", false);
RegisterHam(Ham_Touch, "weapon_deagle","HamHook_Item_AttachToPlayer", false);
RegisterHam(Ham_TraceAttack, "func_breakable", "HamHook_Entity_TraceAttack", false);
RegisterHam(Ham_TraceAttack, "hostage_entity", "HamHook_Entity_TraceAttack", false);
RegisterHam(Ham_TraceAttack, "info_target", "HamHook_Entity_TraceAttack", false);
RegisterHam(Ham_TraceAttack, "player", "HamHook_Entity_TraceAttack", false);
register_forward(FM_SetModel, "Fakemeta_SetModel")
register_clcmd("say /vipmenu", "WeaponMenu");
register_clcmd("vipmenu", "WeaponMenu");
register_menucmd(register_menuid("Vip Menu"), 1023, "VipHandler");
}
public plugin_precache()
{
for(new i = 0; i < sizeof(szGoldV); i++) if (szGoldV[i][0]) precache_model(szGoldV[i]);
for(new i = 0; i < sizeof(szGoldP); i++) if (szGoldP[i][0]) precache_model(szGoldP[i]);
for(new i = 0; i < sizeof(szGoldW); i++) if (szGoldW[i][0]) precache_model(szGoldW[i]);
}
public client_putinserver(iPlayer)
{
if (GetUserFlags(iPlayer) == Null)
return;
new szName[32]; get_user_name(iPlayer, szName, charsmax(szName));
UtilChatColor(0, "На сервер зашёл !gVIP !yклиент !team%s", szName);
}
public Event_RoundRestart() iRoundNum = 0;
public Event_RoundStart() iRoundNum++;
public MessageScoreAttrib(iMsgId, iDest, iReceiver)
{
new iPlayer = get_msg_arg_int(1);
if(iVipFlag[iPlayer] > Null && !get_msg_arg_int(2))
set_msg_arg_int(2, ARG_BYTE, (1<<2));
}
public HamHook_Knife_Deploy(const iItem)
{
if (pev_valid(iItem) != 2)
return HAM_IGNORED;
new iPlayer = get_pdata_cbase(iItem, 41, 4);
if(iVipFlag[iPlayer] != ViPGold)
return HAM_IGNORED;
set_pev(iPlayer, pev_viewmodel2, szGoldV[ Knife ]);
set_pev(iPlayer, pev_weaponmodel2, szGoldP[ Knife ]);
return HAM_IGNORED;
}
public HamHook_Item_Deploy(const iItem)
{
if (pev_valid(iItem) != 2)
return HAM_IGNORED;
new iIndex = 0;
switch(pev(iItem, pev_impulse))
{
case _Ak47: iIndex = Ak47;
case _Awp: iIndex = Awp;
case _M4A1: iIndex = M4A1;
case _Deagle: iIndex = Deagle;
default: return HAM_IGNORED;
}
if (iIndex)
{
new iPlayer = get_pdata_cbase(iItem, 41, 4);
set_pev(iPlayer, pev_viewmodel2, szGoldV[ iIndex ]);
set_pev(iPlayer, pev_weaponmodel2, szGoldP[ iIndex ]);
}
return HAM_IGNORED;
}
public HamHook_Item_AttachToPlayer(const iItem, const iPlayer)
{
if (!pev_valid(iItem))
return HAM_IGNORED;
switch(pev(iItem, pev_impulse))
{
case _Deagle.._M4A1:
{
if (iVipFlag[iPlayer] != ViPGold)
return HAM_SUPERCEDE;
}
default: return HAM_IGNORED;
}
return HAM_IGNORED;
}
public HamHook_Entity_TraceAttack(const iEntity, const iAttacker, Float:flDamage)
{
if (!is_user_alive(iAttacker) || !pev_valid(iEntity))
return HAM_IGNORED;
new iItem = get_pdata_cbase(iAttacker, 373, 5);
if (!pev_valid(iItem)) return HAM_IGNORED;
new Float:iIndex;
switch(pev(iItem, pev_impulse))
{
case _Ak47: iIndex = Damage_Ak4;
case _Awp: iIndex = Damage_Awp;
case _M4A1: iIndex = Damage_M4A1;
case _Deagle: iIndex = Damage_Deagle;
default: return HAM_IGNORED;
}
if (iIndex) SetHamParamFloat(3, flDamage * iIndex);
return HAM_IGNORED;
}
public HamHook_Player_Spawn(const iPlayer)
{
if (!is_user_alive(iPlayer) || is_user_bot(iPlayer))
return HAM_IGNORED;
if (iVipFlag[iPlayer] <= Null)
return HAM_IGNORED;
give_item_ex2(iPlayer, "weapon_hegrenade", 1);
give_item_ex2(iPlayer, "weapon_flashbang", 2);
give_item_ex2(iPlayer, "weapon_smokegrenade", 1);
if (!user_has_weapon(iPlayer, CSW_DEAGLE))
{
give_item_ex2(iPlayer, "weapon_deagle", 35, true, (iVipFlag[iPlayer] == ViPGold) ? _Deagle : Null);
}
cs_set_user_armor(iPlayer, 100, CS_ARMOR_VESTHELM);
if(bDefuse && cs_get_user_team(iPlayer) == CS_TEAM_CT)
cs_set_user_defuse(iPlayer, 1);
return HAM_IGNORED;
}
public Fakemeta_SetModel(const iEntity, szModel[])
{
if(!pev_valid(iEntity))
return FMRES_IGNORED;
new szClassName[32];
pev(iEntity, pev_classname, szClassName, charsmax(szClassName));
if (!equali(szClassName, "weaponbox"))
return FMRES_IGNORED;
for(new iSlot, iWeapon, iIndex; iSlot < 6; iSlot++)
{
iWeapon = get_pdata_cbase(iEntity, 34 + iSlot, 4);
if (pev_valid(iWeapon))
{
switch(pev(iWeapon, pev_impulse))
{
case _Ak47: iIndex = Ak47;
case _Awp: iIndex = Awp;
case _M4A1: iIndex = M4A1;
case _Deagle: iIndex = Deagle;
}
if (iIndex)
{
engfunc(EngFunc_SetModel, iEntity, szGoldW[iIndex]);
return FMRES_SUPERCEDE;
}
}
}
return FMRES_IGNORED;
}
public WeaponMenu(iPlayer)
{
if (!is_user_alive(iPlayer) || iVipFlag[iPlayer] <= Null)
return PLUGIN_HANDLED;
if (iRoundNum < MinRoundToOpenMenu)
{
UtilChatColor(iPlayer, "!y[!gCS-THUNDER!y] !yМеню !tне доступно!y. Жди ещё !t%i !yраунд", MinRoundToOpenMenu - iRoundNum);
return PLUGIN_HANDLED;
}
static szMenu[512], iLen;
iLen = formatex(szMenu, charsmax(szMenu), "\r[\yCS-THUNDER\r] \wВип меню^n^n");
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y1. \wВзять AK47^n");
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y2. \wВзять M4A1^n");
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y3. \wВзять AWP^n");
if (iVipFlag[iPlayer] == ViPGold)
{
if(iRoundNum < AK47_LIMIT)
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y4. \dВзять AK47 Gold \r[c %d раунда]^n", AK47_LIMIT);
else
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y4. \wВзять AK47 Gold \y(\r%i$\y)^n", Cost_Ak4);
if(iRoundNum < M4A1_LIMIT)
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y5. \dВзять M4A1 Gold \r[c %d раунда]^n", M4A1_LIMIT);
else
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y5. \wВзять M4A1 Gold \y(\r%i$\y)^n", Cost_M4A1);
if(iRoundNum < AWP_LIMIT)
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y6. \dВзять AWP Gold \r[c %d раунда]^n", AWP_LIMIT);
else
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y6. \wВзять AWP Gold \y(\r%i$\y)^n", Cost_Awp);
}
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\y0. \wВыход");
set_pdata_int(iPlayer, 205, 0);
show_menu(iPlayer, 1023, szMenu, -1, "Vip Menu");
return PLUGIN_HANDLED;
}
public VipHandler(iPlayer, iKey)
{
if (!is_user_alive(iPlayer))
return PLUGIN_HANDLED;
new iNewKey = iKey + 1;
static szWeaponName[][] = { "", "AK", "M4", "AWP", "Gold AK", "Gold M4", "Gold AWP" };
static szChoosedWP[][] = { "", "weapon_ak47", "weapon_m4a1", "weapon_awp" };
static szChoosedBP[] = { 0, 90, 90, 90, 30 };
static iGoldKey[] = { 0, _Ak47, _M4A1, _Awp };
static iCost[] = { 0, Cost_Ak4, Cost_M4A1, Cost_Awp };
static iRoundLimit[] = { 0, AK47_LIMIT, M4A1_LIMIT, AWP_LIMIT };
switch (iNewKey)
{
case 1..3: give_item_ex2(iPlayer, szChoosedWP[iNewKey], szChoosedBP[iNewKey], true);
case 4..6:
{
new iMoney = cs_get_user_money(iPlayer);
if (iRoundNum < iRoundLimit[iNewKey - 3])
{
UtilChatColor(iPlayer, "!y[!gCS-THUNDER!y] !yДоступно только с !g%i !yраунда", iRoundLimit[iNewKey - 3]);
return PLUGIN_HANDLED;
}
if (iMoney < iCost[iNewKey - 3] || iVipFlag[iPlayer] != ViPGold)
{
UtilChatColor(iPlayer, "!y[!gCS-THUNDER!y] !yНе достаточно денег: !t%i!g$", iCost[iNewKey - 3]);
return PLUGIN_HANDLED;
}
else
{
give_item_ex2(iPlayer, szChoosedWP[iNewKey - 3], szChoosedBP[iNewKey - 3], true, iGoldKey[iNewKey - 3]);
cs_set_user_money(iPlayer, iMoney - iCost[iNewKey - 3]);
}
}
default: return PLUGIN_HANDLED;
}
UtilChatColor(iPlayer, "!y[!gCS-THUNDER!y] !yВы получили: !g[!t%s!g]", szWeaponName[iNewKey]);
return PLUGIN_HANDLED;
}
stock give_item_ex2(iPlayer, const szWeaponName[], iAmmo = 0, bool:bDrop = false, iKey = 0)
{
if (!equal(szWeaponName, "weapon_", 7))
return false;
new iWeapon = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, szWeaponName));
if (!pev_valid(iWeapon))
return false;
if (bDrop)
{
new szWeapon[ 32 ],
iSlot = ExecuteHamB(Ham_Item_ItemSlot, iWeapon),
iItem = get_pdata_cbase(iPlayer, 367 + iSlot, 5);
while ((pev_valid(iItem) == 2))
{
pev(iItem, pev_classname, szWeapon, charsmax(szWeapon));
switch(DROP_TYPE)
{
case 1: engclient_cmd(iPlayer, "drop", szWeapon);
case 2: ham_strip_weapon(iPlayer, szWeapon);
}
iItem = get_pdata_cbase(iItem, 42, 4);
}
}
set_pev(iWeapon, pev_spawnflags, pev(iWeapon, pev_spawnflags) | SF_NORESPAWN);
if (iKey > 0) set_pev(iWeapon, pev_impulse, iKey);
if (iAmmo > 0) cs_set_user_bpammo(iPlayer, get_weaponid(szWeaponName), iAmmo);
dllfunc(DLLFunc_Spawn, iWeapon);
dllfunc(DLLFunc_Touch, iWeapon, iPlayer);
return true;
}
stock ham_strip_weapon(id, weapon[])
{
if(!equal(weapon,"weapon_",7)) return 0
new wId = get_weaponid(weapon)
if(!wId) return 0
new wEnt
while((wEnt = engfunc(EngFunc_FindEntityByString, wEnt, "classname", weapon)) && pev(wEnt, pev_owner) != id) {}
if(!wEnt) return 0
new iTmp
if(get_user_weapon(id, iTmp, iTmp) == wId) ExecuteHamB(Ham_Weapon_RetireWeapon, wEnt)
if(!ExecuteHamB(Ham_RemovePlayerItem, id, any:wEnt)) return 0
ExecuteHamB(Ham_Item_Kill, wEnt)
set_pev(id, pev_weapons, pev(id, pev_weapons) & ~(1<<wId))
return 1
}
stock GetUserFlags(const iPlayer)
{
if (!is_user_connected(iPlayer))
return -1;
new iFlags = get_user_flags(iPlayer);
new iReturnBit;
if (iFlags & read_flags(VipFlagGold))
{
iVipFlag[iPlayer] = ViPGold;
iReturnBit = ViPGold;
}
else if (iFlags & read_flags(VipFlag))
{
iVipFlag[iPlayer] = ViP;
iReturnBit = ViP;
}
else
{
iVipFlag[iPlayer] = Null;
iReturnBit = Null;
}
return iReturnBit;
}
stock UtilChatColor(const iPlayer, const szInput[], any:...)
{
new iCount = 1, szPlayers[32];
static szMessage[191];
vformat(szMessage, charsmax(szMessage), szInput, 3);
replace_all(szMessage, charsmax(szMessage), "!g", "^4"); // Green Color
replace_all(szMessage, charsmax(szMessage), "!y", "^1"); // Default Color
replace_all(szMessage, charsmax(szMessage), "!t", "^3"); // Team Color
static g_SayText;
if (!g_SayText) g_SayText = get_user_msgid("SayText");
if(iPlayer) szPlayers[0] = iPlayer; else get_players(szPlayers, iCount, "ch");
{
for(new i = 0; i < iCount; i++)
{
if(!is_user_connected(szPlayers[i])) continue;
message_begin(MSG_ONE_UNRELIABLE, g_SayText, _, szPlayers[i]);
write_byte(szPlayers[i]);
write_string(szMessage);
message_end();
}
}
}
Не могу понять, почему не хочет открываться меню в начале каждого раунда, но золотые оружия (дигл, нож) работают.
В этой теме было размещено решение! Перейти к решению.