Открытие формата sma

Predator199

Участник
Сообщения
50
Реакции
0
Вообщем не знаю как правильно тему назвать. Но суть в том что мне нужно из одного плагина sma убрать рекламу или просто перевести.А как это сделать я не представляю.
Кто что подскажет? Зарание спасибо.
С чего начинать?
 

Alex88

Участник
Сообщения
34
Реакции
1
Может формата smx?Если исходника нет sp,то ничего ты несделаеш
 

Predator199

Участник
Сообщения
50
Реакции
0
Вообщем почитал кроме как назвать тему спасибо не понял.
К суте. Есть фаил AdminList.smx и sp
Перешел по сылке.Что именно дальше нужно делать?.Что не пыталcя везде Error
 

BMW M6

Участник
Сообщения
1,217
Реакции
534
Predator199,у тебя есть исходник .sp тебе надо его открыть, исправить там что тебе надо, потом сохранить в UTF8-БЕЗ BOM, а потом скомпилировать.
То что я написал выше это надо, если нет .sp исходника :)
 

Predator199

Участник
Сообщения
50
Реакции
0
Вообщем вот иходник

#include <sourcemod>

#pragma semicolon 1

new Handle:AdminListEnabled = INVALID_HANDLE;
new Handle:AdminListMode = INVALID_HANDLE;
new Handle:AdminListMenu = INVALID_HANDLE;

public Plugin:myinfo =
{
name = "Admin List",
author = "Fredd",
description = "prints admins to clients",
version = "1.2",
url = "www.sourcemod.net"
}

public OnPluginStart()
{
CreateConVar("adminlist_version", "1.2", "Admin List Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);

AdminListEnabled = CreateConVar("adminlist_on", "1", "turns on and off admin list, 1=on ,0=off");
AdminListMode = CreateConVar("adminlist_mode", "1", "mode that changes how the list appears..");

RegConsoleCmd("say", SayHook);
RegConsoleCmd("say_team", SayHook);
}
public Action:SayHook(client, args)
{
if(GetConVarInt(AdminListEnabled) == 1)
{
new String:text[192];
GetCmdArgString(text, sizeof(text));

new startidx = 0;
if (text[0] == '"')
{
startidx = 1;

new len = strlen(text);
if (text[len-1] == '"')
{
text[len-1] = '\0';
}
}

if(StrEqual(text[startidx], "!admins") || StrEqual(text[startidx], "/admins"))
{
switch(GetConVarInt(AdminListMode))
{
case 1:
{
decl String:AdminNames[MAXPLAYERS+1][MAX_NAME_LENGTH+1];
new count = 0;
for(new i = 1 ; i <= GetMaxClients();i++)
{
if(IsClientInGame(i))
{
new AdminId:AdminID = GetUserAdmin(i);
if(AdminID != INVALID_ADMIN_ID)
{
GetClientName(i, AdminNames[count], sizeof(AdminNames[]));
count++;
}
}
}
decl String:buffer[1024];
ImplodeStrings(AdminNames, count, ",", buffer, sizeof(buffer));
PrintToChatAll("\x04Admins online are: %s", buffer);
}
case 2:
{
decl String:AdminName[MAX_NAME_LENGTH];
AdminListMenu = CreateMenu(MenuListHandler);
SetMenuTitle(AdminListMenu, "Онлайн администраторы:");

for(new i = 1; i <= GetMaxClients(); i++)
{
if(IsClientInGame(i))
{
new AdminId:AdminID = GetUserAdmin(i);
if(AdminID != INVALID_ADMIN_ID)
{
GetClientName(i, AdminName, sizeof(AdminName));
AddMenuItem(AdminListMenu, AdminName, AdminName);
}
}
}
SetMenuExitButton(AdminListMenu, true);
DisplayMenu(AdminListMenu, client, 15);
}
}
}
}
return Plugin_Continue;
}
public MenuListHandler(Handle:menu, MenuAction:action, param1, param2)
{
if (action == MenuAction_Select)
{
CloseHandle(menu);
}
else if (action == MenuAction_Cancel)
{
CloseHandle(menu);
}
else if (action == MenuAction_End)
{
CloseHandle(menu);
}
}

Дело в том то при вводе команд !admins выводится admins onlain не по русски.
Что я делаю:
В самом этом коде я изменил на русски...
Скопировал код суда.http://www.sourcemod.net/compiler.php

Нажал на;compiler
Дальше появилась сылка, нажал на нее скачал фаил.
Заменил на сервере, но по прежнему пишится по англ.
 

Predator199

Участник
Сообщения
50
Реакции
0
Все разобрался как переводить=)

