Написание плагинов

Grey83

Ленивая и невнимательная жопа
Сообщения
4,823
Реакции
2,836
@LeXon, затрудняюсь сказать, но т.к. кода там много, то думаю, что займёт порядочно времени
 

Туник

Участник
Сообщения
529
Реакции
113
@HenryTownshand, спасибо я проверю!!!
--- Добавлено позже ---
@HenryTownshand, просто теперь проблема в том что нужно отчистить базу от игроков, так как они выбирали ножи и у них они есть, а новичкам это уже ограничено!
 
Последнее редактирование:

rokfestr

Участник
Сообщения
340
Реакции
51
Помогите добавить таймер на установку перчаток игрокам. Например, чтобы в начале раунда, после 5сек. устанавливало перчатки.
 

Вложения

  • gloves-1.0.3.zip
    75.5 КБ · Просмотры: 3

Mensi1337

Участник
Сообщения
236
Реакции
16
Добрый день, кто может из плагина vip вырезать функцию "Медик по команде", это функция восстанавливает HP у союзника при стрельбе в него (Event_PlayerHurt). Доступ только админу с флагом z.
 

Вложения

  • otryvok (1).sp
    464.4 КБ · Просмотры: 8

Kruzya

Raspberry Pi 4
Команда форума
Меценат
Сообщения
10,545
Реакции
8,723
@Mensi1337, Вы бы исходник лучше дали, а не декомпил.

P.S.: По одному размеру понятно, что это не исходник...
 

Kruzya

Raspberry Pi 4
Команда форума
Меценат
Сообщения
10,545
Реакции
8,723
@Mensi1337, декомпил, по сути, и так исходник. Отчасти.
Компилятор при компиляции вшивает в бинарник тонну нужного хлама для виртуалки.
Тут тоже самое.
Этот "исходник" придётся долго чистить, и не факт, что он потом ещё соберётся.
 

Mensi1337

Участник
Сообщения
236
Реакции
16
@Mensi1337, декомпил, по сути, и так исходник. Отчасти.
Компилятор при компиляции вшивает в бинарник тонну нужного хлама для виртуалки.
Тут тоже самое.
Этот "исходник" придётся долго чистить, и не факт, что он потом ещё соберётся.
Я понял тебя, а плагин "Медик по команде" большой что ли там? Если нет, то наверно не составит труда его вытащить ?
 

SIRIUS

Поставщик мусорного контента 🚮
Сообщения
453
Реакции
213
Помогите вырезать не нужные элементы в "Weapon & Knives 1.2.0" , нужно оставить только ножи и скин на них.
Пробовал сам вырезать, но скины не сохраняются, на след. карте или после перезахода сбрасываются.
В логах пишет :
  • [SM] [0] DBResultSet.FetchInt
  • L 10/14/2018 - 03:02:14: [SM] [1] Line 62, weapons/database.sp::T_GetPlayerDataCallback
вырезал в:
globals.sp
/* CS:GO Weapons&Knives SourceMod Plugin
*
* Copyright (C) 2017 Kağan 'kgns' Üstüngel
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see Licenses - GNU Project - Free Software Foundation.
*/

char g_WeaponClasses[][] = {
/* 0*/ "OwnKnife", /* 1*/ "weapon_knife_karambit", /* 2*/ "weapon_knife_m9_bayonet", /* 3*/ "weapon_bayonet",
/* 4*/ "weapon_knife_survival_bowie", /* 5*/ "weapon_knife_butterfly", /* 6*/ "weapon_knife_flip", /* 7*/ "weapon_knife_push", /* 8*/ "weapon_knife_tactical", /* 9*/ "weapon_knife_falchion", /*10*/ "weapon_knife_gut",
/*11*/ "weapon_knife_ursus", /*12*/ "weapon_knife_gypsy_jackknife", /*13*/ "weapon_knife_stiletto", /*14*/ "weapon_knife_widowmaker"
};

int g_iWeaponDefIndex[] = {
/* 0*/ 0, /* 1*/ 507, /* 2*/ 508, /* 3*/ 500,
/* 4*/ 514, /* 5*/ 515, /* 6*/ 505, /* 7*/ 516, /* 8*/ 509, /* 9*/ 512, /*10*/ 506,
/*11*/ 519, /*12*/ 520, /*13*/ 522, /*14*/ 523
};

const int MAX_LANG = 40;

Database db = null;

char configPath[PLATFORM_MAX_PATH];

ConVar g_Cvar_DBConnection;
char g_DBConnection[32];
char g_DBConnectionOld[32];

ConVar g_Cvar_TablePrefix;
char g_TablePrefix[10];

ConVar g_Cvar_ChatPrefix;
char g_ChatPrefix[32];

ConVar g_Cvar_FloatIncrementSize;
float g_fFloatIncrementSize;
int g_iFloatIncrementPercentage;

ConVar g_Cvar_KnifeStatTrakMode;
int g_iKnifeStatTrakMode;

ConVar g_Cvar_EnableFloat;
bool g_bEnableFloat;

ConVar g_Cvar_EnableNameTag;
bool g_bEnableNameTag;

ConVar g_Cvar_EnableStatTrak;
bool g_bEnableStatTrak;

ConVar g_Cvar_EnableWeaponOverwrite;
bool g_bOverwriteEnabled;

ConVar g_Cvar_GracePeriod;
int g_iGracePeriod;

ConVar g_Cvar_InactiveDays;
int g_iGraceInactiveDays;

int g_iSkins[MAXPLAYERS+1][sizeof(g_WeaponClasses)];
int g_iStatTrak[MAXPLAYERS+1][sizeof(g_WeaponClasses)];
int g_iStatTrakCount[MAXPLAYERS+1][sizeof(g_WeaponClasses)];
char g_NameTag[MAXPLAYERS+1][sizeof(g_WeaponClasses)][128];
float g_fFloatValue[MAXPLAYERS+1][sizeof(g_WeaponClasses)];

int g_iIndex[MAXPLAYERS+1] = { 0, ... };
Handle g_FloatTimer[MAXPLAYERS+1] = { INVALID_HANDLE, ... };
int g_iSteam32[MAXPLAYERS+1] = { 0, ... };

