Исправьте пожалуйста ошибку компиляции.

Metamoto

Участник
Сообщения
407
Реакции
14
Кому не в лом, исправьте мне .sp файл, чтобы я смог его компилировать, а то надоела ошибка в логах. Сам я в коде не разбираюсь! Думаю ошибочка банальная и знающие люди в доли секунды исправят, прошу помогите. Вот ошибка при компиляции:

//// admin_logging_custom.sp
//SourceMod Batch Compiler
// by the SourceMod Dev Team

//
// D:\Public\csgo\addons\sourcemod\scripting\admin_logging_custom.sp(57) : warning 234: symbol "GetClientAuthString" is marked as deprecated: Use GetClientAuthId
//
//
// Code size: 3744 bytes
// Data size: 2452 bytes
// Stack/heap size: 16384 bytes
// Total requirements: 22580 bytes
//
// 1 Warning.
//
// Compilation Time: 0,77 sec
// ----------------------------------------

Press enter to exit ...
 

Вложения

  • admin_logging_custom.sp
    2.1 КБ · Просмотры: 59

Hejter

xor ebx, ebx
Сообщения
1,759
Реакции
393
Это меняешь на:
После client или чего-то подобного (первые буквы после открывающейся скобки) и запятой Оффтоп дописать AuthId_Engine, (зависит от требуемого формата Стима). Оффтоп

Ему под GO.
Значит AuthId_Steam2

GetClientAuthId(client, AuthId_Steam2, steamid, sizeof(steamid));
 

Metamoto

Участник
Сообщения
407
Реакции
14
Ему под GO.
Значит AuthId_Steam2

GetClientAuthId(client, AuthId_Steam2, steamid, sizeof(steamid));

Спасибо большое, помогло. Новый вопрос, перезагрузил сервер,но ошибки не пропали после компиляции, что не так?
L 01/05/2016 - 01:33:43: SourceMod error session started
L 01/05/2016 - 01:33:43: Info (map "de_dust2") (file "errors_20160105.log")
L 01/05/2016 - 01:33:43: [SM] Native "LogToFileEx" reported: Could not open file "D:\Public\csgo\addons\sourcemod\logs\admin_STEAM_1:1:95124706_STEAM_1-1-95124706.log"
L 01/05/2016 - 01:33:43: [SM] Displaying call stack trace for plugin "admin_logging_custom.smx":
L 01/05/2016 - 01:33:43: [SM] [0] Line 76, D:\Public\csgo\addons\sourcemod\scripting\admin_logging_custom.sp::OnLogAction()
 
Последнее редактирование:

Metamoto

Участник
Сообщения
407
Реакции
14
Помогите пожалуйста исправить ошибку плагина? Исходник выложен.

L 01/05/2016 - 01:33:43: SourceMod error session started
L 01/05/2016 - 01:33:43: Info (map "de_dust2") (file "errors_20160105.log")
L 01/05/2016 - 01:33:43: [SM] Native "LogToFileEx" reported: Could not open file "D:\Public\csgo\addons\sourcemod\logs\admin_STEAM_ 1:1:95124706_STEAM_1-1-95124706.log"
L 01/05/2016 - 01:33:43: [SM] Displaying call stack trace for plugin "admin_logging_custom.smx":
L 01/05/2016 - 01:33:43: [SM] [0] Line 76, D:\Public\csgo\addons\sourcemod\scripting\admin_lo gging_custom.sp::OnLogAction()
 

Вложения

  • admin_logging_custom.sp
    2.1 КБ · Просмотры: 28

AlmazON

Не путать с самим yand3xmail
Сообщения
5,099
Реакции
2,755
Native "LogToFileEx" reported: Could not open file "D:\Public\csgo\addons\sourcemod\logs\admin_ST EAM_ 1:1:95124706_STEAM_1-1-95124706.log"
PHP:
#include <sourcemod>

public Plugin:myinfo =
{
	name = "Admin loggin",
	author = "vIr-Dan",
	description = "Logs to admin_name_STEAMID",
	version = "1.0",
	url = "http://dansbasement.us"
};