Добавлено через 1 минуту
Еще вопрос .Можно ли как нибуть к cебе на cайт сделать как здесь.Что за код php
http://www.sourcemod.net/compiler.php
Чтоб не бегать одного сайта на другой?

Добавлено через 9 минут
Сам сайт с поддержкой php и мусикл ,есть.

Добавлено через 14 часов 11 минут
Народ вот кто хорошо разбирается в плагинах , помогите с плагином пермамутов.
Дело в том что когда игроку уже выключен микрофон и он перезаходит на сервер, в чате публично прописывается о том что у него выключено.Вот как убрать совсем это сообщение или хотяб сделать чтоб выводилась тому у кого стоит мут, а не публично.
Вот исходник. Побывал но у меня пока не получается.

/**
* vim: set filetype=c :
*
* =============================================================================
* PermaMute
*
* Copyright 2008 Ryan Mannion. All Rights Reserved.
* =============================================================================
*
* 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 <http://www.gnu.org/licenses/>.
*/

#include <sourcemod>
#include <clientprefs>

#undef REQUIRE_PLUGIN
#include <adminmenu>
#define REQUIRE_PLUGIN

#pragma semicolon 1

#define PERMAMUTE_VERSION "0.1"

#define CVAR_VERSION 0
#define CVAR_NUM_CVARS 1

#define COOKIE_PMUTE 0
#define COOKIE_PGAG 1
#define COOKIE_NUM_COOKIES 2

#define ACCESS_FLAG ADMFLAG_CHAT

new Handle:g_cvars[CVAR_NUM_CVARS];
new Handle:g_cookies[COOKIE_NUM_COOKIES];
new g_gagged = 0;
new Handle:g_adminMenu = INVALID_HANDLE;
new g_PMuteTarget[33];

enum PCommType {
PCommType_PMute = 0,
PCommType_PUnMute,
PCommType_PGag,
PCommType_PUnGag,
PCommType_PSilence,
PCommType_PUnSilence,
PCommType_NumTypes
};

public Plugin:myinfo = {
name = "PermaMute",
author = "Ryan \"Rusification Punkk\"",
description = "Enable permanently muting or gagging a player.",
version = PERMAMUTE_VERSION,
url = "http://www.2fort2furious.com"
};

public OnPluginStart() {
LoadTranslations("common.phrases");

g_cvars[CVAR_VERSION] = CreateConVar(
"sm_permamute_version",
PERMAMUTE_VERSION,
"PermaMute Version",
FCVAR_PLUGIN|FCVAR_REPLICATED|FCVAR_NOTIFY);

g_cookies[COOKIE_PMUTE] = RegClientCookie(
"permamute-mute",
"PermaMute mute status",
CookieAccess_Protected);

g_cookies[COOKIE_PGAG] = RegClientCookie(
"permamute-gag",
"PermaMute gag status",
CookieAccess_Protected);

SetCookieMenuItem(Menu_Status, 0, "Display PermaMute Status");

RegConsoleCmd("say", Command_Say);
RegConsoleCmd("say_team", Command_Say);

RegAdminCmd("sm_pmute",
Command_PMute,
ACCESS_FLAG,
"sm_pmute <player> - Микрофона у тебя больше нет =))).");
RegAdminCmd("sm_punmute",
Command_PUnMute,
ACCESS_FLAG,
"sm_punmute <player> - Востонавливает спосозность использовать микрофон.");
RegAdminCmd("sm_pgag",
Command_PGag,
ACCESS_FLAG,
"sm_pgag <player> - Чата у тебя больше нет =))).");
RegAdminCmd("sm_pungag",
Command_PUnGag,
ACCESS_FLAG,
"sm_pungag <player> - Востонавливает способность использовать чат.");
RegAdminCmd("sm_psilence",
Command_PSilence,
ACCESS_FLAG,
"sm_psilence <player> - Микрофона и чата у тебя больше нет =))).");
RegAdminCmd("sm_punsilence",
Command_PUnSilence,
ACCESS_FLAG,
"sm_punsilence <player> - Востонавливает способность использовать чат и микрофон.");

new Handle:topmenu;
if (LibraryExists("adminmenu") && ((topmenu = GetAdminTopMenu()) != INVALID_HANDLE)) {
OnAdminMenuReady(topmenu);
}

if (!PluginExists("basecomm.smx")) {
LogError("FATAL: This plugin requires basecomm. Please load basecomm and try loading this plugin again.");
SetFailState("This plugin requires basecomm. Please load basecomm and try loading this plugin again.");
}
}

