- Ошибка
-
[VIP] WARNING: Invalid weapon name "ultimate_ak47" will be skipped! Ошибка в консоле
- ОС
- Windows
- Amx Mod X
-
AMX Mod X 1.9.0.5271 (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: Jun 24 2020 13:53:37
Built from: https://github.com/alliedmodders/amxmodx/commit/5eea3e5b
Build ID: 5271:5eea3e5b
Core mode: JIT+ASM32
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.12.0.785-dev
Build date: 17:12:40 Oct 08 2022 (3101)
Build from: https://github.com/dreamstalker/rehlds/commit/0656470
- ReGamedll
-
ReGameDLL version: 5.21.0.556-dev
Build date: 08:44:42 Jul 22 2022
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/1081301
- Версия Metamod
-
Metamod-r v1.3.0.131, API (5:13)
Metamod-r build: 18:51:28 Jul 11 2022
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/adc9414
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] SafeNameAndChat RUN - safenameandchat.dll v1.1 ini ANY ANY
[ 2] Reunion RUN - reunion_mm.dll v0.1.92d ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm.dll v0.1.6 ini Start Never
[ 4] VoiceTranscoder RUN - voicetranscoder.dll v2017RC5 ini ANY ANY
[ 5] AMX Mod X RUN - amxmodx_mm.dll v1.9.0.5271 ini Start ANY
[ 6] Rechecker RUN - rechecker_mm.dll v2.7 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] MySQL RUN - mysql_amxx.dll v1.9.0.5271 pl5 ANY ANY
[10] Fun RUN - fun_amxx.dll v1.9.0.5271 pl5 ANY ANY
[11] Engine RUN - engine_amxx.dll v1.9.0.5271 pl5 ANY ANY
[12] FakeMeta RUN - fakemeta_amxx.dll v1.9.0.5271 pl5 ANY ANY
[13] CStrike RUN - cstrike_amxx.dll v1.9.0.5271 pl5 ANY ANY
[14] ReAimDetector RUN - reaimdetector_amxx.dll v0.2.2 pl5 ANY Never
[15] ReAPI RUN - reapi_amxx.dll v5.21.0.252-dev pl5 ANY Never
[16] hackdetector RUN - hackdetector_amxx.dll v0.15.328.lite pl5 ANY ANY
[17] Ham Sandwich RUN - hamsandwich_amxx.dll v1.9.0.5271 pl5 ANY ANY
17 plugins, 17 running
- Список плагинов
-
Currently loaded plugins:
name version author file status
[ 1] Admin Base 1.9.0.5271 AMXX Dev Team admin.amxx running
[ 2] Admin Commands 1.9.0.5271 AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.9.0.5271 AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.9.0.5271 AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.9.0.5271 AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.9.0.5271 AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.9.0.5271 AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.9.0.5271 AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.9.0.5271 AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.9.0.5271 AMXX Dev Team pluginmenu.amxx running
[ 11] Admin Chat 1.9.0.5271 AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.9.0.5271 AMXX Dev Team antiflood.amxx running
[ 13] Info. Messages 1.9.0.5271 AMXX Dev Team imessage.amxx running
[ 14] Admin Votes 1.9.0.5271 AMXX Dev Team adminvote.amxx running
[ 15] NextMap 1.9.0.5271 AMXX Dev Team nextmap.amxx running
[ 16] Nextmap Chooser 1.9.0.5271 AMXX Dev Team mapchooser.amxx running
[ 17] TimeLeft 1.9.0.5271 AMXX Dev Team timeleft.amxx running
[ 18] Stats Configuration 1.9.0.5271 AMXX Dev Team statscfg.amxx running
[ 19] Restrict Weapons 1.9.0.5271 AMXX Dev Team restmenu.amxx running
[ 20] CS Stats Logging 1.9.0.5271 AMXX Dev Team stats_logging.a running
[ 21] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 22] HackDetector 0.15.lite Lev @ AGHL.RU De hackdetector.am running
[ 23] Advanced Ultimate Weap 0.1.0b steelzzz auw.amxx running
[ 24] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am running
[ 25] AES: StatsX 0.5+1 serfreeman1337 aes_statsx_cstr running
[ 26] Simple VIP system 1.0.3 MurLemur mur_vip.amxx running
[ 27] Parachute Lite [ReAPI] 11.0 Leo_[BH] parachute_lite. running
[ 28] MultiJump 1.1 twistedeuphoria zp_admin_multij running
[ 29] [ReAPI] Healthnade 0.0.9f DEV-CS.RU Commun reapi_healthnad running
[ 30] Flashbang Ban 0.4 mx?! flashbang_ban.a running
[ 31] AFK Control 1.0.3 Emma Jule reapi_afk.amxx running
[ 32] Night VIPs 1.1.1 szawesome night_vips.amxx running
[ 33] Top Awards 1.2.0 szawesome top_awards.amxx running
[ 34] KillAchievement 1.5 b0t. KillAchievement running
[ 35] Advanced Kill Assists 1.3d Xelson next21_kill_ass running
[ 36] Injector X 1.0 Deadly|Darkness dd_injectorX.am running
[ 37] Damager 2.0 Prayer damager.amxx running
[ 38] Back Weapons New 0.1 Vaqtincha backweapon.amxx running
[ 39] resetscore(ReAPI) 1.0 Phantom resetscore.amxx running
[ 40] Hostname Timeleft 1.0 xPaw HostnameTimelef running
[ 41] Mode 2x2 2.5re s1lent mode.amxx running
[ 42] Custom Models 1.3.2 neugomon custom_models.a running
[ 43] Revive Players 1.0.0 Emma Jule revive_teammate running
[ 44] Prefix Manager 0.1 serfreeman1337 prefixManager.a running
[ 45] DHud Win Status 1.0.2 BiZaJe DhudWinStatus.a running
[ 46] Map Manager: Core 3.1.4 Mistrick map_manager_cor running
[ 47] Map Manager: Scheduler 0.1.9 Mistrick map_manager_sch running
[ 48] Map Manager: Rtv 0.1.1 Mistrick map_manager_rtv running
[ 49] Map Manager: Nominatio 0.2.0 Mistrick map_manager_nom running
[ 50] Map Manager: BlockList 0.0.4 Mistrick map_manager_blo running
[ 51] Map Manager: Online so 0.0.4 Mistrick map_manager_onl running
[ 52] Map Manager: Effects 0.1.0 Mistrick map_manager_eff running
[ 53] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 54] Map Manager: Sounds 0.0.1 Mistrick map_manager_sou running
[ 55] AES: Bonus CSTRIKE 0.5 Vega serfreeman1337 aes_bonus_cstri running
[ 56] Advanced Experience Sy 0.5 Vega serfreeman1337 aes_main.amxx running
[ 57] AES: CStrike Addon 0.5 Vega serfreeman1337 aes_exp_cstrike running
[ 58] AES: Informer 0.5 Vega serfreeman1337 aes_informer.am running
[ 59] AES: Admin Tools 0.5 Vega serfreeman1337 aes_exp_editor. running
[ 60] AES: Bonus System 0.5 Vega serfreeman1337 aes_bonus_syste running
60 plugins, 60 running
- Автор плагина
- murlemur
- Версия плагина
- 1.0.3
- Исходный код
-
//■■■■■■■■■■■■■■■■■■■■■■■■■ Simple VIP System ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■//
/**
based on source of "VIP Environment" by Vaqtincha https://dev-cs.ru/resources/32/
*/
#include <amxmodx>
#include <reapi>
//■■■■■■■■■■■■■■■■■■■■■■■ CONFIG START ■■■■■■■■■■■■■■■■■■■■■■■//
#define VAULT_EXPIRE_DAYS 14 // save user settings
//#define DROP_AND_REPLACE // drop weapon before give (влияет только на стандартные пухи, если для кастомок нужно изменить - смотрите квар weapons_give_type в auw.cfg)
//#define AUW // USE advanced ultimate weapons (https://dev-cs.ru/resources/945/)
//#define ADMIN_LOADER // Поддержка admin loader by neygomon для вывода окончания привилегии
#if defined ADMIN_LOADER
#define USE_GAMECMS // Использовать лоадер GAMECMS
#endif
//#define NOT_SHOW_ROUND // Не показывать колонку Round в меню
//#define DEBUG // console info
//■■■■■■■■■■■■■■■■■■■■■■■■ CONFIG END ■■■■■■■■■■■■■■■■■■■■■■■■//
#if defined AUW
#include <auw>
#endif
#if defined ADMIN_LOADER
#if defined USE_GAMECMS
native cmsapi_service_timeleft(id, szDate[]="", iLen=0, srvName[]="", bool:part = false)
#else
native admin_expired(index)
#endif
#endif
new const CONFIG_FILE[] = "mur_vip.ini"
stock const VAULT_FILE[] = "mur_vip_vault"
const CONFIG_PATH_LEN = 128
const MAX_WEAPON_NAME_LEN = 20
const MAX_MENU_TEXT_LEN = 64
const TASKID_MENUCLOSE = 12138
const NO_MENU = -1
const PRIMARY_WEAPONS_BIT_SUM = (CSW_ALL_SHOTGUNS | CSW_ALL_SMGS | CSW_ALL_RIFLES | CSW_ALL_SNIPERRIFLES | CSW_ALL_MACHINEGUNS)
const EXCP_WEAPONS_BIT_SUM = (CSW_ALL_GRENADES | 1<<CSW_KNIFE | 1<<CSW_C4)
enum
{
TEAM_T = 1,
TEAM_C,
TEAM_ALL
}
enum _:WEAPON_DATA
{
szWeaponName[MAX_WEAPON_NAME_LEN],// weapon/item name
szMenuName[MAX_MENU_TEXT_LEN], // menu item name
iWeaponID, // weapon id
iAmount, // bpammo/amount
iCounter, // counter
iItemTeam, // team
szAccessAuth[MAX_MENU_TEXT_LEN]
}
enum _:PLAYER_DATA
{
iUsedCounter,
iInMenu,
iInBuyMenu,
iPistolIndex,
iOpenMenuType
}
enum _:OPEN_MENU_TYPES
{
AUTOOPEN_ON,
AUTOOPEN_OFF,
AUTOOPEN_WEAPON
}
new const OPEN_TYPES_TEXT[OPEN_MENU_TYPES][] = {
"\wВключено",
"\rВыключено",
"\wЕсли нет оружия"
}
// menu
new g_iWeaponMenuID, g_iWeaponMenuCB
// player arrays
new g_ePlayerData[MAX_PLAYERS+1][PLAYER_DATA]
// dynamic arrays
new Array:g_aDataSpawnItems, g_iNumSpawnItems
new Array:g_aDataMenuItems, g_iNumMenuItems
new Array:g_aDataPistols, g_iPistolsTotal
// configs
new g_iAccessFlags,bool:g_bScoreBoardFlag,bool:g_bIsAllowedMap, g_iMenuAuto, g_iMaxUse, g_iMenuCloseTime, bool:g_bAccesAll
new g_iRoundStartTime,g_iTimeActiveMenu,g_iMenuMinRound,g_iPistolsInMenu,g_iAutoOpenInMenu,g_iPistolsPage,g_iAutoOpenPage
stock const g_szWeaponName[CSW_P90+1][] = {
"","weapon_p228","weapon_shield","weapon_scout","weapon_hegrenade","weapon_xm1014","weapon_c4",
"weapon_mac10","weapon_aug","weapon_smokegrenade","weapon_elite","weapon_fiveseven","weapon_ump45",
"weapon_sg550","weapon_galil","weapon_famas","weapon_usp","weapon_glock18","weapon_awp",
"weapon_mp5navy","weapon_m249","weapon_m3","weapon_m4a1","weapon_tmp","weapon_g3sg1",
"weapon_flashbang","weapon_deagle","weapon_sg552","weapon_ak47","weapon_knife","weapon_p90"
}
public plugin_precache()
{
g_aDataSpawnItems = ArrayCreate(WEAPON_DATA)
g_aDataMenuItems = ArrayCreate(WEAPON_DATA)
g_aDataPistols = ArrayCreate(WEAPON_DATA)
}
#if defined VAULT_EXPIRE_DAYS
#include <nvault_array>
new g_iVautHandle = INVALID_HANDLE
GetNvault()
{
if (g_iAutoOpenInMenu == 0 && g_iPistolsInMenu == 0)
server_print("[VIP] WARNING: Please comment <#define VAULT_EXPIRE_DAYS> because nothing to save ( menu_add_pistols = 0 and menu_add_autoopen = 0 in ini file)")
g_iVautHandle = nvault_open(VAULT_FILE)
if(g_iVautHandle != INVALID_HANDLE)
{
nvault_prune(g_iVautHandle, 0, get_systime() - (86400 * VAULT_EXPIRE_DAYS))
}
}
public client_authorized(id, const szAuthID[])
{
if(g_iVautHandle == INVALID_HANDLE)
return
new Data[3]
if (nvault_get_array(g_iVautHandle, szAuthID, Data, charsmax(Data)) > 0)
{
g_ePlayerData[id][iPistolIndex] = Data[0]
g_ePlayerData[id][iOpenMenuType] = Data[1]
}
}
public SaveData(id)
{
if(!is_user_vip(id))
return
new szAuthID[MAX_AUTHID_LENGTH]
get_user_authid(id, szAuthID, charsmax(szAuthID))
new Data[3]
Data[0] = g_ePlayerData[id][iPistolIndex]
Data[1] = g_ePlayerData[id][iOpenMenuType]
if(g_iVautHandle != INVALID_HANDLE)
{
nvault_set_array(g_iVautHandle, szAuthID, Data, charsmax(Data))
}
}
public plugin_end()
{
if(g_iVautHandle != INVALID_HANDLE)
{
nvault_close(g_iVautHandle)
}
}
#endif
public client_disconnected(id)
{
#if defined VAULT_EXPIRE_DAYS
SaveData(id)
#endif
g_ePlayerData[id][iPistolIndex] = 0
if (g_iMenuAuto && g_iAutoOpenInMenu > 1)
g_ePlayerData[id][iOpenMenuType] = g_iAutoOpenInMenu - 1
else
g_ePlayerData[id][iOpenMenuType] = 0
}
public plugin_init( )
{
LoadConfig()
if(!g_bIsAllowedMap) {
pause("a")
return
}
BuildMenu()
#if defined VAULT_EXPIRE_DAYS
GetNvault()
#endif
register_plugin("Simple VIP system", "1.0.3", "MurLemur")
register_clcmd("weaponmenu", "ClCmd_WeaponMenu")
register_clcmd("vip", "ClCmd_WeaponMenu")
register_clcmd("say /vip", "ClCmd_WeaponMenu")
register_clcmd("say_team /vip", "ClCmd_WeaponMenu")
register_clcmd("vipmenu", "ClCmd_WeaponMenu")
register_clcmd("say /vipmenu", "ClCmd_WeaponMenu")
register_clcmd("say_team /vipmenu", "ClCmd_WeaponMenu")
RegisterHookChain(RG_CSGameRules_RestartRound, "CSGameRules_RestartRound_Pre", false)
RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn_Post", true)
if(g_bScoreBoardFlag && !get_member_game(m_bMapHasVIPSafetyZone))
register_message(get_user_msgid("ScoreAttrib"), "msgScoreAttrib")
if(file_exists("adminka.txt"))
register_clcmd("say /adminka", "ClcmdSayAdminka");
if(file_exists("vipka.txt"))
register_clcmd("say /vipka", "ClcmdSayVipka");
}
public ClcmdSayAdminka(id)
show_motd(id, "adminka.txt", "Admin Privileges");
public ClcmdSayVipka(id)
show_motd(id, "vipka.txt", "VIP Privileges");
public CSGameRules_RestartRound_Pre()
{
for(new id = 1; id < MAX_PLAYERS + 1; id++) {
g_ePlayerData[id][iUsedCounter] = 0
CloseMenu(id)
}
g_iRoundStartTime = get_systime()
}
public CBasePlayer_Spawn_Post(const id)
{
if(!is_user_connected(id) || !is_user_vip(id))
return
new sIsBot[2]
if(get_user_info(id, "*bot", sIsBot, charsmax(sIsBot)) && sIsBot[0] == '1' ) // :)
return
if(CheckAutoOpenMenu(id))
ShowWeaponMenu(id, .iPage = 0,.bNotify = false)
if (g_iPistolsInMenu)
GivePistol(id)
if(!g_iNumSpawnItems)
return
new eItemData[WEAPON_DATA], i, iUserTeam = get_user_team(id)
new iUserFlags = get_user_flags(id)
new authid[MAX_AUTHID_LENGTH]
get_user_authid(id, authid, charsmax(authid))
for(i = 0; i < g_iNumSpawnItems; i++)
{
ArrayGetArray(g_aDataSpawnItems, i, eItemData)
if (!CheckSpawnAcces(id,iUserFlags,eItemData[szAccessAuth],authid))
continue
if((current_round() >= eItemData[iCounter])) {
if(!eItemData[iItemTeam] || (iUserTeam != eItemData[iItemTeam] && eItemData[iItemTeam] != TEAM_ALL))
continue
if(equali(eItemData[szWeaponName],"item_thighpack") && iUserTeam == TEAM_C) {
rg_give_defusekit(id)
continue
}
if(equali(eItemData[szWeaponName],"silent_footsteps")) {
rg_set_user_footsteps(id, true)
continue
}
if(equali(eItemData[szWeaponName],"spawn_health")) {
set_entvar(id, var_health, float(eItemData[iAmount]))
continue
}
if (equali(eItemData[szWeaponName],"item_kevlar"))
{
rg_set_user_armor(id, eItemData[iAmount], ARMOR_KEVLAR)
continue
} else if (equali(eItemData[szWeaponName],"item_assaultsuit"))
{
rg_set_user_armor(id, eItemData[iAmount], ARMOR_VESTHELM)
continue
}
GiveItem(id, eItemData)
}
}
}
CheckSpawnAcces(id,iUserFlags,szSAccessAuth[],authid[]) {
switch(szSAccessAuth[0]) {
case 0 : return true
case '@': if(is_user_steam(id)) return true
case 'S': if(strcmp(authid, szSAccessAuth, .ignorecase = true) == 0) return true
default : if(iUserFlags & read_flags(szSAccessAuth)) return true
}
return false
}
CheckAutoOpenMenu(id) {
new bool:bNoWeapon = !get_member(id, m_bHasPrimary)
if(g_iMenuAuto && g_iAutoOpenInMenu && (g_ePlayerData[id][iOpenMenuType] == AUTOOPEN_ON || g_ePlayerData[id][iOpenMenuType] == AUTOOPEN_WEAPON && bNoWeapon))
return true
if (g_iMenuAuto == 2 && bNoWeapon && !g_iAutoOpenInMenu)
return true
if (g_iMenuAuto == 1 && !g_iAutoOpenInMenu)
return true
return false
}
LoadConfig()
{
new szConfigFile[CONFIG_PATH_LEN], szMsg[CONFIG_PATH_LEN+60], szMapName[32]
get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile))
formatex(szConfigFile, charsmax(szConfigFile), "%s/%s", szConfigFile, CONFIG_FILE)
g_iMenuMinRound = 90
#if defined AUW
new myData[eAUWData],iWeaponKey
#endif
get_mapname(szMapName, charsmax(szMapName))
if(!file_exists(szConfigFile))
{
formatex(szMsg, charsmax(szMsg), "[VIP] ERROR: Config file ^"%s^" not found!", szConfigFile)
set_fail_state(szMsg)
return 0
}
new iFilePointer = fopen(szConfigFile, "rt")
if(!iFilePointer)
{
set_fail_state("[VIP] ERROR: Failed reading file!")
return 0
}
new szDatas[64], szKey[32], szSign[2], szValue[5], eItemData[WEAPON_DATA], iSection, i
new szClassName[MAX_WEAPON_NAME_LEN], szMenuText[MAX_MENU_TEXT_LEN], szAmount[4], szCounter[4], szFlags[MAX_MENU_TEXT_LEN]
new Trie:tCheckWeaponName = TrieCreate()
for(i = 1; i< sizeof(g_szWeaponName); i++)
{
TrieSetCell(tCheckWeaponName, g_szWeaponName[i], i)
}
TrieSetCell(tCheckWeaponName, "item_kevlar", i)
TrieSetCell(tCheckWeaponName, "item_assaultsuit", i)
TrieSetCell(tCheckWeaponName, "item_thighpack", i)
TrieSetCell(tCheckWeaponName, "silent_footsteps", i)
TrieSetCell(tCheckWeaponName, "spawn_health", i)
ArrayPushArray(g_aDataMenuItems, eItemData) // empty holder so id's start at 1
g_iNumMenuItems++
while(!feof(iFilePointer))
{
fgets(iFilePointer, szDatas, charsmax(szDatas))
trim(szDatas)
if(!szDatas[0] || szDatas[0] == ';' || szDatas[0] == '#')
continue
if(szDatas[0] == '[')
{
if(equali(szDatas, "[settings]")){
iSection = 1
}else if(equali(szDatas, "[weaponmenu]")){
iSection = 2
}else if(equali(szDatas, "[spawnitems]")){
iSection = 3
}else if(equali(szDatas, "[pistols]")){
iSection = 4
}else if(equali(szDatas, "[maps]")){
iSection = 5
}else iSection = 0
continue
}
switch(iSection)
{
case 1:{
parse(szDatas, szKey, charsmax(szKey), szSign, charsmax(szSign), szValue, charsmax(szValue))
if(szSign[0] == '=')
{
if(equali(szKey, "access_flags")){
g_iAccessFlags = read_flags(szValue)
g_bAccesAll = bool:(szValue[0] == 0)
}else if(equali(szKey, "scoreboard_flag")){
g_bScoreBoardFlag = bool:(szValue[0] == '1')
}else if(equali(szKey, "auto_open_menu")){
g_iMenuAuto = str_to_num(szValue)
}else if(equali(szKey, "close_delay")){
g_iMenuCloseTime = str_to_num(szValue)
}else if(equali(szKey, "option_max_use")) {
g_iMaxUse = str_to_num(szValue)
}else if(equali(szKey, "time_active_menu")) {
g_iTimeActiveMenu = str_to_num(szValue)
}else if(equali(szKey, "menu_add_pistols")) {
g_iPistolsInMenu = str_to_num(szValue)
}else if(equali(szKey, "menu_add_autoopen")) {
g_iAutoOpenInMenu = str_to_num(szValue)
}
}
}
case 2:{
szMenuText[0] = 0
parse(szDatas, szClassName, charsmax(szClassName), szMenuText, charsmax(szMenuText), szAmount, charsmax(szAmount), szCounter, charsmax(szCounter))
strtolower(szClassName) // AbC > to > abs
#if defined AUW
iWeaponKey = auw_get_weapon_uid(szClassName,false)
if(!szClassName[0] || !TrieGetCell(tCheckWeaponName, szClassName, i) && iWeaponKey==-1)
#else
if(!szClassName[0] || !TrieGetCell(tCheckWeaponName, szClassName, i))
#endif
{
server_print("[VIP] WARNING: Invalid weapon name ^"%s^" will be skipped!", szClassName)
continue
}
copy(eItemData[szWeaponName], charsmax(eItemData[szWeaponName]), szClassName)
#if defined AUW
if (iWeaponKey==-1) {
copy(eItemData[szMenuName], charsmax(eItemData[szMenuName]), szMenuText)
eItemData[iWeaponID] = get_weaponid(szClassName)
eItemData[iAmount] = str_to_num(szAmount)
eItemData[iCounter] = str_to_num(szCounter)
}
else
{
auw_get_weapons_data(iWeaponKey, myData, .iKeyWithOffset = false)
eItemData[iCounter] = myData[eAUWData_WEAPON_ALLOW_ROUND]
if (szMenuText[0] == 0)
copy(eItemData[szMenuName], charsmax(eItemData[szMenuName]), myData[eAUWData_MENU_NAME_ITEM])
else
copy(eItemData[szMenuName], charsmax(eItemData[szMenuName]), szMenuText)
}
#else
copy(eItemData[szMenuName], charsmax(eItemData[szMenuName]), szMenuText)
eItemData[iWeaponID] = get_weaponid(szClassName)
eItemData[iAmount] = str_to_num(szAmount)
eItemData[iCounter] = str_to_num(szCounter)
#endif
g_iMenuMinRound = min(g_iMenuMinRound,eItemData[iCounter])
#if defined DEBUG
server_print("MENU ITEMS (WeaponName: ^"%s^" | WeaponID: ^"%d^" | Amount: ^"%d^" | Counter: ^"%d^" | MenuName: ^"%s^")", eItemData[szWeaponName], eItemData[iWeaponID], eItemData[iAmount], eItemData[iCounter], eItemData[szMenuName])
#endif
ArrayPushArray(g_aDataMenuItems, eItemData)
g_iNumMenuItems++
}
case 3:{
parse(szDatas, szClassName, charsmax(szClassName), szValue, charsmax(szValue), szAmount, charsmax(szAmount), szCounter, charsmax(szCounter),szFlags, charsmax(szFlags))
strtolower(szDatas) // AbC > to > abs
#if defined AUW
iWeaponKey = auw_get_weapon_uid(szClassName,false)
if(!szClassName[0] || !TrieGetCell(tCheckWeaponName, szClassName, i) && iWeaponKey==-1)
#endif
if(!szClassName[0] || !TrieGetCell(tCheckWeaponName, szClassName, i))
{
server_print("[VIP] WARNING: Invalid weapon/item name ^"%s^" will be skipped!", szClassName)
continue
}
copy(eItemData[szWeaponName], charsmax(eItemData[szWeaponName]), szClassName)
#if defined AUW
if (iWeaponKey==-1) {
eItemData[iWeaponID] = get_weaponid(szClassName)
eItemData[iAmount] = str_to_num(szAmount)
eItemData[iCounter] = str_to_num(szCounter)
}
else
{
auw_get_weapons_data(iWeaponKey, myData, .iKeyWithOffset = false)
eItemData[iWeaponID] = _:myData[eAUWData_WEAPON_ID]
eItemData[iCounter] = myData[eAUWData_WEAPON_ALLOW_ROUND]
}
#else
eItemData[iWeaponID] = get_weaponid(szClassName)
eItemData[iAmount] = str_to_num(szAmount)
eItemData[iCounter] = str_to_num(szCounter)
#endif
eItemData[iItemTeam] = szValue[0] == 't' ? TEAM_T : szValue[0] == 'c' ? TEAM_C : szValue[0] == 'a' ? TEAM_ALL : 0
copy(eItemData[szAccessAuth], charsmax(eItemData[szAccessAuth]), szFlags)
szFlags[0] = 0
#if defined DEBUG
server_print("SPAWN ITEMS (WeaponName: ^"%s^" | WeaponID: ^"%d^" | Amount: ^"%d^" | Counter: ^"%d^" | Team: ^"%d^")", eItemData[szWeaponName], eItemData[iWeaponID], eItemData[iAmount], eItemData[iCounter], eItemData[iItemTeam])
#endif
ArrayPushArray(g_aDataSpawnItems, eItemData)
g_iNumSpawnItems++
}
case 4:{
parse(szDatas, szClassName, charsmax(szClassName), szValue, charsmax(szValue), szAmount, charsmax(szAmount), szCounter, charsmax(szCounter),szFlags, charsmax(szFlags))
strtolower(szDatas) // AbC > to > abs
#if defined AUW
iWeaponKey = auw_get_weapon_uid(szClassName,false)
if(!szClassName[0] || !TrieGetCell(tCheckWeaponName, szClassName, i) && iWeaponKey==-1)
#endif
if(!szClassName[0] || !TrieGetCell(tCheckWeaponName, szClassName, i))
{
server_print("[VIP] WARNING: Invalid weapon/item name ^"%s^" will be skipped!", szClassName)
continue
}
eItemData[iAmount] = str_to_num(szValue)
eItemData[iCounter] = str_to_num(szAmount)
copy(eItemData[szWeaponName], charsmax(eItemData[szWeaponName]), szClassName)
#if defined AUW
iWeaponKey = auw_get_weapon_uid(szClassName,false)
if (iWeaponKey!=-1) {
auw_get_weapons_data(iWeaponKey, myData, .iKeyWithOffset = false)
eItemData[iCounter] = myData[eAUWData_WEAPON_ALLOW_ROUND]
copy(eItemData[szMenuName], charsmax(eItemData[szMenuName]), myData[eAUWData_MENU_NAME_ITEM])
}
else
{
strtoupper(szClassName)
copy(eItemData[szMenuName], charsmax(eItemData[szMenuName]), szClassName[7])
}
#else
strtoupper(szClassName)
copy(eItemData[szMenuName], charsmax(eItemData[szMenuName]), szClassName[7])
#endif
ArrayPushArray(g_aDataPistols, eItemData)
g_iPistolsTotal++
#if defined DEBUG
server_print("PISTOLS (PistolName ^"%s^" | PistolID ^"%d^" | PistolAmmo ^"%d^" | PistolCounter ^"%d^"", eItemData[szWeaponName], eItemData[iWeaponID], eItemData[iAmount], eItemData[iCounter])
#endif
}
case 5:{
if(!g_bIsAllowedMap && containi(szMapName, szDatas) != INVALID_HANDLE){
g_bIsAllowedMap = true
}else if(g_bIsAllowedMap && szDatas[0] == '@' && equali(szMapName, szDatas[1])){
g_bIsAllowedMap = false
}
}
}
}
fclose(iFilePointer)
TrieDestroy(tCheckWeaponName)
if (g_iPistolsTotal<=1)
g_iPistolsInMenu = 0
if (g_iMenuAuto && g_iAutoOpenInMenu > 1)
for(new id = 1; id < MAX_PLAYERS + 1; id++)
g_ePlayerData[id][iOpenMenuType] = g_iAutoOpenInMenu - 1
return 1
}
BuildMenu()
{
new szMenuText[MAX_MENU_TEXT_LEN]
#if defined NOT_SHOW_ROUND
formatex(szMenuText, charsmax(szMenuText), "\rVIP \yОружейка\R^t")
#else
formatex(szMenuText, charsmax(szMenuText), "\rVIP \yОружейка\RRound^t")
#endif
g_iWeaponMenuID = menu_create(szMenuText, "WeaponMenuHandler")
g_iWeaponMenuCB = menu_makecallback("WeaponMenuCallback")
if(g_iNumMenuItems <= 1)
return
new eMenuData[WEAPON_DATA], szNum[3], i
for(i = 1; i < g_iNumMenuItems; i++)
{
ArrayGetArray(g_aDataMenuItems, i, eMenuData)
#if defined NOT_SHOW_ROUND
formatex(szMenuText, charsmax(szMenuText), "%s\R\y%s%s", eMenuData[szMenuName], g_iNumMenuItems > 8 ? "^t^t^t^t" : "^t", i == (g_iNumMenuItems -1) ? "^n" : "")
#else
formatex(szMenuText, charsmax(szMenuText), "%s\R\y%d%s%s", eMenuData[szMenuName], eMenuData[iCounter], g_iNumMenuItems > 8 ? "^t^t^t^t" : "^t", i == (g_iNumMenuItems -1) ? "^n" : "")
#endif
num_to_str(i, szNum, charsmax(szNum))
menu_additem(g_iWeaponMenuID, szMenuText, szNum, 0, g_iWeaponMenuCB)
}
if(g_iPistolsInMenu && g_iPistolsTotal > 1) {
g_iPistolsPage = i/8
num_to_str(i++, szNum, charsmax(szNum))
menu_additem(g_iWeaponMenuID, "Пистолет : [DISABLED]", szNum, 0, g_iWeaponMenuCB)
}
if(g_iMenuAuto && g_iAutoOpenInMenu > 0) {
g_iAutoOpenPage = i/8
num_to_str(i++, szNum, charsmax(szNum))
menu_additem(g_iWeaponMenuID, "Автооткрытие : [DISABLED]", szNum, 0, g_iWeaponMenuCB)
}
formatex(szMenuText,charsmax(szMenuText),"%L",LANG_SERVER,"BACK")
menu_setprop(g_iWeaponMenuID,MPROP_BACKNAME,szMenuText)
formatex(szMenuText,charsmax(szMenuText),"%L",LANG_SERVER,"MORE")
menu_setprop(g_iWeaponMenuID,MPROP_NEXTNAME,szMenuText)
formatex(szMenuText,charsmax(szMenuText),"%L",LANG_SERVER,"EXIT")
menu_setprop(g_iWeaponMenuID,MPROP_EXITNAME,szMenuText)
}
public ClCmd_WeaponMenu(id)
{
ShowWeaponMenu(id, .iPage = 0)
return PLUGIN_HANDLED
}
ShowWeaponMenu(id, iPage, bool:bNotify = true)
{
if(!is_user_vip(id))
return
if(!is_user_alive(id))
{
if(bNotify)
client_print(id, print_center, "VIP меню доступно только для живых!")
return
}
if(!g_iMaxUse || g_iNumMenuItems <= 1)
{
if(bNotify)
client_print(id, print_center, "Меню отключено!")
return
}
if(g_ePlayerData[id][iUsedCounter] >= g_iMaxUse) {
if(bNotify)
client_print(id, print_center, "Вы уже брали оружие %d раз(а) в этом раунде", g_iMaxUse)
return
}
if(current_round() < g_iMenuMinRound)
return
if(get_systime() - g_iRoundStartTime > g_iTimeActiveMenu)
{
if(bNotify)
client_print(id, print_center, "Уже прошло более %d сек. с начала раунда!", g_iTimeActiveMenu)
return
}
iPage = clamp(iPage, 0, (g_iNumMenuItems - 1) / 7)
menu_display(id, g_iWeaponMenuID, iPage)
g_ePlayerData[id][iInMenu] = g_iWeaponMenuID
if(g_iMenuCloseTime > 0)
{
remove_task(TASKID_MENUCLOSE + id)
set_task(float(g_iMenuCloseTime), "Event_MenuAutoClose", TASKID_MENUCLOSE + id)
}
}
public WeaponMenuHandler(id, iMenu, iItem)
{
g_ePlayerData[id][iInMenu] = NO_MENU
if(g_iMenuCloseTime > 0)
remove_task(TASKID_MENUCLOSE + id)
if(iItem == MENU_EXIT || iItem < 0)
return PLUGIN_HANDLED
new szNum[3], iAccess, hCallback
menu_item_getinfo(iMenu, iItem, iAccess, szNum, charsmax(szNum), _, _, hCallback)
new iItemIndex = str_to_num(szNum)
if (g_iPistolsInMenu && g_iPistolsTotal > 1 && iItemIndex == g_iNumMenuItems)
{
if(g_ePlayerData[id][iPistolIndex]++ >= g_iPistolsTotal-1)
g_ePlayerData[id][iPistolIndex] = 0
menu_display(id, g_iWeaponMenuID, g_iPistolsPage)
return PLUGIN_HANDLED
} else if (iItemIndex >= g_iNumMenuItems)
{
if(g_ePlayerData[id][iOpenMenuType]++ >= 2)
g_ePlayerData[id][iOpenMenuType] = 0
menu_display(id, g_iWeaponMenuID, g_iAutoOpenPage)
return PLUGIN_HANDLED
}
new eMenuData[WEAPON_DATA]
ArrayGetArray(g_aDataMenuItems, iItemIndex, eMenuData)
if(GiveItem(id, eMenuData))
g_ePlayerData[id][iUsedCounter]++
return PLUGIN_HANDLED
}
public WeaponMenuCallback(id, iMenu, iItem)
{
if(iItem < 0)
return PLUGIN_HANDLED
new szNum[3], szMenuText[MAX_MENU_TEXT_LEN], iAccess, hCallback
menu_item_getinfo(iMenu, iItem, iAccess, szNum, charsmax(szNum), _, _, hCallback)
new iItemIndex = str_to_num(szNum)
if (iItem == MPROP_TITLE) {
#if defined NOT_SHOW_ROUND
new bool:bShowRound = false
#else
new bool:bShowRound = true
#endif
#if defined ADMIN_LOADER
#if defined USE_GAMECMS
new exp = cmsapi_service_timeleft(id)
#else
new exp = admin_expired(id)
#endif
if(exp > 0)
{
exp -= get_systime()
if(exp > 0)
{
new days = exp / 86400
if(days)
formatex(szMenuText, charsmax(szMenuText), "\rVIP \yОружия\R%s^t^n\dОсталось \r%d \dдн\y^t", bShowRound ? "Round":"", days)
else
formatex(szMenuText, charsmax(szMenuText), "\rVIP \yОружия\R%s^t^n\rПоследний \dдень\y^t", bShowRound ? "Round":"")
}
else
formatex(szMenuText, charsmax(szMenuText), "\rVIP \yОружейка\R%s^t", bShowRound ? "Round":"")
}
else
formatex(szMenuText, charsmax(szMenuText), "\rVIP \yОружейка\R%s^t", bShowRound ? "Round":"")
#else
formatex(szMenuText, charsmax(szMenuText), "\rVIP \yОружейка\R%s^t", bShowRound ? "Round":"")
#endif
menu_setprop(iMenu,iItem,szMenuText)
}
if (g_iPistolsInMenu && g_iPistolsTotal > 1 && iItemIndex == g_iNumMenuItems) {
new eItemData[WEAPON_DATA]
ArrayGetArray(g_aDataPistols, g_ePlayerData[id][iPistolIndex], eItemData)
formatex(szMenuText, charsmax(szMenuText), "Пистолет : \y[\w%s\y]", eItemData[szMenuName])
menu_item_setname(iMenu, iItem, szMenuText)
return ITEM_IGNORE
} else if (iItemIndex >= g_iNumMenuItems) {
formatex(szMenuText, charsmax(szMenuText), "Автооткрытие : \y[%s\y]", OPEN_TYPES_TEXT[g_ePlayerData[id][iOpenMenuType]])
menu_item_setname(iMenu, iItem, szMenuText)
return ITEM_IGNORE
}
new eMenuData[WEAPON_DATA]
ArrayGetArray(g_aDataMenuItems, iItemIndex, eMenuData)
if(current_round() < eMenuData[iCounter])
return ITEM_DISABLED
return ITEM_IGNORE
}
public Event_MenuAutoClose(taskid)
{
new id = taskid - TASKID_MENUCLOSE
CloseMenu(id)
}
CloseMenu(id)
{
if(is_user_connected(id))
{
new iOldMenu, iNewMenu
player_menu_info(id, iOldMenu, iNewMenu)
if(iNewMenu != NO_MENU && iNewMenu == g_iWeaponMenuID)
{
menu_cancel(id)
show_menu(id, 0, "^n", 1)
}
}
}
public msgScoreAttrib()
{
if(is_user_vip(get_msg_arg_int(1)) && !get_msg_arg_int(2))
set_msg_arg_int(2, ARG_BYTE, (1<<2))
}
public is_user_vip(id) {
return g_bAccesAll || (get_user_flags(id) & g_iAccessFlags)
}
GiveItem(id, Data[WEAPON_DATA])
{
#if defined AUW
if(auw_get_weapon_uid(Data[szWeaponName],false)!=-1)
{
auw_give_weapon(id, Data[szWeaponName], false, _, false, 0)
return 1
}
#endif
if (UTIL_GiveWeapon(id, Data[szWeaponName], Data[iAmount]))
return 1
return 0
}
GivePistol(id)
{
new eItemData[WEAPON_DATA]
ArrayGetArray(g_aDataPistols, g_ePlayerData[id][iPistolIndex], eItemData)
if(current_round() >= eItemData[iCounter])
GiveItem(id, eItemData)
}
stock bool: UTIL_GiveWeapon(const pPlayer, const szWeaponReference[], const iDefaultAmmo) {
new pItem
if (containi(szWeaponReference, "grenade")!= -1 || containi(szWeaponReference, "flashbang")!= -1) {
pItem = rg_give_item(pPlayer, szWeaponReference, GT_APPEND)
}
else
#if defined DROP_AND_REPLACE
pItem = rg_give_item(pPlayer, szWeaponReference, GT_DROP_AND_REPLACE)
#else
pItem = rg_give_item(pPlayer, szWeaponReference, GT_REPLACE)
#endif
if(is_nullent(pItem))
return false
if(iDefaultAmmo) {
new iAmmoType = get_member(pItem, m_Weapon_iPrimaryAmmoType)
if(get_member(pPlayer, m_rgAmmo, iAmmoType) < iDefaultAmmo)
set_member(pPlayer, m_rgAmmo, iDefaultAmmo, iAmmoType)
}
return true
}
current_round() {
return (get_member_game(m_iTotalRoundsPlayed) + 1)
}
[VIP] WARNING: Invalid weapon name "ultimate_ak47" will be skipped!
При установке костомных оружий из auw.
При установке костомных оружий из auw.
В этой теме было размещено решение! Перейти к решению.
Download all Attachments
-
3 KB Просмотры: 76
-
3.1 KB Просмотры: 83