bool g_bWaitingForNametag[MAXPLAYERS+1] = { false, ... };

int g_iKnife[MAXPLAYERS+1] = { 0, ... };

int g_iRoundStartTime = 0;

char g_Language[MAX_LANG][32];
int g_iClientLanguage[MAXPLAYERS+1];
Menu menuWeapons[MAX_LANG][sizeof(g_WeaponClasses)];

StringMap g_smWeaponIndex;
StringMap g_smWeaponDefIndex;
StringMap g_smLanguageIndex;
menus.sp
/* CS:GO Weapons&Knives SourceMod Plugin
*
* Copyright (C) 2017 Kağan 'kgns' Üstüngel
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see Licenses - GNU Project - Free Software Foundation.
*/

public int WeaponsMenuHandler(Menu menu, MenuAction action, int client, int selection)
{
switch(action)
{
case MenuAction_Select:
{
if(IsClientInGame(client))
{
int index = g_iIndex[client];

char skinIdStr[32];
menu.GetItem(selection, skinIdStr, sizeof(skinIdStr));
int skinId = StringToInt(skinIdStr);

g_iSkins[client][index] = skinId;
char updateFields[256];
char weaponName[32];
RemoveWeaponPrefix(g_WeaponClasses[index], weaponName, sizeof(weaponName));
Format(updateFields, sizeof(updateFields), "%s = %d", weaponName, skinId);
UpdatePlayerData(client, updateFields);

RefreshWeapon(client, index);

DataPack pack;
CreateDataTimer(0.5, WeaponsMenuTimer, pack);
pack.WriteCell(menu);
pack.WriteCell(GetClientUserId(client));
pack.WriteCell(GetMenuSelectionPosition());
}
}
case MenuAction_DisplayItem:
{
if(IsClientInGame(client))
{
char info[32];
char display[64];
menu.GetItem(selection, info, sizeof(info));

if (StrEqual(info, "0"))
{
Format(display, sizeof(display), "%T", "DefaultSkin", client);
return RedrawMenuItem(display);
}
else if (StrEqual(info, "-1"))
{
Format(display, sizeof(display), "%T", "RandomSkin", client);
return RedrawMenuItem(display);
}
}
}
case MenuAction_Cancel:
{
if (IsClientInGame(client) && selection == MenuCancel_ExitBack)
{
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateWeaponMenu(client).Display(client, menuTime);
}
}
}
}
return 0;
}

public Action WeaponsMenuTimer(Handle timer, DataPack pack)
{
ResetPack(pack);
Menu menu = pack.ReadCell();
int clientIndex = GetClientOfUserId(pack.ReadCell());
int menuSelectionPosition = pack.ReadCell();

if(IsClientInGame(clientIndex))
{
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(clientIndex)) >= 0)
{
menu.DisplayAt(clientIndex, menuSelectionPosition, menuTime);
}
}
}

public int WeaponMenuHandler(Menu menu, MenuAction action, int client, int selection)
{
switch(action)
{
case MenuAction_Select:
{
if(IsClientInGame(client))
{
char buffer[30];
menu.GetItem(selection, buffer, sizeof(buffer));
if(StrEqual(buffer, "skin"))
{
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
menuWeapons[g_iClientLanguage[client]][g_iIndex[client]].Display(client, menuTime);
}
}
else if(StrEqual(buffer, "float"))
{
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateFloatMenu(client).Display(client, menuTime);
}
}
else if(StrEqual(buffer, "stattrak"))
{
g_iStatTrak[client][g_iIndex[client]] = 1 - g_iStatTrak[client][g_iIndex[client]];
char updateFields[256];
char weaponName[32];
RemoveWeaponPrefix(g_WeaponClasses[g_iIndex[client]], weaponName, sizeof(weaponName));
Format(updateFields, sizeof(updateFields), "%s_trak = %d", weaponName, g_iStatTrak[client][g_iIndex[client]]);
UpdatePlayerData(client, updateFields);

RefreshWeapon(client, g_iIndex[client]);

CreateTimer(1.0, StatTrakMenuTimer, GetClientUserId(client));
}
else if(StrEqual(buffer, "nametag"))
{
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateNameTagMenu(client).Display(client, menuTime);
}
}
}
}
case MenuAction_Cancel:
{
if(IsClientInGame(client) && selection == MenuCancel_ExitBack)
{
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateMainMenu(client).Display(client, menuTime);
}
}
}
case MenuAction_End:
{
delete menu;
}
}
}

public Action StatTrakMenuTimer(Handle timer, int userid)
{
int clientIndex = GetClientOfUserId(userid);
if(IsClientInGame(clientIndex))
{
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(clientIndex)) >= 0)
{
CreateWeaponMenu(clientIndex).Display(clientIndex, menuTime);
}
}
}

Menu CreateFloatMenu(int client)
{
char buffer[60];
Menu menu = new Menu(FloatMenuHandler);

float fValue = g_fFloatValue[client][g_iIndex[client]];
fValue = fValue * 100.0;
int wear = 100 - RoundFloat(fValue);

menu.SetTitle("%T%d%%", "SetFloat", client, wear);

Format(buffer, sizeof(buffer), "%T", "Increase", client, g_iFloatIncrementPercentage);
menu.AddItem("increase", buffer, wear == 100 ? ITEMDRAW_DISABLED : ITEMDRAW_DEFAULT);

Format(buffer, sizeof(buffer), "%T", "Decrease", client, g_iFloatIncrementPercentage);
menu.AddItem("decrease", buffer, wear == 0 ? ITEMDRAW_DISABLED : ITEMDRAW_DEFAULT);

menu.ExitBackButton = true;

return menu;
}

