Срок випки IDEAL_VIP

Сообщения
51
Реакции
5
Здравствуйте, подскажите как сделать в плагине IDEAL_VIP показывало срок випки!
У меня видно, что все плагины работают, но админки нет.
Стоит отключить admin_loader и функцию дней в випке админка работает!

Код:
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.3.0.605-dev
Build date: 22:55:56 Nov 8 2017 (1306)
Build from: https://github.com/dreamstalker/rehlds/commit/dab2663
Код:
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] AMX Mod X RUN - amxmodx_mm_i386. v1.8.2 ini Start ANY
[ 2] VoiceTranscoder RUN - VoiceTranscoder. v2017RC3 ini ANY ANY
[ 3] Reunion RUN - reunion_mm_i386. v0.1.75 ini Start Never
[ 4] Rechecker RUN - rechecker_mm_i38 v2.5 ini Chlvl ANY
[ 5] ReSRDetector RUN - resrdetector_mm_ v0.1.0 ini Chlvl ANY
[ 6] ReAuthCheck RUN - reauthcheck_mm_i v0.1.6 ini Start Never
[ 7] ReSemiclip RUN - resemiclip_mm_i3 v2.3.9 ini Chlvl ANY
[ 8] WHBlocker RUN - whblocker_mm_i38 v1.5.692 ini Chlvl ANY
[ 9] SafeNameAndChat RUN - SafeNameAndChat. v1.1 ini ANY ANY
[10] Fun RUN - fun_amxx_i386.so v1.8.2 pl1 ANY ANY
[11] FakeMeta RUN - fakemeta_amxx_i3 v1.8.2 pl1 ANY ANY
[12] CStrike RUN - cstrike_amxx_i38 v1.8.2 pl1 ANY ANY
[13] CSX RUN - csx_amxx_i386.so v1.8.2 pl1 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx v1.8.2 pl1 ANY ANY
[15] ReAPI RUN - reapi_amxx_i386. v5.2.0.1 pl1 ANY Never
[16] ReAimDetector RUN - reaimdetector_am v0.2.0 pl1 ANY Never
[17] ReParachute RUN - parachute_amxx_i v1.1 Bet pl1 ANY ANY
[18] hackdetector RUN - hackdetector_amx v0.15.32 pl1 ANY ANY
[19] ReFreeLook RUN - refreelook_amxx_ v1.6 pl1 ANY Never
[20] MySQL RUN - mysql_amxx_i386. v1.8.2 pl1 ANY ANY
[21] Engine RUN - engine_amxx_i386 v1.8.2 pl1 ANY ANY
[22] POD-Bot mm RUN - podbot_mm_i386.s v3.0B20a ini Chlvl ANY
22 plugins, 22 running
Код:
Currently loaded plugins:
name version author file status
[ 1] Admin Loader 2.9 neygomon admin_loader.am running
[ 2] AMXBans: Main Gm 1.6 Larte Team amxbans_main.am running
[ 3] AMXBans: Core Gm 1.6 Larte Team amxbans_core.am running
[ 4] Admin Commands 1.8.2 AMXX Dev Team admincmd.amxx running
[ 5] Slots Reservation 1.8.2 AMXX Dev Team adminslots.amxx running
[ 6] Menus Front-End 1.8.2 AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.8.2 AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.8.2 AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.8.2 AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.8.2 AMXX Dev Team pluginmenu.amxx running
[ 11] Admin Chat 1.8.2 AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.8.2 AMXX Dev Team antiflood.amxx running
[ 13] Admin Votes 1.8.2 AMXX Dev Team adminvote.amxx running
[ 14] NextMap 1.8.2 AMXX Dev Team nextmap.amxx running
[ 15] Nextmap Chooser 1.8.2 AMXX Dev Team mapchooser.amxx running
[ 16] TimeLeft 1.8.2 AMXX Dev Team timeleft.amxx running
[ 17] Pause Plugins 1.8.2 AMXX Dev Team pausecfg.amxx running
[ 18] Stats Configuration 1.8.2 AMXX Dev Team statscfg.amxx running
[ 19] Restrict Weapons 1.8.2 AMXX Dev Team restmenu.amxx running
[ 20] StatsX 1.8.2 AMXX Dev Team statsx.amxx running
[ 21] ReAimDetector API 0.2.0 ReHLDS Team reaimdetector.a running
[ 22] HackDetector 0.15.lite Lev @ AGHL.RU De hackdetector.am running
[ 23] Snowman - Bomb 1.6 s0h bomb_ny_1_6_reh running
[ 24] Pick up present 2.01 FakeNick present.amxx running
[ 25] CS Nade Drops 1.0 Avalanche & ropb csnadedrops.amx running
[ 26] Snowballs 1.2 FragOwn & maeStr snowballs.amxx running
[ 27] Snow-well 1.1 TTuCTOH and well Snow.amxx running
[ 28] Christmas hat 0.3 AMXX.Shop christmas_hat_r running
[ 29] Cam Change 1.1 Bl0ck Cam_Change.amxx running
[ 30] Lite Translit 2.8 neygomon lite_translit.a running
[ 31] Elite bets 1.0 Mi-Ki elite_bets.amxx running
[ 32] Block All Adverts 1.3 neygomon block_all_adver running
[ 33] POD-Bot Menu 1.3 g4s|figurE.09 amxx_podbotmenu running
[ 34] [ReAPI] IDEAL VIP by W 1.4.8 Wikiname (Remake reapi_ideal_vip running
[ 35] Advanced Experience Sy 0.4 serfreeman1337 aes_main.amxx running
[ 36] AES: Exp CSTRIKE 0.3 serfreeman1337 aes_exp_cstrike running
[ 37] AES: Informer 0.2 serfreeman1337 aes_informer.am running
[ 38] AES: Experience Editor 0.1 serfreeman1337 aes_exp_editor. running
[ 39] AES: Bonus System 0.2 serfreeman1337 aes_bonus_syste running
[ 40] AES: Bonus CSTRIKE 0.4 serfreeman1337 aes_bonus_cstri running
[ 41] AMXBans: Screens Gm 1.6 Larte Team amxbans_ssban.a running
41 plugins, 41 running
Исходники:
Код:
// *************************************************************************************//
// Плагин загружен с www.neugomon.ru //
// Автор: Neygomon [ https://neugomon.ru/members/1/ ] //
// Официальная тема поддержки: https://neugomon.ru/threads/486/ //
// При копировании материала ссылка на сайт www.neugomon.ru ОБЯЗАТЕЛЬНА! //
// *************************************************************************************//

#include <amxmodx>
#include <sqlx>

#define CUSTOM_DEF_FLAG
// Добавляет квар amx_default_access

#define USE_MODULE 1
// 0 - стандартно из amxmodx
// 1 - reapi
// 2 - fakemeta

#if USE_MODULE == 1
#include <reapi>
#endif
#if USE_MODULE == 2
#include <fakemeta>
#endif
#if !defined MAX_PLAYERS
#define MAX_PLAYERS 32
#endif
#if !defined MAX_NAME_LENGTH
#define MAX_NAME_LENGTH 32
#endif

enum _:UserInfo { Auth[32], Passwd[64], Nick[MAX_NAME_LENGTH], Access, Flags, Expired } // g_sUser
enum _:ServerData { IP[24] } // g_szServerData
enum _:SqlData { ServerInfo[32], Prefix[10] } // g_szSqlData

new Handle:g_hSqlTuple;
new g_Data[1], g_szQuery[512];

enum FWDS { AdminLoad, AdminLoad2 }
new g_fwdHandle[FWDS] = { INVALID_HANDLE, INVALID_HANDLE };

new g_iAdminExpired[MAX_PLAYERS + 1], g_iPlayerFlags[MAX_PLAYERS + 1];

new g_szServerData[ServerData];
new g_szSqlData[SqlData];

new Array:g_aUsers;
new g_sUser[UserInfo];

new g_szPassField[5];

new g_bitDefaultAccess = ADMIN_USER;
new g_iBanSystem;

new g_szBackupAdminPath[128];

public plugin_natives()
{
register_library("Admin Loader");
register_native("admin_expired", "admin_expired_callback", 1);
register_native("al_get_access", "al_get_access_callback", 1);
}
public admin_expired_callback(id)
return g_iAdminExpired[id];

public al_get_access_callback(id)
return g_iPlayerFlags[id];

public plugin_end()
{
SQL_FreeHandle(g_hSqlTuple);
ArrayDestroy(g_aUsers);
}

public plugin_init()
{
#define PLUGIN_VERSION "2.9"
register_plugin("Admin Loader", PLUGIN_VERSION, "neygomon");
// 1.7: add compatibility with Mazdan Admin Loader Forward
// 1.8: refactoring code... Thanks Radius
// 1.9: refactoring code... Мore readable code + added exec sql.cfg for compatibility with other mysql plugins
// 2.0: refactoring code... Use Thread SQL Querys
// 2.2: Fix bug with InfoChanged datas + added define USE_FAKEMETA
// 2.3: Fix load BackUP without MySQL connection
// 2.4: Add native al_get_access
// 2.4.1: Close test connection
// 2.4.2: Add cvar for indentification plugin =)
// 2.5: Fix critical bug with access by IP
// 2.5.2: Fix #2 with IP bug
// 2.6: Add reapi hookchain for changename
// 2.6.1: Fix HookChain for reAPI
// 2.6.2: May be fix error with invalid handle :D
// 2.7: Add support field 'custom_flags'
// 2.8: Optimization SQL query's... THX sonyx (https://neugomon.ru/members/62/)
// 2.9: Fix compile on AMXX 182

register_concmd("amx_reloadadmins", "cmdReload", ADMIN_CFG);
#if USE_MODULE == 1
RegisterHookChain(RG_CBasePlayer_SetClientUserInfoName, "SetClientUserInfoName_Post", true);
#endif
#if USE_MODULE == 2
register_forward(FM_SetClientKeyValue, "SetCleintKeyValue_Post", true);
#endif
new szPath[64], szPathFile[128];
get_localinfo("amxx_configsdir", szPath, charsmax(szPath));

formatex(szPathFile, charsmax(szPathFile), "%s/fb/main.cfg", szPath);
if(file_exists(szPathFile))
RegisterFreshBans(szPathFile);
else
{
formatex(szPathFile, charsmax(szPathFile), "%s/LB/main.cfg", szPath);
if(file_exists(szPathFile))
RegisterLiteBans(szPathFile);
}
if(!g_iBanSystem)
set_fail_state("File main.cfg ban-systems Fresh Bans or Lite Bans not found!");

RegisterDefaultCvars();
ExecConfigs(szPath);
ReadCvars();
SqlInit();
RegForwards();
}

public client_putinserver(id)
UserAccess(id);
#if USE_MODULE == 0
public client_infochanged(id)
{
if(!is_user_connected(id))
return;

new oldname[MAX_NAME_LENGTH];
get_user_name(id, oldname, charsmax(oldname));

new newname[MAX_NAME_LENGTH];
get_user_info(id, "name", newname, charsmax(newname));

if(strcmp(oldname, newname) != 0)
UserAccess(id, newname);
}
#endif
#if USE_MODULE == 1
public SetClientUserInfoName_Post(const id, infobuffer[], szNewName[MAX_NAME_LENGTH])
UserAccess(id, szNewName);
#endif
#if USE_MODULE == 2
public SetCleintKeyValue_Post(id, const sInfoBuffer[], const sKey[], sValue[MAX_NAME_LENGTH])
if(strcmp(sKey, "name") == 0)
UserAccess(id, sValue);
#endif
public cmdReload(id, level)
{
if(get_user_flags(id) & level)
adminSql(id);
return PLUGIN_HANDLED;
}

public SQL_Handler(failstate, Handle:query, err[], errcode, dt[], datasize)
{
switch(failstate)
{
case TQUERY_CONNECT_FAILED, TQUERY_QUERY_FAILED:
{
log_amx("[SQL ERROR #%d][Query State %d] %s", errcode, dt[0], err);
return;
}
}

if(!SQL_NumResults(query))
{
log_amx("Администраторы для сервера %s не найдены!", g_szServerData[IP]);
return;
}

if(g_aUsers == Invalid_Array)
{
log_error(AMX_ERR_NOTFOUND, "Dyn massive g_aUsers invalid!");
return;
}

new sBuffer[30];
new iLoadAdmins;
ArrayClear(g_aUsers);

while(SQL_MoreResults(query))
{
SQL_ReadResult(query, 0, g_sUser[Auth], charsmax(g_sUser[Auth]));
SQL_ReadResult(query, 1, g_sUser[Passwd], charsmax(g_sUser[Passwd]));
SQL_ReadResult(query, 2, g_sUser[Nick], charsmax(g_sUser[Nick]));

SQL_ReadResult(query, 6, sBuffer, charsmax(sBuffer)); trim(sBuffer);
if(!sBuffer[0]) SQL_ReadResult(query, 3, sBuffer, charsmax(sBuffer));
g_sUser[Access] = read_flags(sBuffer);
SQL_ReadResult(query, 4, sBuffer, charsmax(sBuffer)); g_sUser[Flags] = read_flags(sBuffer);
g_sUser[Expired] = SQL_ReadResult(query, 5);

ArrayPushArray(g_aUsers, g_sUser);
iLoadAdmins++;
SQL_NextRow(query);
}

new szText[128];
if(iLoadAdmins == 1)
formatex(szText, charsmax(szText), "Загружен 1 администратор из MySQL");
else formatex(szText, charsmax(szText), "Загружено %d администраторов из MySQL", iLoadAdmins);

if(dt[0] != 0) console_print(dt[0], szText);
log_amx(szText);

new pNum, players[32];
get_players(players, pNum);
for(new i; i < pNum; i++)
UserAccess(players);
BackUpAdmins();
}

public KickPlayer(const account[], id)
{
new usr = get_user_userid(id);
new szName[MAX_NAME_LENGTH]; get_user_name(id, szName, charsmax(szName));
new szAuth[25]; get_user_authid(id, szAuth, charsmax(szAuth));
new szIP[16]; get_user_ip(id, szIP, charsmax(szIP), 1);

server_cmd("kick #%d Invalid password! Use setinfo ^"%s^" ^"your pass^"", usr, g_szPassField);
log_amx("Login: ^"%s<%d><%s><>^" kicked due to invalid password (account ^"%s^") (address ^"%s^")",
szName, usr, szAuth, account, szIP);
}

public LoadMapConfigs()
{
new amxxcfgpath[64], map[32], fmt[64], prefix[32];
get_localinfo("amxx_configsdir", amxxcfgpath, charsmax(amxxcfgpath));
get_mapname(map, charsmax(map));
formatex(fmt, charsmax(fmt), "%s/maps/%s.cfg", amxxcfgpath, map);
if(file_exists(fmt)) ExecCfg(fmt);
else
{
strtok(map, prefix, charsmax(prefix), "", 0, '_');
formatex(fmt, charsmax(fmt), "%s/maps/prefix_%s.cfg", amxxcfgpath, prefix);
if(file_exists(fmt)) ExecCfg(fmt);
}
}

adminSql(id)
{
g_Data[0] = id;

formatex(g_szQuery, charsmax(g_szQuery), "SELECT \
`a`.`steamid`, \
`a`.`password`, \
`a`.`nickname`, \
`a`.`access`, \
`a`.`flags`, \
`a`.`expired`, \
`b`.`custom_flags` \
FROM `%s_amxadmins` AS `a`, `%s_admins_servers` AS `b` \
WHERE `b`.`admin_id` = `a`.`id` \
AND `b`.`server_id` = (SELECT `id` FROM `%s` WHERE `address` = '%s') \
AND (`a`.`days` = '0' OR `a`.`expired` > UNIX_TIMESTAMP(NOW()))",
g_szSqlData[Prefix], g_szSqlData[Prefix], g_szSqlData[ServerInfo], g_szServerData[IP]
);

SQL_ThreadQuery(g_hSqlTuple, "SQL_Handler", g_szQuery, g_Data, sizeof(g_Data));
}

UserAccess(id, name[32] = "")
{
remove_user_flags(id);

new authid[25]; get_user_authid(id, authid, charsmax(authid));
new ip[16]; get_user_ip(id, ip, charsmax(ip), 1);
if(!name[0]) get_user_name(id, name, charsmax(name));

for(new i, sFlags[30], Hash[34], password[33], aSize = ArraySize(g_aUsers); i < aSize; i++)
{
ArrayGetArray(g_aUsers, i, g_sUser);

if(g_sUser[Flags] & FLAG_AUTHID)
{
if(strcmp(authid, g_sUser[Auth]) != 0)
continue;
}
else if(g_sUser[Flags] & FLAG_IP)
{
if(strcmp(ip, g_sUser[Auth]) != 0)
continue;
}
else if(strcmp(name, g_sUser[Auth]) != 0)
continue;

g_iAdminExpired[id] = g_sUser[Expired];
get_flags(g_sUser[Access], sFlags, charsmax(sFlags));

if(g_sUser[Flags] & FLAG_NOPASS)
{
g_iPlayerFlags[id] = g_sUser[Access];

set_user_flags(id, g_sUser[Access]);
ExecuteFwd(id, g_sUser[Access], g_sUser[Expired]);
log_amx("Login: ^"%s<%d><%s><>^" became an admin (account ^"%s^") (nickname ^"%s^") (access ^"%s^") (address ^"%s^")",
name, get_user_userid(id), authid, g_sUser[Auth], g_sUser[Nick], sFlags, ip);
}
else
{
get_user_info(id, g_szPassField, password, charsmax(password));
#if AMXX_VERSION_NUM >= 183
hash_string(password, Hash_Md5, Hash, charsmax(Hash));
#else
md5(password, Hash);
#endif
if(strcmp(Hash, g_sUser[Passwd]) == 0)
{
set_user_flags(id, g_sUser[Access]);
ExecuteFwd(id, g_sUser[Access], g_sUser[Expired]);
log_amx("Login: ^"%s<%d><%s><>^" became an admin (account ^"%s^") (nickname ^"%s^") (access ^"%s^") (address ^"%s^")",
name, get_user_userid(id), authid, g_sUser[Auth], g_sUser[Nick], sFlags, ip);
}
else if(g_sUser[Flags] & FLAG_KICK)
set_task(0.2, "KickPlayer", id, g_sUser[Auth], sizeof g_sUser[Auth]);
}
return PLUGIN_HANDLED;
}

g_iAdminExpired[id] = -1;
g_iPlayerFlags[id] = g_bitDefaultAccess;
set_user_flags(id, g_bitDefaultAccess);
ExecuteFwd(id, g_bitDefaultAccess, g_iAdminExpired[id]);
return PLUGIN_HANDLED;
}

RegisterDefaultCvars()
{
register_cvar("amx_votekick_ratio", "0.40");
register_cvar("amx_voteban_ratio", "0.40");
register_cvar("amx_votemap_ratio", "0.40");
register_cvar("amx_vote_ratio", "0.02");
register_cvar("amx_vote_time", "10");
register_cvar("amx_vote_answers", "1");
register_cvar("amx_vote_delay", "60");
register_cvar("amx_last_voting", "0");
register_cvar("amx_show_activity", "2", FCVAR_PROTECTED);
register_cvar("amx_password_field", "_pw",FCVAR_PROTECTED);
#if defined CUSTOM_DEF_FLAG
register_cvar("amx_default_access", "z", FCVAR_PROTECTED);
#endif
register_cvar("admin_loader_version", PLUGIN_VERSION, FCVAR_SERVER | FCVAR_SPONLY);
}

RegisterSqlCfg()
{
register_cvar("amx_sql_table", "admins", FCVAR_PROTECTED);
register_cvar("amx_sql_host", "127.0.0.1", FCVAR_PROTECTED);
register_cvar("amx_sql_user", "root", FCVAR_PROTECTED);
register_cvar("amx_sql_pass", "", FCVAR_PROTECTED);
register_cvar("amx_sql_db", "amx", FCVAR_PROTECTED);
register_cvar("amx_sql_type", "mysql", FCVAR_PROTECTED);
}

RegisterFreshBans(fbcfg[])
{
g_iBanSystem = 1;
register_cvar("fb_sql_host", "", FCVAR_PROTECTED);
register_cvar("fb_sql_user", "", FCVAR_PROTECTED);
register_cvar("fb_sql_pass", "", FCVAR_PROTECTED);
register_cvar("fb_sql_db", "", FCVAR_PROTECTED);
register_cvar("fb_servers_table", "", FCVAR_PROTECTED);
register_cvar("fb_server_ip", "");
register_cvar("fb_server_port", "");
ExecCfg(fbcfg);
}

RegisterLiteBans(lbcfg[])
{
g_iBanSystem = 2;
register_cvar("lb_sql_host", "", FCVAR_PROTECTED);
register_cvar("lb_sql_user", "", FCVAR_PROTECTED);
register_cvar("lb_sql_pass", "", FCVAR_PROTECTED);
register_cvar("lb_sql_db", "", FCVAR_PROTECTED);
register_cvar("lb_sql_pref", "", FCVAR_PROTECTED);
register_cvar("lb_server_ip", "");
ExecCfg(lbcfg);
}

ExecConfigs(amxxcfgdir[])
{
new szFullDir[128];
formatex(szFullDir, charsmax(szFullDir), "%s/amxx.cfg", amxxcfgdir);
ExecCfg(szFullDir);
formatex(szFullDir, charsmax(szFullDir), "%s/sql.cfg", amxxcfgdir);
RegisterSqlCfg(); ExecCfg(szFullDir);

formatex(g_szBackupAdminPath, charsmax(g_szBackupAdminPath), "%s/users.ini", amxxcfgdir);
}

ReadCvars()
{
get_cvar_string("amx_password_field", g_szPassField, charsmax(g_szPassField));
#if defined CUSTOM_DEF_FLAG
new szDefaultAccess[32];
get_cvar_string("amx_default_access", szDefaultAccess, charsmax(szDefaultAccess));
g_bitDefaultAccess = read_flags(szDefaultAccess);
#endif
set_cvar_float("amx_last_voting", 0.0);
#if AMXX_VERSION_NUM < 183
set_task(6.1, "LoadMapConfigs");
#endif
}

RegForwards()
{
for(new plId, plNum = get_pluginsnum(); plId < plNum; plId++)
{
if(g_fwdHandle[AdminLoad] == INVALID_HANDLE)
{
if(get_func_id("client_admin", plId) != -1)
g_fwdHandle[AdminLoad] = CreateMultiForward("client_admin", ET_IGNORE, FP_CELL, FP_CELL);
}
else if(g_fwdHandle[AdminLoad2] == INVALID_HANDLE)
{
if(get_func_id("amxx_admin_access", plId) != -1)
g_fwdHandle[AdminLoad2] = CreateMultiForward("amxx_admin_access", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL);
}
}
}

SqlInit()
{
new sHost[32], sUser[32], sPasswd[64], sDbName[32];
switch(g_iBanSystem)
{
case 1:
{
get_cvar_string("fb_sql_host", sHost, charsmax(sHost));
get_cvar_string("fb_sql_user", sUser, charsmax(sUser));
get_cvar_string("fb_sql_pass", sPasswd, charsmax(sPasswd));
get_cvar_string("fb_sql_db", sDbName, charsmax(sDbName));

new ip[16]; get_cvar_string("fb_server_ip", ip, charsmax(ip));
new port[8]; get_cvar_string("fb_server_port", port, charsmax(port));
formatex(g_szServerData[IP], charsmax(g_szServerData[IP]), "%s:%s", ip, port);

get_cvar_string("fb_servers_table", g_szSqlData[ServerInfo], charsmax(g_szSqlData[ServerInfo]));
strtok(g_szSqlData[ServerInfo], g_szSqlData[Prefix], charsmax(g_szSqlData[Prefix]), "", 0, '_');
}
case 2:
{
get_cvar_string("lb_sql_host", sHost, charsmax(sHost));
get_cvar_string("lb_sql_user", sUser, charsmax(sUser));
get_cvar_string("lb_sql_pass", sPasswd, charsmax(sPasswd));
get_cvar_string("lb_sql_db", sDbName, charsmax(sDbName));

get_cvar_string("lb_server_ip", g_szServerData[IP], charsmax(g_szServerData[IP]));
get_cvar_string("lb_sql_pref", g_szSqlData[Prefix], charsmax(g_szSqlData[Prefix]));

formatex(g_szSqlData[ServerInfo], charsmax(g_szSqlData[ServerInfo]), "%s_serverinfo", g_szSqlData[Prefix]);
}
}

g_aUsers = ArrayCreate(UserInfo);

SQL_SetAffinity("mysql");
g_hSqlTuple = SQL_MakeDbTuple(sHost, sUser, sPasswd, sDbName, 1);


new errcode, errstr[128], Handle:hSqlTest = SQL_Connect(g_hSqlTuple, errcode, errstr, charsmax(errstr));
if(hSqlTest == Empty_Handle)
{
log_amx("[SQL ERROR #%d] %s", errcode, errstr);
LoadBackUp();
}
else
{
SQL_FreeHandle(hSqlTest);
#if AMXX_VERSION_NUM >= 183
SQL_SetCharset(g_hSqlTuple, "utf8");
#endif
adminSql(0);
}
}

ExecCfg(const cfg[])
{
server_cmd("exec %s", cfg);
server_exec();
}

ExecuteFwd(id, flags, timestamp)
{
new ret;
if(g_fwdHandle[AdminLoad] != INVALID_HANDLE)
ExecuteForward(g_fwdHandle[AdminLoad], ret, id, flags);
if(g_fwdHandle[AdminLoad2] != INVALID_HANDLE)
ExecuteForward(g_fwdHandle[AdminLoad2], ret, id, flags, timestamp);
}

BackUpAdmins()
{
unlink(g_szBackupAdminPath);

new fp = fopen(g_szBackupAdminPath, "w+");
new szDate[30]; get_time("%d.%m.%Y - %H:%M:%S", szDate, charsmax(szDate));
if(!fprintf(fp, "; BackUP SQL admins. Date %s ^n^n", szDate))
{
fclose(fp);
return;
}
for(new i, sAFlags[30], sCFlags[10], aSize = ArraySize(g_aUsers); i < aSize; i++)
{
ArrayGetArray(g_aUsers, i, g_sUser);
get_flags(g_sUser[Access], sAFlags, charsmax(sAFlags));
get_flags(g_sUser[Flags], sCFlags, charsmax(sCFlags));

fprintf(fp,
"^"%s^" ^"%s^" ^"%s^" ^"%s^" ^"%s^" ^"%d^"^n",
g_sUser[Auth], g_sUser[Passwd], sAFlags, sCFlags, g_sUser[Nick], g_sUser[Expired]
);
}
fclose(fp);
}

LoadBackUp()
{
new fp = fopen(g_szBackupAdminPath, "rt");
if(!fp)
{
new szError[190];
formatex(szError, charsmax(szError), "File '%s' not found OR chmod not correct!", g_szBackupAdminPath);
set_fail_state(szError);
}

new szBuffer[200];
new szBuff[3][64];
new load;
while(!feof(fp))
{
fgets(fp, szBuffer, charsmax(szBuffer));
trim(szBuffer);

if(!szBuffer[0] || szBuffer[0] == ';')
continue;

if(parse(szBuffer,
g_sUser[Auth], charsmax(g_sUser[Auth]),
g_sUser[Passwd], charsmax(g_sUser[Passwd]),
szBuff[0], charsmax(szBuff[]),
szBuff[1], charsmax(szBuff[]),
g_sUser[Nick], charsmax(g_sUser[Nick]),
szBuff[2], charsmax(szBuff[])
) == 6
)
{
g_sUser[Access] = read_flags(szBuff[0]);
g_sUser[Flags] = read_flags(szBuff[1]);
g_sUser[Expired]= str_to_num(szBuff[2]);

ArrayPushArray(g_aUsers, g_sUser);
load++;
}
}
fclose(fp);
log_amx("[Admin Loader] Загружен %d %s из BackUP users.ini", load, load == 1 ? "администратор" : "администраторов");
}

Код:
#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

//------------------------------------------ Конец настроек -----------------------------------------------//
#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_music;
new cvar_damage;
new cvar_awplimit;
#if defined EXP_SHOW
native admin_expired(index);
#endif
new vip_opened[33];
new g_iSyncMsg;
new g_iMaxPlayers = 0;
new msgSayText;
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");
#if defined(music)
cvar_music = get_pcvar_num(register_cvar("amx_vipMusic", "1"));
#endif
cvar_awplimit = get_pcvar_num(register_cvar("amx_awproundlimit", "3"));
cvar_damage = get_pcvar_num(register_cvar("amx_vipdamager", "1"));

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)
if(cvar_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);
ShowSyncHudMsg(0, g_iSyncMsg, (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() g_Round++;
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){
if(g_bBlockMap)
{
ChatColor(id, "%L", id, "VIP_WARNING6", string);
}
else
{
if(IsUserCool(id))
{
if(is_user_alive(id))
{
if(vip_opened[id] < cvar_open || cvar_open == 0)
{
if(g_Round >= cvar_round)
{
new szTitle[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");
#else
formatex(szTitle, charsmax(szTitle), "\rVIP-меню \w[\dby Wikiname\w]^n\wПривет, [\y%s\w]^n", 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);
}
else
ChatColor(id, "%L", id, "VIP_WARNING4", 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 раз(а)
И опишите проблему подробнее, а то сколько раз перечитал так и не понял что вы хотите
 
Сообщения
51
Реакции
5
Pokemoshka, в плагине есть функция, сколько дней осталось до окончания услуги VIP.
Её я именно и хочу включить!
 
Сообщения
51
Реакции
5
Именно. После установки плагина admin_loader 2.9 от неугомона и включения функции дней админка и вип пропала стоит их отключить как админка и вип снова начинают работать!
 

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

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