stock bool:PluginExists(const String:plugin_name[]) {
new Handle:iter = GetPluginIterator();
new Handle:plugin = INVALID_HANDLE;
decl String:name[64];

while (MorePlugins(iter)) {
plugin = ReadPlugin(iter);
GetPluginFilename(plugin, name, sizeof(name));
if (StrEqual(name, plugin_name)) {
CloseHandle(iter);
return true;
}
}

CloseHandle(iter);
return false;
}

public OnLibraryRemoved(const String:name[]) {
if (StrEqual(name, "adminmenu")) {
g_adminMenu = INVALID_HANDLE;
}
}

public OnAdminMenuReady(Handle:topmenu) {
if (topmenu == g_adminMenu) {
return;
}

g_adminMenu = topmenu;

new TopMenuObject:player_commands = FindTopMenuCategory(g_adminMenu, ADMINMENU_PLAYERCOMMANDS);

if (player_commands == INVALID_TOPMENUOBJECT) {
return;
}

AddToTopMenu(g_adminMenu, "sm_pmute", TopMenuObject_Item, AdminMenu_PMute,
player_commands, "sm_pmute", ACCESS_FLAG);
}

public AdminMenu_PMute(Handle:topmenu, TopMenuAction:action,
TopMenuObject:object_id, param, String:buffer[], maxlength) {
switch (action) {
case TopMenuAction_DisplayOption: {
Format(buffer, maxlength, "Отключить навсегда Чат/Микр.");
}
case TopMenuAction_SelectOption: {
DisplayPMutePlayerMenu(param);
}
}
}