public int FloatMenuHandler(Menu menu, MenuAction action, int client, int selection)
{
switch(action)
{
case MenuAction_Select:
{
if(IsClientInGame(client))
{
char buffer[30];
menu.GetItem(selection, buffer, sizeof(buffer));
if(StrEqual(buffer, "increase"))
{
g_fFloatValue[client][g_iIndex[client]] = g_fFloatValue[client][g_iIndex[client]] - g_fFloatIncrementSize;
if(g_fFloatValue[client][g_iIndex[client]] < 0.0)
{
g_fFloatValue[client][g_iIndex[client]] = 0.0;
}
if(g_FloatTimer[client] != INVALID_HANDLE)
{
KillTimer(g_FloatTimer[client]);
g_FloatTimer[client] = INVALID_HANDLE;
}
DataPack pack;
g_FloatTimer[client] = CreateDataTimer(1.0, FloatTimer, pack);
pack.WriteCell(GetClientUserId(client));
pack.WriteCell(g_iIndex[client]);
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateFloatMenu(client).Display(client, menuTime);
}
}
else if(StrEqual(buffer, "decrease"))
{
g_fFloatValue[client][g_iIndex[client]] = g_fFloatValue[client][g_iIndex[client]] + g_fFloatIncrementSize;
if(g_fFloatValue[client][g_iIndex[client]] > 1.0)
{
g_fFloatValue[client][g_iIndex[client]] = 1.0;
}
if(g_FloatTimer[client] != INVALID_HANDLE)
{
KillTimer(g_FloatTimer[client]);
g_FloatTimer[client] = INVALID_HANDLE;
}
DataPack pack;
g_FloatTimer[client] = CreateDataTimer(1.0, FloatTimer, pack);
pack.WriteCell(GetClientUserId(client));
pack.WriteCell(g_iIndex[client]);
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateFloatMenu(client).Display(client, menuTime);
}
}
}
}
case MenuAction_Cancel:
{
if(IsClientInGame(client) && selection == MenuCancel_ExitBack)
{
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateWeaponMenu(client).Display(client, menuTime);
}
}
}
case MenuAction_End:
{
delete menu;
}
}
}

public Action FloatTimer(Handle timer, DataPack pack)
{

ResetPack(pack);
int clientIndex = GetClientOfUserId(pack.ReadCell());
int index = pack.ReadCell();

if(IsClientInGame(clientIndex))
{
char updateFields[256];
char weaponName[32];
RemoveWeaponPrefix(g_WeaponClasses[index], weaponName, sizeof(weaponName));
Format(updateFields, sizeof(updateFields), "%s_float = %.2f", weaponName, g_fFloatValue[clientIndex][g_iIndex[clientIndex]]);
UpdatePlayerData(clientIndex, updateFields);

RefreshWeapon(clientIndex, index);
}

g_FloatTimer[clientIndex] = INVALID_HANDLE;
}

Menu CreateNameTagMenu(int client)
{
Menu menu = new Menu(NameTagMenuHandler);

char buffer[128];

StripHtml(g_NameTag[client][g_iIndex[client]], buffer, sizeof(buffer));
menu.SetTitle("%T: %s", "SetNameTag", client, buffer);

Format(buffer, sizeof(buffer), "%T", "ChangeNameTag", client);
menu.AddItem("nametag", buffer);

/* NAMETAGCOLOR
Format(buffer, sizeof(buffer), "%T", "NameTagColor", client);
menu.AddItem("color", buffer, strlen(g_NameTag[client][g_iIndex[client]]) > 0 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
*/

Format(buffer, sizeof(buffer), "%T", "DeleteNameTag", client);
menu.AddItem("delete", buffer, strlen(g_NameTag[client][g_iIndex[client]]) > 0 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);

menu.ExitBackButton = true;

return menu;
}

public int NameTagMenuHandler(Menu menu, MenuAction action, int client, int selection)
{
switch(action)
{
case MenuAction_Select:
{
if(IsClientInGame(client))
{
char buffer[30];
menu.GetItem(selection, buffer, sizeof(buffer));
if(StrEqual(buffer, "nametag"))
{
g_bWaitingForNametag[client] = true;
PrintToChat(client, " %s \x04%t", g_ChatPrefix, "NameTagInstruction");
}
/* NAMETAGCOLOR
else if(StrEqual(buffer, "color"))
{
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateColorsMenu(client).Display(client, menuTime);
}
}
*/
else if(StrEqual(buffer, "delete"))
{
g_NameTag[client][g_iIndex[client]] = "";

char updateFields[256];
char weaponName[32];
RemoveWeaponPrefix(g_WeaponClasses[g_iIndex[client]], weaponName, sizeof(weaponName));
Format(updateFields, sizeof(updateFields), "%s_tag = ''", weaponName);
UpdatePlayerData(client, updateFields);

RefreshWeapon(client, g_iIndex[client]);

int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateWeaponMenu(client).Display(client, menuTime);
}
}
}
}
case MenuAction_Cancel:
{
if(IsClientInGame(client) && selection == MenuCancel_ExitBack)
{
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateWeaponMenu(client).Display(client, menuTime);
}
}
}
case MenuAction_End:
{
delete menu;
}
}
}

