выдал человеку вип, у меня стоит твой плагин по времени. Как он начинает действовать, в меня випки зайти нельзяНе понимаю о чем ты, но если у игрока имеется випка до выдачи по тайму, то его затрагивать не будет
Все норм работает, если человек с вип на сервере и начинается время бесплатной. то у меня все работает. Стоит ему выйти и его покупная випка не работает) пишешь вип и пишет что вы не имеете право пользованияпроверю
Либо же вовсе пропадает вип у всех игроков. Не могу через админку выдать себе и нет вип по времени.проверю
солидаренВипки (Выданные не этим плагином) пропадают, либо остаются но вип меню не открывается, с характерным таким звуком!
тоесть время допустим с 21 до 23 проходит,и даже те у кого изначально были вип перестают работать!
/**
* Developed by Ranch
* All rights reserved.
*
* P.S.: For fuck's sake, don't redistribute this plugin for CSGOLife and any affliated web-sites (such as PawnDev)!
* Original -> https://hlmod.ru/resources/vip-time-vip.222/
*/
#include <sourcemod>
#include <vip_core>
#pragma semicolon 1
#pragma newdecls required
#pragma tabsize 0
public Plugin myinfo =
{
name = "Multi Time Vip",
author = "JDW",
version = "1.0.2",
url = "JDW#0930"
};
int counter,
start[64][2],
end[64][2];
bool testTime,
pTests[MAXPLAYERS + 1];
char groups[64][128],
currentGroup[128];
public void OnPluginStart()
{
RegAdminCmd("mtv_reload", Command_ConfigReload, ADMFLAG_ROOT);
LoadTranslations("vip_modules.phrases");
}
public Action Command_ConfigReload(int client, int args)
{
ConfigLoad(client);
return Plugin_Handled;
}
public void VIP_OnClientLoaded(int client, bool isVip)
{
if(isVip)
{
return;
}
pTests[client] = false;
if(testTime)
{
if(VIP_IsValidVIPGroup(currentGroup))
{
VIP_GiveClientVIP(_, client, 0, currentGroup, false);
pTests[client] = true;
}
}
}
public void OnMapStart()
{
ConfigLoad();
CreateTimer(5.0, Timer_CheckTime, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
}
public Action Timer_CheckTime(Handle timer)
{
static char buffer[8];
static int current[2], index;
FormatTime(buffer, 8, "%H:%M");
GetIntDate(buffer, current);
index = -1;
testTime = false;
for(int i; i < counter; i++)
{
if(current[0] == start[i][0])
{
if(current[1] > start[i][1])
{
index = i;
break;
}
}
if(current[0] > start[i][0])
{
if(current[0] < end[i][0])
{
index = i;
break;
}
}
if(current[0] == end[i][0])
{
if(current[1] < start[i][1])
{
index = i;
break;
}
}
}
if(index != -1)
{
currentGroup = groups[index];
testTime = true;
for(int i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i) && !IsFakeClient(i) && !VIP_IsClientVIP(i))
{
VIP_OnClientLoaded(i, false);
}
}
}
else
{
for(int i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i) && pTests[i])
{
VIP_RemoveClientVIP2(_, i, false, true);
}
}
}
return Plugin_Continue;
}
void ConfigLoad(const int client = 0)
{
static char buffer[PLATFORM_MAX_PATH];
BuildPath(Path_SM, buffer, PLATFORM_MAX_PATH, "configs/mtv.ini");
KeyValues kv = new KeyValues("MTV");
if(!kv.ImportFromFile(buffer) || !kv.GotoFirstSubKey())
{
SetFailState("File (%s) not found", buffer);
}
kv.Rewind();
if(kv.GotoFirstSubKey())
{
counter = 0;
do
{
if(kv.GetSectionName(groups[counter], 128))
{
kv.GetString("start", buffer, PLATFORM_MAX_PATH);
GetIntDate(buffer, start[counter]);
kv.GetString("end", buffer, PLATFORM_MAX_PATH);
GetIntDate(buffer, end[counter]);
counter++;
}
}
while(kv.GotoNextKey(false));
}
if(client)
{
VIP_PrintToChatClient(client, "%T", "MTV Config Reload", client);
}
}
void GetIntDate(char[] time, int date[2])
{
date[1] = StringToInt(time[3]);
time[2] = 0;
date[0] = StringToInt(time);
}
Кто поможет модуль поправить?
После завершения бесплатного периода вип, випки слетают у всех.
Код:/** * Developed by Ranch * All rights reserved. * * P.S.: For fuck's sake, don't redistribute this plugin for CSGOLife and any affliated web-sites (such as PawnDev)! * Original -> https://hlmod.ru/resources/vip-time-vip.222/ */ #include <sourcemod> #include <vip_core> #pragma semicolon 1 #pragma newdecls required #pragma tabsize 0 public Plugin myinfo = { name = "Multi Time Vip", author = "JDW", version = "1.0.2", url = "JDW#0930" }; int counter, start[64][2], end[64][2]; bool testTime, pTests[MAXPLAYERS + 1]; char groups[64][128], currentGroup[128]; public void OnPluginStart() { RegAdminCmd("mtv_reload", Command_ConfigReload, ADMFLAG_ROOT); LoadTranslations("vip_modules.phrases"); } public Action Command_ConfigReload(int client, int args) { ConfigLoad(client); return Plugin_Handled; } public void VIP_OnClientLoaded(int client, bool isVip) { if(isVip) { return; } pTests[client] = false; if(testTime) { if(VIP_IsValidVIPGroup(currentGroup)) { VIP_GiveClientVIP(_, client, 0, currentGroup, false); pTests[client] = true; } } } public void OnMapStart() { ConfigLoad(); CreateTimer(5.0, Timer_CheckTime, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE); } public Action Timer_CheckTime(Handle timer) { static char buffer[8]; static int current[2], index; FormatTime(buffer, 8, "%H:%M"); GetIntDate(buffer, current); index = -1; testTime = false; for(int i; i < counter; i++) { if(current[0] == start[i][0]) { if(current[1] > start[i][1]) { index = i; break; } } if(current[0] > start[i][0]) { if(current[0] < end[i][0]) { index = i; break; } } if(current[0] == end[i][0]) { if(current[1] < start[i][1]) { index = i; break; } } } if(index != -1) { currentGroup = groups[index]; testTime = true; for(int i = 1; i <= MaxClients; i++) { if(IsClientInGame(i) && !IsFakeClient(i) && !VIP_IsClientVIP(i)) { VIP_OnClientLoaded(i, false); } } } else { for(int i = 1; i <= MaxClients; i++) { if(IsClientInGame(i) && pTests[i]) { VIP_RemoveClientVIP2(_, i, false, true); } } } return Plugin_Continue; } void ConfigLoad(const int client = 0) { static char buffer[PLATFORM_MAX_PATH]; BuildPath(Path_SM, buffer, PLATFORM_MAX_PATH, "configs/mtv.ini"); KeyValues kv = new KeyValues("MTV"); if(!kv.ImportFromFile(buffer) || !kv.GotoFirstSubKey()) { SetFailState("File (%s) not found", buffer); } kv.Rewind(); if(kv.GotoFirstSubKey()) { counter = 0; do { if(kv.GetSectionName(groups[counter], 128)) { kv.GetString("start", buffer, PLATFORM_MAX_PATH); GetIntDate(buffer, start[counter]); kv.GetString("end", buffer, PLATFORM_MAX_PATH); GetIntDate(buffer, end[counter]); counter++; } } while(kv.GotoNextKey(false)); } if(client) { VIP_PrintToChatClient(client, "%T", "MTV Config Reload", client); } } void GetIntDate(char[] time, int date[2]) { date[1] = StringToInt(time[3]); time[2] = 0; date[0] = StringToInt(time); }