stock DisplayPMutePlayerMenu(client) {
new Handle:menu = CreateMenu(MenuHandler_PMutePlayer);

decl String:title[100];
Format(title, sizeof(title), "Кому отрубим Чат/Микр?:");
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
AddTargetsToMenu(menu, client, true, false);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

public MenuHandler_PMutePlayer(Handle:menu, MenuAction:action, param1, param2) {
new client = param1;

switch (action) {
case MenuAction_End: {
CloseHandle(menu);
}
case MenuAction_Cancel: {
if (param2 == MenuCancel_ExitBack && g_adminMenu != INVALID_HANDLE) {
DisplayTopMenu(g_adminMenu, client, TopMenuPosition_LastCategory);
}
}
case MenuAction_Select: {
decl String:info[32];

GetMenuItem(menu, param2, info, sizeof(info));
new userid = StringToInt(info);
new target = GetClientOfUserId(userid);

if (!target) {
PrintToChat(client, "\x04[PERMAMUTE]\x01 %t", "Игрок больше не доступен");
}
else if (!CanUserTarget(client, target)) {
PrintToChat(client, "\x04[PERMAMUTE]\x01 %t", "Цель сбежала, ставим бан.");
}
else {
g_PMuteTarget[client] = target;
DisplayPMuteTypesMenu(client, target);
}
}
}
}

stock DisplayPMuteTypesMenu(client, target) {
new Handle:menu = CreateMenu(MenuHandler_PMuteTypes);

decl String:title[100];
Format(title, sizeof(title), "Что отрубим?:");
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);

decl String:cookie[8];
new bool:silenced = true;

GetClientCookie(target, g_cookies[COOKIE_PMUTE], cookie, sizeof(cookie));
if (!strcmp(cookie, "1")) {
AddMenuItem(menu, "1", "Включить микрофон");
}
else {
AddMenuItem(menu, "0", "Отключить Микр. навсегда");
silenced = false;
}

GetClientCookie(target, g_cookies[COOKIE_PGAG], cookie, sizeof(cookie));
if (!strcmp(cookie, "1")) {
AddMenuItem(menu, "3", "Включить чат");
}
else {
AddMenuItem(menu, "2", "Отключить чат навсегда");
silenced = false;
}

if (silenced) {
AddMenuItem(menu, "5", "Включить чат/микрофон");
}
else {
AddMenuItem(menu, "4", "Отключить чат/микрофон навсегда");
}

DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

public Menu_Status(client, CookieMenuAction:action, any:info, String:buffer[], maxlen) {
if (action == CookieMenuAction_DisplayOption) {
Format(buffer, maxlen, "Показать что отключено чат/микр");
}
else if (action == CookieMenuAction_SelectOption) {
CreateMenuStatus(client);
}
}

public MenuHandler_PMuteTypes(Handle:menu, MenuAction:action, param1, param2) {
new client = param1;

switch (action) {
case MenuAction_End: {
CloseHandle(menu);
}
case MenuAction_Cancel: {
if (param1 == MenuCancel_ExitBack && g_adminMenu != INVALID_HANDLE) {
DisplayTopMenu(g_adminMenu, client, TopMenuPosition_LastCategory);
}
}
case MenuAction_Select: {
decl String:info[32];

GetMenuItem(menu, param2, info, sizeof(info));
new PCommType:type = PCommType:StringToInt(info);

PerformPMute(client, g_PMuteTarget[client], type);
}
}
}

stock PerformPMute(client, target, PCommType:type) {
decl String:cmd[32];
new target_userid = GetClientUserId(target);
decl String:target_name[MAX_NAME_LENGTH];
GetClientName(target, target_name, sizeof(target_name));

switch (type) {
case PCommType_PMute: {
Format(cmd, sizeof(cmd), "sm_mute #%d", target_userid);
ServerCommand(cmd);
SetClientCookie(target, g_cookies[COOKIE_PMUTE], "1");
if (client) {
ShowActivity2(client, "\x04[PERMAMUTE]\x01 ", "У игрока %N микрофона больше нет =)", target);
}
}
case PCommType_PUnMute: {
Format(cmd, sizeof(cmd), "sm_unmute #%d", target_userid);
ServerCommand(cmd);
SetClientCookie(target, g_cookies[COOKIE_PMUTE], "0");
if (client) {
ShowActivity2(client, "\x04[PERMAMUTE]\x01 ", "%N радуйся что включили=)", target);
}
}
case PCommType_PGag: {
Format(cmd, sizeof(cmd), "sm_gag #%d", target_userid);
ServerCommand(cmd);
SetClientCookie(target, g_cookies[COOKIE_PGAG], "1");
if (client) {
ShowActivity2(client, "\x04[PERMAMUTE]\x01 ", "У игрока %N нет чата ", target);
}
}
case PCommType_PUnGag: {
Format(cmd, sizeof(cmd), "sm_ungag #%d", target_userid);
ServerCommand(cmd);
SetClientCookie(target, g_cookies[COOKIE_PGAG], "0");
if (client) {
ShowActivity2(client, "\x04[PERMAMUTE]\x01 ", "%N радуйя что дали 2 шанс ,чат включен ", target);
}
}
case PCommType_PSilence: {
PerformPMute(client, target, PCommType_PMute);
PerformPMute(client, target, PCommType_PGag);
}
case PCommType_PUnSilence: {
PerformPMute(client, target, PCommType_PUnMute);
PerformPMute(client, target, PCommType_PUnGag);
}
}

}

stock CreateMenuStatus(client) {
new Handle:menu = CreateMenu(Menu_StatusDisplay);
decl String:text[64];
decl String:cookie[8];

Format(text, sizeof(text), "Что у меня вырубили?");
SetMenuTitle(menu, text);

GetClientCookie(client, g_cookies[COOKIE_PMUTE], cookie, sizeof(cookie));
if (!strcmp(cookie, "1")) {
AddMenuItem(menu, "permamute-mute", "Микрофона у тебя больше нет =)))", ITEMDRAW_DISABLED);
}
else {
AddMenuItem(menu, "permamute-mute", "Можеш жить микрофон пока работает", ITEMDRAW_DISABLED);
}

GetClientCookie(client, g_cookies[COOKIE_PGAG], cookie, sizeof(cookie));
if (!strcmp(cookie, "1")) {
AddMenuItem(menu, "permamute-gag", "Чата у тебя больше нет =)))", ITEMDRAW_DISABLED);
}
else {
AddMenuItem(menu, "permamute-gag", "Пока еще чат тебе не выключили =)))", ITEMDRAW_DISABLED);
}

SetMenuExitBackButton(menu, true);
SetMenuExitButton(menu, true);
DisplayMenu(menu, client, 15);
}

public Menu_StatusDisplay(Handle:menu, MenuAction:action, param1, param2) {
new client = param1;

switch (action) {
case MenuAction_Cancel: {
switch (param2) {
case MenuCancel_ExitBack: {
ShowCookieMenu(client);
}
}
}
case MenuAction_End: {
CloseHandle(menu);
}
}
}

public Action:Command_Say(client, args) {
if (g_gagged & (1 << (client - 1))) {
return Plugin_Handled;
}
return Plugin_Continue;
}

public OnClientCookiesCached(client) {
}

public OnClientPostAdminCheck(client) {
if (AreClientCookiesCached(client)) {
ProcessCookies(client);
}
}

stock ProcessCookies(client) {
decl String:cookie[32];

GetClientCookie(client, g_cookies[COOKIE_PMUTE], cookie, sizeof(cookie));
if (StrEqual(cookie, "1")) {
PrintToServer("\x04[PERMAMUTE]\x01 У игрока %N нет микрофона", client);
PerformPMute(0, client, PCommType_PMute);
}

GetClientCookie(client, g_cookies[COOKIE_PGAG], cookie, sizeof(cookie));
if (StrEqual(cookie, "1")) {
PrintToServer("\x04[PERMAMUTE]\x01 У игрока %N нет чата", client);
PerformPMute(0, client, PCommType_PGag);
}
}

/* Commands {{{ */
public Action:Command_PMute(client, args) {
if (args < 1) {
ReplyToCommand(client, "\x04[PERMAMUTE]\x01 Usage: sm_pmute <player>");
return Plugin_Handled;
}

decl String:arg[64];
GetCmdArg(1, arg, sizeof(arg));

TargetedAction(client, PCommType_PMute, arg);
return Plugin_Handled;
}

public Action:Command_PUnMute(client, args) {
if (args < 1) {
ReplyToCommand(client, "\x04[PERMAMUTE]\x01 Usage: sm_punmute <player>");
return Plugin_Handled;
}

decl String:arg[64];
GetCmdArg(1, arg, sizeof(arg));

TargetedAction(client, PCommType_PUnMute, arg);
return Plugin_Handled;
}

public Action:Command_PGag(client, args) {
if (args < 1) {
ReplyToCommand(client, "\x04[PERMAMUTE]\x01 Usage: sm_pgag <player>");
return Plugin_Handled;
}

decl String:arg[64];
GetCmdArg(1, arg, sizeof(arg));

TargetedAction(client, PCommType_PGag, arg);
return Plugin_Handled;
}

public Action:Command_PUnGag(client, args) {
if (args < 1) {
ReplyToCommand(client, "\x04[PERMAMUTE]\x01 Usage: sm_pungag <player>");
return Plugin_Handled;
}

decl String:arg[64];
GetCmdArg(1, arg, sizeof(arg));

TargetedAction(client, PCommType_PUnGag, arg);
return Plugin_Handled;
}

public Action:Command_PSilence(client, args) {
if (args < 1) {
ReplyToCommand(client, "\x04[PERMAMUTE]\x01 Usage: sm_psilence <player>");
return Plugin_Handled;
}

decl String:arg[64];
GetCmdArg(1, arg, sizeof(arg));

TargetedAction(client, PCommType_PSilence, arg);
return Plugin_Handled;
}

public Action:Command_PUnSilence(client, args) {
if (args < 1) {
ReplyToCommand(client, "\x04[PERMAMUTE]\x01 Usage: sm_punsilence <player>");
return Plugin_Handled;
}

decl String:arg[64];
GetCmdArg(1, arg, sizeof(arg));

TargetedAction(client, PCommType_PUnSilence, arg);
return Plugin_Handled;
}
/* }}} Commands */

/* TargetAction {{{ */
stock TargetedAction(client, PCommType:type, const String:target_string[]) {
decl String:target_name[MAX_TARGET_LENGTH];
decl target_list[MAXPLAYERS];
decl target_count;
decl bool:tn_is_ml;

if ((target_count = ProcessTargetString(
target_string,
client,
target_list,
MAXPLAYERS,
0,
target_name,
sizeof(target_name),
tn_is_ml)) <= 0) {
ReplyToTargetError(client, target_count);
return;
}

for (new i = 0; i < target_count; i++) {
PerformPMute(client, target_list, type);
}
}
/* }}} TargetAction */


 
Последнее редактирование:
Сверху Снизу