/* NAMETAGCOLOR
Menu CreateColorsMenu(int client)
{
Menu menu = new Menu(ColorsMenuHandler);
menu.SetTitle("%T", "ChooseColor", client);

char buffer[128];

Format(buffer, sizeof(buffer), "%T", "DefaultColor", client);
menu.AddItem("default", buffer);

Format(buffer, sizeof(buffer), "%T", "Black", client);
menu.AddItem("000000", buffer);

Format(buffer, sizeof(buffer), "%T", "Yellow", client);
menu.AddItem("FFFF00", buffer);

Format(buffer, sizeof(buffer), "%T", "Red", client);
menu.AddItem("FF0000", buffer);

Format(buffer, sizeof(buffer), "%T", "Green", client);
menu.AddItem("00FF00", buffer);

Format(buffer, sizeof(buffer), "%T", "Blue", client);
menu.AddItem("0000AA", buffer);

menu.ExitBackButton = true;

return menu;
}

public int ColorsMenuHandler(Menu menu, MenuAction action, int client, int selection)
{
switch(action)
{
case MenuAction_Select:
{
if(IsClientInGame(client))
{
char buffer[30];
menu.GetItem(selection, buffer, sizeof(buffer));

char stripped[128];
char escaped[257];
char colored[128];
char updateFields[512];
StripHtml(g_NameTag[client][g_iIndex[client]], stripped, sizeof(stripped));
if (StrEqual(buffer, "default"))
{
g_NameTag[client][g_iIndex[client]] = stripped;

db.Escape(stripped, escaped, sizeof(escaped));
}
else
{
Format(colored, sizeof(colored), "<font color='#%s'>%s</font>", buffer, stripped);
g_NameTag[client][g_iIndex[client]] = colored;

db.Escape(colored, escaped, sizeof(escaped));
}

char weaponName[32];
RemoveWeaponPrefix(g_WeaponClasses[g_iIndex[client]], weaponName, sizeof(weaponName));
Format(updateFields, sizeof(updateFields), "%s_tag = '%s'", weaponName, escaped);
UpdatePlayerData(client, updateFields);

RefreshWeapon(client, g_iIndex[client]);

CreateTimer(1.0, NameTagColorsMenuTimer, GetClientUserId(client));
}
}
case MenuAction_Cancel:
{
if(IsClientInGame(client) && selection == MenuCancel_ExitBack)
{
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateNameTagMenu(client).Display(client, menuTime);
}
}
}
case MenuAction_End:
{
delete menu;
}
}
}

public Action NameTagColorsMenuTimer(Handle timer, int userid)
{
int clientIndex = GetClientOfUserId(userid);
if(IsClientInGame(clientIndex))
{
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(clientIndex)) >= 0)
{
CreateColorsMenu(clientIndex).Display(clientIndex, menuTime);
}
}
}
*/

Menu CreateAllWeaponsMenu(int client)
{
Menu menu = new Menu(AllWeaponsMenuHandler);
menu.SetTitle("%T", "AllWeaponsMenuTitle", client);

char name[32];
for (int i = 0; i < sizeof(g_WeaponClasses); i++)
{
Format(name, sizeof(name), "%T", g_WeaponClasses, client);
menu.AddItem(g_WeaponClasses, name);
}

menu.ExitBackButton = true;

return menu;
}

public int AllWeaponsMenuHandler(Menu menu, MenuAction action, int client, int selection)
{
switch(action)
{
case MenuAction_Select:
{
if(IsClientInGame(client))
{
char class[30];
menu.GetItem(selection, class, sizeof(class));

g_smWeaponIndex.GetValue(class, g_iIndex[client]);
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateWeaponMenu(client).Display(client, menuTime);
}
}
}
case MenuAction_Cancel:
{
if(IsClientInGame(client) && selection == MenuCancel_ExitBack)
{
int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateMainMenu(client).Display(client, menuTime);
}
}
}
case MenuAction_End:
{
delete menu;
}
}
}

Menu CreateWeaponMenu(int client)
{
int index = g_iIndex[client];

Menu menu = new Menu(WeaponMenuHandler);
menu.SetTitle("%T", g_WeaponClasses[index], client);

char buffer[128];

Format(buffer, sizeof(buffer), "%T", "SetSkin", client);
menu.AddItem("skin", buffer);

bool weaponHasSkin = (g_iSkins[client][index] != 0);

if (g_bEnableFloat)
{
float fValue = g_fFloatValue[client][index];
fValue = fValue * 100.0;
int wear = 100 - RoundFloat(fValue);
Format(buffer, sizeof(buffer), "%T%d%%", "SetFloat", client, wear);
menu.AddItem("float", buffer, weaponHasSkin ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
}

if (g_bEnableStatTrak)
{
if (g_iStatTrak[client][index] == 1)
{
Format(buffer, sizeof(buffer), "%T%T", "StatTrak", client, "On", client);
}
else
{
Format(buffer, sizeof(buffer), "%T%T", "StatTrak", client, "Off", client);
}
menu.AddItem("stattrak", buffer, weaponHasSkin ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
}

if (g_bEnableNameTag)
{
Format(buffer, sizeof(buffer), "%T", "SetNameTag", client);
menu.AddItem("nametag", buffer, weaponHasSkin ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
}

menu.ExitBackButton = true;

return menu;
}

public int MainMenuHandler(Menu menu, MenuAction action, int client, int selection)
{
switch(action)
{
case MenuAction_Select:
{
if(IsClientInGame(client))
{
char info[32];
menu.GetItem(selection, info, sizeof(info));
int menuTime;
if(StrEqual(info, "all"))
{
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateAllWeaponsMenu(client).Display(client, menuTime);
}
}
else if(StrEqual(info, "lang"))
{
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateLanguageMenu(client).Display(client, menuTime);
}
}
else
{
g_smWeaponIndex.GetValue(info, g_iIndex[client]);
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateWeaponMenu(client).Display(client, menuTime);
}
}
}
}
case MenuAction_End:
{
delete menu;
}
}
}

Menu CreateMainMenu(int client)
{
char buffer[60];
Menu menu = new Menu(MainMenuHandler, MENU_ACTIONS_DEFAULT);

menu.SetTitle("%T", "WSMenuTitle", client);

Format(buffer, sizeof(buffer), "%T", "ConfigAllWeapons", client);
menu.AddItem("all", buffer);

int index = 2;

if (IsPlayerAlive(client))
{
char weaponClass[32];
char weaponName[32];

int size = GetEntPropArraySize(client, Prop_Send, "m_hMyWeapons");

for (int i = 0; i < size; i++)
{
int weaponEntity = GetEntPropEnt(client, Prop_Send, "m_hMyWeapons", i);
if(weaponEntity != -1 && GetWeaponClass(weaponEntity, weaponClass, sizeof(weaponClass)))
{
Format(weaponName, sizeof(weaponName), "%T", weaponClass, client);
menu.AddItem(weaponClass, weaponName, (IsKnifeClass(weaponClass) && g_iKnife[client] == 0) ? ITEMDRAW_DISABLED : ITEMDRAW_DEFAULT);
index++;
}
}
}

for(int i = index; i < 6; i++)
{
menu.AddItem("", "", ITEMDRAW_SPACER);
}

Format(buffer, sizeof(buffer), "%T", "ChangeLang", client);
menu.AddItem("lang", buffer);

return menu;
}

