#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
#include <captain>
#include <lastrequest>
#include <franug_jb>
new Handle:cvar_ff;
public
OnPluginStart()
{
RegConsoleCmd("sm_menu", DOMenu);
RegConsoleCmd("buyammo2", DOMenu);
RegConsoleCmd("sm_simonmenu", DOsimon);
cvar_ff = FindConVar("mp_teammates_are_enemies");
}
public
Action:DOMenu(client,args)
{
new Handle:menu = CreateMenu(DIDMenuHandler);
SetMenuTitle(menu, "");
if("JC_GetCaptain"() == client) AddMenuItem(menu, "simonmenu", "Simon Menu");
else if(GetClientTeam(client) == CS_TEAM_CT) AddMenuItem(menu, "sersimon", "Be Simon");
/* if(GetClientTeam(client) == CS_TEAM_CT) AddMenuItem(menu, "tt", "Ser preso");
else if(GetClientTeam(client) == CS_TEAM_T) AddMenuItem(menu, "ct", "Ser guardia (Micro requerido)"); */
if(GetClientTeam(client) == CS_TEAM_CT) AddMenuItem(menu, "guns", "Choose weapons");
AddMenuItem(menu, "tienda", "Shop");
AddMenuItem(menu, "hats", "Hats Menu");
//AddMenuItem(menu, "normas", "Leer normas");
//AddMenuItem(menu, "admin", "Menu de Administrador");
SetMenuExitButton(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
public
DIDMenuHandler(Handle:menu, MenuAction:action, client, itemNum)
{
if ( action == MenuAction_Select )
{
new String:info[32];
GetMenuItem(menu, itemNum, info, sizeof(info));
/* if ( strcmp(info,"tt") == 0 )
{
ClientCommand(client, "jointeam %i", CS_TEAM_T);
DOMenu(client,0);
}
else if ( strcmp(info,"ct") == 0 )
{
ClientCommand(client, "jointeam %i", CS_TEAM_CT);
DOMenu(client,0);
} */
if ( strcmp(info,"guns") == 0 )
{
FakeClientCommand(client, "say !guns");
}
else if ( strcmp(info,"tienda") == 0 )
{
FakeClientCommand(client, "sm_awards");
}
else if ( strcmp(info,"hats") == 0 )
{
FakeClientCommand(client, "sm_hats");
}
else if ( strcmp(info,"normas") == 0 )
{
FakeClientCommand(client, "sm_rules");
//DOMenu(client,0);
}
else if ( strcmp(info,"admin") == 0 )
{
FakeClientCommand(client, "sm_admin");
}
else if ( strcmp(info,"simonmenu") == 0 )
{
FakeClientCommand(client, "sm_simonmenu");
}
else if ( strcmp(info,"sersimon") == 0 )
{
DOMenu(client,0);
FakeClientCommand(client, "sm_simon");
}
}
else if (
action == MenuAction_End)
{
CloseHandle(menu);
}
}
public
Action:DOsimon(client,args)
{
new Handle:menu = CreateMenu(DIDMenuHandlerS);
SetMenuTitle(menu, "Simon menu");
AddMenuItem(menu, "abrir", "Open jail doors");
AddMenuItem(menu, "cerrar", "Close jail doors");
AddMenuItem(menu, "fdall", "Give FreeDay to all");
AddMenuItem(menu, "fdone", "Give FreeDay to a player");
AddMenuItem(menu, "kill", "Kill a random Ts");
if(!
GetConVarBool(cvar_ff)) AddMenuItem(menu, "ffa1", "Enable friendly fire to Ts");
else AddMenuItem(menu, "ffa2", "Disable friendly fire to Ts");
AddMenuItem(menu, "nosimon", "Leave Simon");
SetMenuExitButton(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
public
DIDMenuHandlerS(Handle:menu, MenuAction:action, client, itemNum)
{
if ( action == MenuAction_Select )
{
if("JC_GetCaptain(") != client) return;
new
String:info[32];
GetMenuItem(menu, itemNum, info, sizeof(info));
if (
strcmp(info,"abrir") == 0 )
{
FakeClientCommand(client, "sm_open");
DOsimon(client,0);
}
else if ( strcmp(info,"cerrar") == 0 )
{
FakeClientCommand(client, "sm_close");
DOsimon(client,0);
}
else if ( strcmp(info,"fdall") == 0 )
{
FDTodos();
PrintToChatAll(" x04[] x05Simon given FreeDay to all!");
DOsimon(client,0);
}
else if ( strcmp(info,"fdone") == 0 )
{
FDone(client);
}
else if ( strcmp(info,"ffa1") == 0 )
{
SetCvar("mp_teammates_are_enemies", 1);
PrintToChatAll(" x04[] x05Simon enabled the friendly fire to Ts!");
DOsimon(client,0);
}
else if ( strcmp(info,"ffa2") == 0 )
{
SetCvar("mp_teammates_are_enemies", 0);
PrintToChatAll(" x04[] x05Simon Disabled the friendly fire to Ts!");
DOsimon(client,0);
}
else if ( strcmp(info,"kill") == 0 )
{
new ale = GetRandomPlayer(CS_TEAM_T);
if(ale > 0)
{
ForcePlayerSuicide(ale);
PrintToChatAll(" x04[] x05Simon killed randomly to %N", ale);
}
DOsimon(client,0);
}
else if ( strcmp(info,"nosimon") == 0 )
{
FakeClientCommand(client, "sm_nosimon");
DOMenu(client,0);
}
}
else if (
action == MenuAction_End)
{
CloseHandle(menu);
}
}
public
SetCvar(String:cvarName[64], value)
{
new Handle:cvar;
cvar = FindConVar(cvarName);
new
flags = GetConVarFlags(cvar);
flags &= ~FCVAR_NOTIFY;
SetConVarFlags(cvar, flags);
SetConVarInt(cvar, value);
flags |= FCVAR_NOTIFY;
SetConVarFlags(cvar, flags);
}
FDTodos()
{
for (new i = 1; i < MaxClients; i++)
if(IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T)
JB_GiveFD(i);
}
FDone(client)
{
new Handle:menu = CreateMenu(DIDMenuHandlerFD);
SetMenuTitle(menu, "Choose player to give FreeDay");
decl String:temp2[8], String:temp[128];
new cuenta = 0;
for (new i = 1; i < MaxClients; i++)
if(IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T && !JB_GetFD(i))
{
Format(temp, 128, "%N", i);
Format(temp2, 8, "%i", i);
AddMenuItem(menu, temp2, temp);
cuenta++;
}
SetMenuExitButton(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
if(
cuenta == 0)
{
PrintToChat(client, " x04[] x05No players for give FreeDay");
DOsimon(client,0);
}
}
public
DIDMenuHandlerFD(Handle:menu, MenuAction:action, client, itemNum)
{
if ( action == MenuAction_Select )
{
if("JC_GetCaptain"() != client) return;
new
String:info[32];
GetMenuItem(menu, itemNum, info, sizeof(info));
new
i = StringToInt(info);
if(IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T)
{
JB_GiveFD(i);
PrintToChatAll(" x04[] x05Simon Given FreeDay to %N", i);
DOsimon(client,0);
}
else
{
PrintToChat(client, " x04[] x05Target invalid. Choose other player");
FDone(client);
}
}
else if (
action == MenuAction_End)
{
CloseHandle(menu);
}
}
GetRandomPlayer(team)
{
new clients[MaxClients+1], clientCount;
for (new i = 1; i <= MaxClients; i++)
if (IsClientInGame(i) && GetClientTeam(i) == team) clients[clientCount++] = i;
return (
clientCount == 0) ? -1 : clients[GetRandomInt(0, clientCount-1)];
}
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
#include <captain>
#include <lastrequest>
#include <franug_jb>
new Handle:cvar_ff;
public
OnPluginStart()
{
RegConsoleCmd("sm_menu", DOMenu);
RegConsoleCmd("buyammo2", DOMenu);
RegConsoleCmd("sm_simonmenu", DOsimon);
cvar_ff = FindConVar("mp_teammates_are_enemies");
}
public
Action:DOMenu(client,args)
{
new Handle:menu = CreateMenu(DIDMenuHandler);
SetMenuTitle(menu, "");
if("JC_GetCaptain"() == client) AddMenuItem(menu, "simonmenu", "Simon Menu");
else if(GetClientTeam(client) == CS_TEAM_CT) AddMenuItem(menu, "sersimon", "Be Simon");
/* if(GetClientTeam(client) == CS_TEAM_CT) AddMenuItem(menu, "tt", "Ser preso");
else if(GetClientTeam(client) == CS_TEAM_T) AddMenuItem(menu, "ct", "Ser guardia (Micro requerido)"); */
if(GetClientTeam(client) == CS_TEAM_CT) AddMenuItem(menu, "guns", "Choose weapons");
AddMenuItem(menu, "tienda", "Shop");
AddMenuItem(menu, "hats", "Hats Menu");
//AddMenuItem(menu, "normas", "Leer normas");
//AddMenuItem(menu, "admin", "Menu de Administrador");
SetMenuExitButton(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
public
DIDMenuHandler(Handle:menu, MenuAction:action, client, itemNum)
{
if ( action == MenuAction_Select )
{
new String:info[32];
GetMenuItem(menu, itemNum, info, sizeof(info));
/* if ( strcmp(info,"tt") == 0 )
{
ClientCommand(client, "jointeam %i", CS_TEAM_T);
DOMenu(client,0);
}
else if ( strcmp(info,"ct") == 0 )
{
ClientCommand(client, "jointeam %i", CS_TEAM_CT);
DOMenu(client,0);
} */
if ( strcmp(info,"guns") == 0 )
{
FakeClientCommand(client, "say !guns");
}
else if ( strcmp(info,"tienda") == 0 )
{
FakeClientCommand(client, "sm_awards");
}
else if ( strcmp(info,"hats") == 0 )
{
FakeClientCommand(client, "sm_hats");
}
else if ( strcmp(info,"normas") == 0 )
{
FakeClientCommand(client, "sm_rules");
//DOMenu(client,0);
}
else if ( strcmp(info,"admin") == 0 )
{
FakeClientCommand(client, "sm_admin");
}
else if ( strcmp(info,"simonmenu") == 0 )
{
FakeClientCommand(client, "sm_simonmenu");
}
else if ( strcmp(info,"sersimon") == 0 )
{
DOMenu(client,0);
FakeClientCommand(client, "sm_simon");
}
}
else if (
action == MenuAction_End)
{
CloseHandle(menu);
}
}
public
Action:DOsimon(client,args)
{
new Handle:menu = CreateMenu(DIDMenuHandlerS);
SetMenuTitle(menu, "Simon menu");
AddMenuItem(menu, "abrir", "Open jail doors");
AddMenuItem(menu, "cerrar", "Close jail doors");
AddMenuItem(menu, "fdall", "Give FreeDay to all");
AddMenuItem(menu, "fdone", "Give FreeDay to a player");
AddMenuItem(menu, "kill", "Kill a random Ts");
if(!
GetConVarBool(cvar_ff)) AddMenuItem(menu, "ffa1", "Enable friendly fire to Ts");
else AddMenuItem(menu, "ffa2", "Disable friendly fire to Ts");
AddMenuItem(menu, "nosimon", "Leave Simon");
SetMenuExitButton(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
public
DIDMenuHandlerS(Handle:menu, MenuAction:action, client, itemNum)
{
if ( action == MenuAction_Select )
{
if("JC_GetCaptain(") != client) return;
new
String:info[32];
GetMenuItem(menu, itemNum, info, sizeof(info));
if (
strcmp(info,"abrir") == 0 )
{
FakeClientCommand(client, "sm_open");
DOsimon(client,0);
}
else if ( strcmp(info,"cerrar") == 0 )
{
FakeClientCommand(client, "sm_close");
DOsimon(client,0);
}
else if ( strcmp(info,"fdall") == 0 )
{
FDTodos();
PrintToChatAll(" x04[] x05Simon given FreeDay to all!");
DOsimon(client,0);
}
else if ( strcmp(info,"fdone") == 0 )
{
FDone(client);
}
else if ( strcmp(info,"ffa1") == 0 )
{
SetCvar("mp_teammates_are_enemies", 1);
PrintToChatAll(" x04[] x05Simon enabled the friendly fire to Ts!");
DOsimon(client,0);
}
else if ( strcmp(info,"ffa2") == 0 )
{
SetCvar("mp_teammates_are_enemies", 0);
PrintToChatAll(" x04[] x05Simon Disabled the friendly fire to Ts!");
DOsimon(client,0);
}
else if ( strcmp(info,"kill") == 0 )
{
new ale = GetRandomPlayer(CS_TEAM_T);
if(ale > 0)
{
ForcePlayerSuicide(ale);
PrintToChatAll(" x04[] x05Simon killed randomly to %N", ale);
}
DOsimon(client,0);
}
else if ( strcmp(info,"nosimon") == 0 )
{
FakeClientCommand(client, "sm_nosimon");
DOMenu(client,0);
}
}
else if (
action == MenuAction_End)
{
CloseHandle(menu);
}
}
public
SetCvar(String:cvarName[64], value)
{
new Handle:cvar;
cvar = FindConVar(cvarName);
new
flags = GetConVarFlags(cvar);
flags &= ~FCVAR_NOTIFY;
SetConVarFlags(cvar, flags);
SetConVarInt(cvar, value);
flags |= FCVAR_NOTIFY;
SetConVarFlags(cvar, flags);
}
FDTodos()
{
for (new i = 1; i < MaxClients; i++)
if(IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T)
JB_GiveFD(i);
}
FDone(client)
{
new Handle:menu = CreateMenu(DIDMenuHandlerFD);
SetMenuTitle(menu, "Choose player to give FreeDay");
decl String:temp2[8], String:temp[128];
new cuenta = 0;
for (new i = 1; i < MaxClients; i++)
if(IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T && !JB_GetFD(i))
{
Format(temp, 128, "%N", i);
Format(temp2, 8, "%i", i);
AddMenuItem(menu, temp2, temp);
cuenta++;
}
SetMenuExitButton(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
if(
cuenta == 0)
{
PrintToChat(client, " x04[] x05No players for give FreeDay");
DOsimon(client,0);
}
}
public
DIDMenuHandlerFD(Handle:menu, MenuAction:action, client, itemNum)
{
if ( action == MenuAction_Select )
{
if("JC_GetCaptain"() != client) return;
new
String:info[32];
GetMenuItem(menu, itemNum, info, sizeof(info));
new
i = StringToInt(info);
if(IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T)
{
JB_GiveFD(i);
PrintToChatAll(" x04[] x05Simon Given FreeDay to %N", i);
DOsimon(client,0);
}
else
{
PrintToChat(client, " x04[] x05Target invalid. Choose other player");
FDone(client);
}
}
else if (
action == MenuAction_End)
{
CloseHandle(menu);
}
}
GetRandomPlayer(team)
{
new clients[MaxClients+1], clientCount;
for (new i = 1; i <= MaxClients; i++)
if (IsClientInGame(i) && GetClientTeam(i) == team) clients[clientCount++] = i;
return (
clientCount == 0) ? -1 : clients[GetRandomInt(0, clientCount-1)];
}
Last edited by BloodBullet; 05-24-2020 at 13:36.
Reason: fix tag
0 / 0 / 0 Регистрация: 30.04.2007 Сообщений: 64 |
|
1 |
|
15.01.2010, 21:13. Показов 38702. Ответов 10
Доброго времени суток. Люди искал на форуме но так ничего не нашел… выходит ошибка insufficient memory и пользователь не может нормально работать до перезагрузки сервера… думал из за размеров индексов бд. бд-30 гб общий размер индексов 9 гб. есть представление с размером индекса в 800 мб. так же на сервере по событию запускаются агенты… Фоновый Агент на локальной машине пинает агент на серваке что бы пользователь не ждал… таким образом на серваке «рождается» больше объектов… количество клиентов около 150-200 чел. Люди SOS!!!! Кто знает просветите.
__________________
0 |
0 / 0 / 0 Регистрация: 04.11.2007 Сообщений: 3,019 |
|
17.01.2010, 10:23 |
2 |
MAdy
0 |
0 / 0 / 0 Регистрация: 30.04.2007 Сообщений: 64 |
|
17.01.2010, 10:51 |
3 |
MAdy клиент 6,5
0 |
0 / 0 / 0 Регистрация: 04.11.2007 Сообщений: 3,019 |
|
17.01.2010, 10:56 |
4 |
Фоновый Агент на локальной машине пинает агент на серваке что бы пользователь не ждал 150 человев одномоменто пинают сервак?
0 |
0 / 0 / 0 Регистрация: 30.04.2007 Сообщений: 64 |
|
17.01.2010, 11:01 |
5 |
не одновременно. дело в том что пользователи видят те доки которые им нужно видеть…. могут отписать док тому кто должен его увидеть соответственно, тот кто должен увидеть должен получить права, вот этот маленький агент запускается на клиентской машине в режиме run in background client thread. Он и запускает агент на серваке.
0 |
0 / 0 / 0 Регистрация: 15.12.2006 Сообщений: 641 |
|
17.01.2010, 13:34 |
6 |
Код обоих агентов в студию. Без этого врядли сможем что-то понять.
0 |
dyw |
|
25.01.2010, 11:07 |
7 |
insufficient memory — очень неприятная ошибка. Но мы ее получали только на клиенте (6.5, 7.0.x). Симптомы везде одинаковые: в форме при рефреше начинают пропадать кнопки, меняется шрифт (становится больше и жирным), в статус-баре пишется ошибка «insufficient memory». Получилось ли у Вас забороть или хотя бы понять из-за чего происходит ошибка? |
0 / 0 / 0 Регистрация: 30.04.2007 Сообщений: 64 |
|
25.01.2010, 20:17 |
8 |
у нас ошибка выходила не в статус баре, а MesssageBox-ом на рабочем месте клиента. Пока ситуация под контролем…
0 |
0 / 0 / 0 Регистрация: 04.11.2007 Сообщений: 3,019 |
|
26.01.2010, 09:49 |
9 |
MAdy 1. Сократили индексы представлений 1 — убили виды? многие ситуации можно пересматривать и предусматривать куда более грамотные варианты?
0 |
0 / 0 / 0 Регистрация: 30.04.2007 Сообщений: 64 |
|
26.01.2010, 17:46 |
10 |
1 — убили виды? не убили а создали дополнительные виды с другой сортировкой, до этого в видах была сортировка по заголовку. таких колонок было 4, размер индекса весил 800 Мб после создания дополнительного вида, размер индекса вида сал весить 300 Мб.
2 — ушли от использования агентов? Не ушли от использования было просто не правильно его запускать в таком виде… по сути, Агент работает не по действию RunOnServer, а по расписанию… insufficient memory — не стандартная ошибка. Еще она может выходит из за того что объекты не успевают удалиться с памяти….
0 |
0 / 0 / 0 Регистрация: 28.06.2009 Сообщений: 1,567 |
|
26.01.2010, 17:54 |
11 |
insufficient memory — не стандартная ошибка но достаточно популярная… примерно как cannot allocate space
0 |