public OnPluginStart(){
	CreateConVar("sm_al_version","1.0","The version of 'admin logging' running.",FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
}	

public Action:OnLogAction(Handle:source, 
						   Identity:ident,
						   client,
						   target,
						   const String:message[])
						   
{
	// Get the admin ID
	decl AdminId:adminID;
	
	// Get the admin id safely
	if (client > 0)	
		adminID = GetUserAdmin(client);
	else
		adminID = INVALID_ADMIN_ID;
	
	// If this user has no admin and is NOT the server
	// let the core log this
	if (adminID == INVALID_ADMIN_ID && client > 0)
		return Plugin_Continue;
	
	// Holds the log tag
	decl String:logtag[64];
	
	/* At the moment extensions can't be passed through here yet, 
	 * so we only bother with plugins, and use "SM" for anything else.
	 */
	if (ident == Identity_Plugin)
	{
		GetPluginFilename(source, logtag, sizeof(logtag));
	} else {
		strcopy(logtag, sizeof(logtag), "SM");
	}
	
	/* ':' is not a valid filesystem token on Windows so we replace 
	 * it with '-' to keep the file names readable.
	 */
	decl String:steamid[32];
	
	if (client > 0)
	{
		GetClientAuthId(client, AuthId_Steam2, steamid, sizeof(steamid));
		ReplaceString(steamid, sizeof(steamid), ":", "-");
	}
	else
		steamid = "STEAM_ID_SERVER";
	
	// Get the admin name and store it in the adminName string
	decl String:adminName[64];
	
	if (client > 0)
	{
		GetAdminUsername(adminID, adminName, sizeof(adminName));
		ReplaceString(adminName, sizeof(adminName), ":", "-");
	}
	else
		adminName = "server";
	
	/* Prefix our file with the word 'admin_adminname' */
	decl String:file[PLATFORM_MAX_PATH];
	BuildPath(Path_SM, file, sizeof(file), "logs/admin_%s_%s.log", adminName, steamid);
	
	/* Finally, write to the log file with the log tag we deduced. */
	LogToFileEx(file, "[%s] %s", logtag, message);
	
	/* Block Core from re-logging this. */
	return Plugin_Handled;
}
 

Metamoto

Участник
Сообщения
407
Реакции
14
PHP:
#include <sourcemod>

public Plugin:myinfo =
{
	name = "Admin loggin",
	author = "vIr-Dan",
	description = "Logs to admin_name_STEAMID",
	version = "1.0",
	url = "http://dansbasement.us"
};

public OnPluginStart(){
	CreateConVar("sm_al_version","1.0","The version of 'admin logging' running.",FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
}	

public Action:OnLogAction(Handle:source, 
						   Identity:ident,
						   client,
						   target,
						   const String:message[])
						   
{
	// Get the admin ID
	decl AdminId:adminID;
	
	// Get the admin id safely
	if (client > 0)	
		adminID = GetUserAdmin(client);
	else
		adminID = INVALID_ADMIN_ID;
	
	// If this user has no admin and is NOT the server
	// let the core log this
	if (adminID == INVALID_ADMIN_ID && client > 0)
		return Plugin_Continue;
	
	// Holds the log tag
	decl String:logtag[64];
	
	/* At the moment extensions can't be passed through here yet, 
	 * so we only bother with plugins, and use "SM" for anything else.
	 */
	if (ident == Identity_Plugin)
	{
		GetPluginFilename(source, logtag, sizeof(logtag));
	} else {
		strcopy(logtag, sizeof(logtag), "SM");
	}
	
	/* ':' is not a valid filesystem token on Windows so we replace 
	 * it with '-' to keep the file names readable.
	 */
	decl String:steamid[32];
	
	if (client > 0)
	{
		GetClientAuthId(client, AuthId_Steam2, steamid, sizeof(steamid));
		ReplaceString(steamid, sizeof(steamid), ":", "-");
	}
	else
		steamid = "STEAM_ID_SERVER";
	
	// Get the admin name and store it in the adminName string
	decl String:adminName[64];
	
	if (client > 0)
	{
		GetAdminUsername(adminID, adminName, sizeof(adminName));
		ReplaceString(adminName, sizeof(adminName), ":", "-");
	}
	else
		adminName = "server";
	
	/* Prefix our file with the word 'admin_adminname' */
	decl String:file[PLATFORM_MAX_PATH];
	BuildPath(Path_SM, file, sizeof(file), "logs/admin_%s_%s.log", adminName, steamid);
	
	/* Finally, write to the log file with the log tag we deduced. */
	LogToFileEx(file, "[%s] %s", logtag, message);
	
	/* Block Core from re-logging this. */
	return Plugin_Handled;
}
Спасибо
 
Сверху Снизу