Menu CreateKnifeMenu(int client)
{
Menu menu = new Menu(KnifeMenuHandler);
menu.SetTitle("%T", "KnifeMenuTitle", client);

char buffer[60];
Format(buffer, sizeof(buffer), "%T", "OwnKnife", client);
menu.AddItem("0", buffer, g_iKnife[client] != 0 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
Format(buffer, sizeof(buffer), "%T", "weapon_knife_ursus", client);
menu.AddItem("11", buffer, g_iKnife[client] != 11 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
Format(buffer, sizeof(buffer), "%T", "weapon_knife_gypsy_jackknife", client);
menu.AddItem("12", buffer, g_iKnife[client] != 12 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
Format(buffer, sizeof(buffer), "%T", "weapon_knife_stiletto", client);
menu.AddItem("13", buffer, g_iKnife[client] != 13 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
Format(buffer, sizeof(buffer), "%T", "weapon_knife_widowmaker", client);
menu.AddItem("14", buffer, g_iKnife[client] != 14 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
Format(buffer, sizeof(buffer), "%T", "weapon_knife_karambit", client);
menu.AddItem(" 1", buffer, g_iKnife[client] != 1 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
Format(buffer, sizeof(buffer), "%T", "weapon_knife_m9_bayonet", client);
menu.AddItem(" 2", buffer, g_iKnife[client] != 2 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
Format(buffer, sizeof(buffer), "%T", "weapon_bayonet", client);
menu.AddItem(" 3", buffer, g_iKnife[client] != 3 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
Format(buffer, sizeof(buffer), "%T", "weapon_knife_survival_bowie", client);
menu.AddItem(" 4", buffer, g_iKnife[client] != 4 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
Format(buffer, sizeof(buffer), "%T", "weapon_knife_butterfly", client);
menu.AddItem(" 5", buffer, g_iKnife[client] != 5 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
Format(buffer, sizeof(buffer), "%T", "weapon_knife_flip", client);
menu.AddItem(" 6", buffer, g_iKnife[client] != 6 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
Format(buffer, sizeof(buffer), "%T", "weapon_knife_push", client);
menu.AddItem(" 7", buffer, g_iKnife[client] != 7 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
Format(buffer, sizeof(buffer), "%T", "weapon_knife_tactical", client);
menu.AddItem(" 8", buffer, g_iKnife[client] != 8 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
Format(buffer, sizeof(buffer), "%T", "weapon_knife_falchion", client);
menu.AddItem(" 9", buffer, g_iKnife[client] != 9 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
Format(buffer, sizeof(buffer), "%T", "weapon_knife_gut", client);
menu.AddItem("10", buffer, g_iKnife[client] != 10 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
return menu;
}

public int KnifeMenuHandler(Menu menu, MenuAction action, int client, int selection)
{
switch(action)
{
case MenuAction_Select:
{
if(IsClientInGame(client))
{
char knifeIdStr[32];
menu.GetItem(selection, knifeIdStr, sizeof(knifeIdStr));
int knifeId = StringToInt(knifeIdStr);

g_iKnife[client] = knifeId;
char updateFields[50];
Format(updateFields, sizeof(updateFields), "knife = %d", knifeId);
UpdatePlayerData(client, updateFields);

RefreshWeapon(client, knifeId, knifeId == 0);

int menuTime;
if((menuTime = GetRemainingGracePeriodSeconds(client)) >= 0)
{
CreateKnifeMenu(client).DisplayAt(client, GetMenuSelectionPosition(), menuTime);
}
}
}
case MenuAction_End:
{
delete menu;
}
}
}

Menu CreateLanguageMenu(int client)
{
Menu menu = new Menu(LanguageMenuHandler);
menu.SetTitle("%T", "ChooseLanguage", client);

char buffer[4];

for (int i = 0; i < sizeof(g_Language); i++)
{
if(strlen(g_Language) == 0)
break;
IntToString(i, buffer, sizeof(buffer));
menu.AddItem(buffer, g_Language);
}

return menu;
}

public int LanguageMenuHandler(Menu menu, MenuAction action, int client, int selection)
{
switch(action)
{
case MenuAction_Select:
{
if(IsClientInGame(client))
{
char langIndexStr[4];
menu.GetItem(selection, langIndexStr, sizeof(langIndexStr));
int langIndex = StringToInt(langIndexStr);

g_iClientLanguage[client] = langIndex;
}
}
case MenuAction_End:
{
delete menu;
}
}
}
database.sp
/* CS:GO Weapons&Knives SourceMod Plugin
*
* Copyright (C) 2017 Kağan 'kgns' Üstüngel
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see Licenses - GNU Project - Free Software Foundation.
*/

void GetPlayerData(int client)
{
char steamid[32];
GetClientAuthId(client, AuthId_Steam2, steamid, sizeof(steamid), true);
char query[255];
FormatEx(query, sizeof(query), "SELECT * FROM %sweapons WHERE steamid = '%s'", g_TablePrefix, steamid);
db.Query(T_GetPlayerDataCallback, query, GetClientUserId(client));
}

public void T_GetPlayerDataCallback(Database database, DBResultSet results, const char[] error, int userid)
{
int clientIndex = GetClientOfUserId(userid);
if(IsValidClient(clientIndex))
{
if (results == null)
{
LogError("Query failed! %s", error);
}
else if (results.RowCount == 0)
{
char steamid[32];
GetClientAuthId(clientIndex, AuthId_Steam2, steamid, sizeof(steamid), true);
char query[255];
FormatEx(query, sizeof(query), "INSERT INTO %sweapons (steamid) VALUES ('%s')", g_TablePrefix, steamid);
DataPack pack = new DataPack();
pack.WriteString(steamid);
pack.WriteString(query);
db.Query(T_InsertCallback, query, pack);
for(int i = 0; i < sizeof(g_WeaponClasses); i++)
{
g_iSkins[clientIndex] = 0;
g_iStatTrak[clientIndex] = 0;
g_iStatTrakCount[clientIndex] = 0;
g_NameTag[clientIndex] = "";
g_fFloatValue[clientIndex] = 0.0;
}
g_iKnife[clientIndex] = 0;
}
else
{
if(results.FetchRow())
{
for(int i = 2, j = 0; j < sizeof(g_WeaponClasses); i += 5, j++)
{
g_iSkins[clientIndex][j] = results.FetchInt(i);
g_fFloatValue[clientIndex][j] = results.FetchFloat(i + 1);
g_iStatTrak[clientIndex][j] = results.FetchInt(i + 2);
g_iStatTrakCount[clientIndex][j] = results.FetchInt(i + 3);
results.FetchString(i + 4, g_NameTag[clientIndex][j], 128);
}
g_iKnife[clientIndex] = results.FetchInt(1);
}
char steamid[32];
GetClientAuthId(clientIndex, AuthId_Steam2, steamid, sizeof(steamid), true);
char query[255];
FormatEx(query, sizeof(query), "REPLACE INTO %sweapons_timestamps (steamid, last_seen) VALUES ('%s', %d)", g_TablePrefix, steamid, GetTime());
DataPack pack = new DataPack();
pack.WriteString(query);
db.Query(T_TimestampCallback, query, pack);
}
}
}

public void T_InsertCallback(Database database, DBResultSet results, const char[] error, DataPack pack)
{
pack.Reset();
char steamid[32];
pack.ReadString(steamid, 32);
if (results == null)
{
char buffer[1024];
pack.ReadString(buffer, 1024);
LogError("Insert Query failed! query: \"%s\" error: \"%s\"", buffer, error);
}
else
{
char query[255];
FormatEx(query, sizeof(query), "REPLACE INTO %sweapons_timestamps (steamid, last_seen) VALUES ('%s', %d)", g_TablePrefix, steamid, GetTime());
DataPack newPack = new DataPack();
newPack.WriteString(query);
db.Query(T_TimestampCallback, query, newPack);
}
CloseHandle(pack);
}

public void T_TimestampCallback(Database database, DBResultSet results, const char[] error, DataPack pack)
{
if (results == null)
{
pack.Reset();
char buffer[1024];
pack.ReadString(buffer, 1024);
LogError("Timestamp Query failed! query: \"%s\" error: \"%s\"", buffer, error);
}
CloseHandle(pack);
}

void UpdatePlayerData(int client, char[] updateFields)
{
char steamid[32];
GetClientAuthId(client, AuthId_Steam2, steamid, sizeof(steamid), true);
char query[1024];
FormatEx(query, sizeof(query), "UPDATE %sweapons SET %s WHERE steamid = '%s'", g_TablePrefix, updateFields, steamid);
DataPack pack = new DataPack();
pack.WriteString(query);
db.Query(T_UpdatePlayerDataCallback, query, pack);
}

public void T_UpdatePlayerDataCallback(Database database, DBResultSet results, const char[] error, DataPack pack)
{
if (results == null)
{
pack.Reset();
char buffer[1024];
pack.ReadString(buffer, 1024);
LogError("Update Player failed! query: \"%s\" error: \"%s\"", buffer, error);
}
CloseHandle(pack);
}

public void SQLConnectCallback(Database database, const char[] error, any data)
{
if (database == null)
{
LogError("Database failure: %s", error);
}
else
{
db = database;
char createQuery[20480];
char dbIdentifier[10];

int index = 0;

index += FormatEx(createQuery[index], sizeof(createQuery) - index, " \
CREATE TABLE IF NOT EXISTS %sweapons ( \
steamid varchar(32) NOT NULL PRIMARY KEY, \
knife int(4) NOT NULL DEFAULT '0', ", g_TablePrefix);
index += FormatEx(createQuery[index], sizeof(createQuery) - index, " \
knife_karambit int(4) NOT NULL DEFAULT '0', \
knife_karambit_float decimal(3,2) NOT NULL DEFAULT '0.0', \
knife_karambit_trak int(1) NOT NULL DEFAULT '0', \
knife_karambit_trak_count int(10) NOT NULL DEFAULT '0', \
knife_karambit_tag varchar(256) NOT NULL DEFAULT '', \
knife_m9_bayonet int(4) NOT NULL DEFAULT '0', \
knife_m9_bayonet_float decimal(3,2) NOT NULL DEFAULT '0.0', \
knife_m9_bayonet_trak int(1) NOT NULL DEFAULT '0', \
knife_m9_bayonet_trak_count int(10) NOT NULL DEFAULT '0', \
knife_m9_bayonet_tag varchar(256) NOT NULL DEFAULT '', \
bayonet int(4) NOT NULL DEFAULT '0', \
bayonet_float decimal(3,2) NOT NULL DEFAULT '0.0', ");
index += FormatEx(createQuery[index], sizeof(createQuery) - index, " \
bayonet_trak int(1) NOT NULL DEFAULT '0', \
bayonet_trak_count int(10) NOT NULL DEFAULT '0', \
bayonet_tag varchar(256) NOT NULL DEFAULT '', \
knife_survival_bowie int(4) NOT NULL DEFAULT '0', \
knife_survival_bowie_float decimal(3,2) NOT NULL DEFAULT '0.0', \
knife_survival_bowie_trak int(1) NOT NULL DEFAULT '0', \
knife_survival_bowie_trak_count int(10) NOT NULL DEFAULT '0', \
knife_survival_bowie_tag varchar(256) NOT NULL DEFAULT '', \
knife_butterfly int(4) NOT NULL DEFAULT '0', \
knife_butterfly_float decimal(3,2) NOT NULL DEFAULT '0.0', \
knife_butterfly_trak int(1) NOT NULL DEFAULT '0', \
knife_butterfly_trak_count int(10) NOT NULL DEFAULT '0', \
knife_butterfly_tag varchar(256) NOT NULL DEFAULT '', \
knife_flip int(4) NOT NULL DEFAULT '0', \
knife_flip_float decimal(3,2) NOT NULL DEFAULT '0.0', \
knife_flip_trak int(1) NOT NULL DEFAULT '0', \
knife_flip_trak_count int(10) NOT NULL DEFAULT '0', \
knife_flip_tag varchar(256) NOT NULL DEFAULT '', ");
index += FormatEx(createQuery[index], sizeof(createQuery) - index, " \
knife_push int(4) NOT NULL DEFAULT '0', \
knife_push_float decimal(3,2) NOT NULL DEFAULT '0.0', \
knife_push_trak int(1) NOT NULL DEFAULT '0', \
knife_push_trak_count int(10) NOT NULL DEFAULT '0', \
knife_push_tag varchar(256) NOT NULL DEFAULT '', \
knife_tactical int(4) NOT NULL DEFAULT '0', \
knife_tactical_float decimal(3,2) NOT NULL DEFAULT '0.0', \
knife_tactical_trak int(1) NOT NULL DEFAULT '0', \
knife_tactical_trak_count int(10) NOT NULL DEFAULT '0', \
knife_tactical_tag varchar(256) NOT NULL DEFAULT '', \
knife_falchion int(4) NOT NULL DEFAULT '0', \
knife_falchion_float decimal(3,2) NOT NULL DEFAULT '0.0', \
knife_falchion_trak int(1) NOT NULL DEFAULT '0', \
knife_falchion_trak_count int(10) NOT NULL DEFAULT '0', \
knife_falchion_tag varchar(256) NOT NULL DEFAULT '', \
knife_gut int(4) NOT NULL DEFAULT '0', \
knife_gut_float decimal(3,2) NOT NULL DEFAULT '0.0', \
knife_gut_trak int(1) NOT NULL DEFAULT '0', ");
index += FormatEx(createQuery[index], sizeof(createQuery) - index, " \
knife_gut_trak_count int(10) NOT NULL DEFAULT '0', \
knife_gut_tag varchar(256) NOT NULL DEFAULT '', \
knife_ursus int(4) NOT NULL DEFAULT '0', \
knife_ursus_float decimal(3,2) NOT NULL DEFAULT '0.0', \
knife_ursus_trak int(1) NOT NULL DEFAULT '0', \
knife_ursus_trak_count int(10) NOT NULL DEFAULT '0', \
knife_ursus_tag varchar(256) NOT NULL DEFAULT '', \
knife_gypsy_jackknife int(4) NOT NULL DEFAULT '0', \
knife_gypsy_jackknife_float decimal(3,2) NOT NULL DEFAULT '0.0',\
knife_gypsy_jackknife_trak int(1) NOT NULL DEFAULT '0', \
knife_gypsy_jackknife_trak_count int(10) NOT NULL DEFAULT '0', \
knife_gypsy_jackknife_tag varchar(256) NOT NULL DEFAULT '', \
knife_stiletto int(4) NOT NULL DEFAULT '0', \
knife_stiletto_float decimal(3,2) NOT NULL DEFAULT '0.0', \
knife_stiletto_trak int(1) NOT NULL DEFAULT '0', \
knife_stiletto_trak_count int(10) NOT NULL DEFAULT '0', \
knife_stiletto_tag varchar(256) NOT NULL DEFAULT '', \
knife_widowmaker int(4) NOT NULL DEFAULT '0', ");
index += FormatEx(createQuery[index], sizeof(createQuery) - index, " \
knife_widowmaker_float decimal(3,2) NOT NULL DEFAULT '0.0', \
knife_widowmaker_trak int(1) NOT NULL DEFAULT '0', \
knife_widowmaker_trak_count int(10) NOT NULL DEFAULT '0', \
knife_widowmaker_tag varchar(256) NOT NULL DEFAULT '')");

db.Driver.GetIdentifier(dbIdentifier, sizeof(dbIdentifier));
bool mysql = StrEqual(dbIdentifier, "mysql");
if (mysql)
{
index += FormatEx(createQuery[index], sizeof(createQuery) - index, " ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;");
}

db.Query(T_CreateMainTableCallback, createQuery, mysql, DBPrio_High);
}
}

public void T_CreateMainTableCallback(Database database, DBResultSet results, const char[] error, bool mysql)
{
if (results == null)
{
LogError("%s Create main table failed! %s", (mysql ? "MySQL" : "SQLite"), error);
}
else
{
AddWeaponColumns("knife_ursus");
AddWeaponColumns("knife_gypsy_jackknife");
AddWeaponColumns("knife_stiletto");
AddWeaponColumns("knife_widowmaker");

char createQuery[512];
Format(createQuery, sizeof(createQuery), " \
CREATE TABLE %sweapons_timestamps ( \
steamid varchar(32) NOT NULL PRIMARY KEY, \
last_seen int(11) NOT NULL)", g_TablePrefix);

if (mysql)
{
Format(createQuery, sizeof(createQuery), "%s ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;", createQuery);
}

db.Query(T_CreateTimestampTableCallback, createQuery, mysql, DBPrio_High);
}
}

void AddWeaponColumns(const char[] weapon)
{
char query[512];

SQL_LockDatabase(db);

Format(query, sizeof(query), "ALTER TABLE %sweapons ADD %s int(4) NOT NULL DEFAULT '0'", g_TablePrefix, weapon);
SQL_FastQuery(db, query);
Format(query, sizeof(query), "ALTER TABLE %sweapons ADD %s_float decimal(3,2) NOT NULL DEFAULT '0.0'", g_TablePrefix, weapon);
SQL_FastQuery(db, query);
Format(query, sizeof(query), "ALTER TABLE %sweapons ADD %s_trak int(1) NOT NULL DEFAULT '0'", g_TablePrefix, weapon);
SQL_FastQuery(db, query);
Format(query, sizeof(query), "ALTER TABLE %sweapons ADD %s_trak_count int(10) NOT NULL DEFAULT '0'", g_TablePrefix, weapon);
SQL_FastQuery(db, query);
Format(query, sizeof(query), "ALTER TABLE %sweapons ADD %s_tag varchar(256) NOT NULL DEFAULT ''", g_TablePrefix, weapon);
SQL_FastQuery(db, query);

SQL_UnlockDatabase(db);
}

public void T_CreateTimestampTableCallback(Database database, DBResultSet results, const char[] error, bool mysql)
{
if (results == null)
{
LogMessage("%s DB connection successful", (mysql ? "MySQL" : "SQLite"));
for(int i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i))
{
OnClientPutInServer(i);
if(IsClientAuthorized(i))
{
OnClientPostAdminCheck(i);
}
}
}
DeleteInactivePlayerData();
}
else
{
char insertQuery[512];
Format(insertQuery, sizeof(insertQuery), " \
INSERT INTO %sweapons_timestamps \
SELECT steamid, %d FROM %sweapons", g_TablePrefix, GetTime(), g_TablePrefix);

db.Query(T_InsertTimestampsCallback, insertQuery, mysql, DBPrio_High);
}
}

public void T_InsertTimestampsCallback(Database database, DBResultSet results, const char[] error, bool mysql)
{
if (results == null)
{
LogError("%s Insert timestamps failed! %s", (mysql ? "MySQL" : "SQLite"), error);
}
else
{
LogMessage("%s DB connection successful", (mysql ? "MySQL" : "SQLite"));
for(int i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i))
{
OnClientPutInServer(i);
if(IsClientAuthorized(i))
{
OnClientPostAdminCheck(i);
}
}
}
DeleteInactivePlayerData();
}
}

void DeleteInactivePlayerData()
{
if(g_iGraceInactiveDays > 0)
{
char query[255];
int now = GetTime();
FormatEx(query, sizeof(query), "DELETE FROM %sweapons WHERE steamid in (SELECT steamid FROM %sweapons_timestamps WHERE last_seen < %d - (%d * 86400))", g_TablePrefix, g_TablePrefix, now, g_iGraceInactiveDays);
DataPack pack = new DataPack();
pack.WriteCell(now);
pack.WriteString(query);
db.Query(T_DeleteInactivePlayerDataCallback, query, pack);
}
}

public void T_DeleteInactivePlayerDataCallback(Database database, DBResultSet results, const char[] error, DataPack pack)
{
pack.Reset();
int now = pack.ReadCell();
if (results == null)
{
char buffer[1024];
pack.ReadString(buffer, 1024);
LogError("Delete Inactive Player Data failed! query: \"%s\" error: \"%s\"", buffer, error);
}
else
{
if(now > 0)
{
char query[255];
FormatEx(query, sizeof(query), "DELETE FROM %sweapons_timestamps WHERE last_seen < %d - (%d * 86400)", g_TablePrefix, now, g_iGraceInactiveDays);
DataPack newPack = new DataPack();
newPack.WriteCell(0);
newPack.WriteString(query);
db.Query(T_DeleteInactivePlayerDataCallback, query, newPack);
}
else
{
LogMessage("Inactive players' data has been deleted");
}
}
CloseHandle(pack);
}
 

Вложения

  • wsknife.rar
    35.9 КБ · Просмотры: 1
Последнее редактирование:

СергейDOC

Участник
Сообщения
200
Реакции
12
Добрый вечер
Помогите пожалуйста с плагином
Поправить нужно следующее:
1.изменить команду pvtvoice, на sm_pvtvoice
2.добавить квар sm_pvtvoice_adminflag " " что бы команду sm_pvtvoice использовали админы с флагом, а если оставить пустым то команда sm_pvtvoice доступна всем игрокам
 

Вложения

  • pvtvoice.sp
    6 КБ · Просмотры: 8

Mensi1337

Участник
Сообщения
236
Реакции
16
Добрый вечер
Помогите пожалуйста с плагином
Поправить нужно следующее:
1.изменить команду pvtvoice, на sm_pvtvoice
2.добавить квар sm_pvtvoice_adminflag " " что бы команду sm_pvtvoice использовали админы с флагом, а если оставить пустым то команда sm_pvtvoice доступна всем игрокам
1. Измени это:
Оффтоп
На это:
Оффтоп
 

Kruzya

Raspberry Pi 4
Команда форума
Меценат
Сообщения
10,545
Реакции
8,723
1.изменить команду pvtvoice, на sm_pvtvoice
2.добавить квар sm_pvtvoice_adminflag " " что бы команду sm_pvtvoice использовали админы с флагом, а если оставить пустым то команда sm_pvtvoice доступна всем игрокам
 

Вложения

  • pvtvoice.sp
    6.4 КБ · Просмотры: 11

s777

Участник
Сообщения
445
Реакции
73
Плагин позволяет мертвым администраторам наблюдать за всеми игроками при mp_forcecamera 1. Он работает, но суть в том, что при смерти абсолютно все игроки на сервере видят врагов на радаре. Для моего режима это не подходит (соревновательный 5х5, слышно только мертвых и живых тиммейтов), так как начинается мониторинг. Сможет ли кто-нибудь любым костылем решить проблему?

Admin all spectate
 

Вложения

  • admin-allspec.rar
    4.5 КБ · Просмотры: 3

Afro

Участник
Сообщения
63
Реакции
10
Нужно что бы всем игрокам автоматически включалась команда sm_hw, что бы её не писали что бы включить
 

Вложения

  • helloween.sp
    5.6 КБ · Просмотры: 11

s777

Участник
Сообщения
445
Реакции
73
Здравствуйте. Нужно переделать этот плагин - Chat Colors CSGO (Custom Chat Colors) У меня стоит версия 1.3, прикрепляю файлы к этому посту. Можно ли добавить в конфиг помимо параметров выбора цвета ника, префикса и чата так же параметр выбора цвета надписей: (Спецназовец), (Террорист), *МЁРТВ*(Спецназовец), *МЁРТВ*(Террорист), (Наблюдатель), *МЁРТВ. В симпл чат процессоре все это есть в файле перевода scp.csgo.phrases.txt. Надеюсь поможете, спасибо.
 

Вложения

  • chat_colors_csgo.rar
    11.5 КБ · Просмотры: 0
Последнее редактирование:
Сверху