block sm plugins

SaInT.P

Участник
Сообщения
1,268
Реакции
226
Всем привет, как то на каком то сервере увидел при написаний sm plugins в консоль мне выдало в консоль вот это
Оффтоп
не могли бы написать этот простой плагин,либо скинуть может где то или у кого то есть, спасибо,
 

SaInT.P

Участник
Сообщения
1,268
Реакции
226
Napas, я скомпилил попробовал вот так, не получается
PHP:
#include <sourcemod>
#include <dhooks>
#include <sdktools>

new Handle:hClientPrintf = INVALID_HANDLE;

public OnPluginStart()
{    
    new Handle:gameconf = LoadGameConfigFile("clientprintf-hook.games");
    if(gameconf == INVALID_HANDLE)
    {
        SetFailState("Failed to find clientprintf-hook.games.txt gamedata");
    }
    new offset = GameConfGetOffset(gameconf, "ClientPrintf");
    if(offset == -1)
    {
        SetFailState("Failed to find offset for ClientPrintf");
        CloseHandle(gameconf);
    }
    StartPrepSDKCall(SDKCall_Static);
    if(!PrepSDKCall_SetFromConf(gameconf, SDKConf_Signature, "CreateInterface"))
    {
        SetFailState("Failed to get CreateInterface");
        CloseHandle(gameconf);
    }
    
    PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer);
    PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Pointer, VDECODE_FLAG_ALLOWNULL);
    PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
    
    new String:interface[64];
    if(!GameConfGetKeyValue(gameconf, "EngineInterface", interface, sizeof(interface)))
    {
        SetFailState("Failed to get engine interface name");
        CloseHandle(gameconf);
    }
    
    new Handle:temp = EndPrepSDKCall();
    new Address:addr = SDKCall(temp, interface, 0);
    
    CloseHandle(gameconf);
    CloseHandle(temp);
    
    if(!addr) SetFailState("Failed to get engine ptr");
    
    hClientPrintf = DHookCreate(offset, HookType_Raw, ReturnType_Void, ThisPointer_Ignore, Hook_ClientPrintf);
    DHookAddParam(hClientPrintf, HookParamType_Edict);
    DHookAddParam(hClientPrintf, HookParamType_CharPtr);
    DHookRaw(hClientPrintf, false, addr);
}
public MRESReturn:Hook_ClientPrintf(Handle:hParams)
{
	decl String:buffer[1024];
	DHookGetParamString(hParams, 2, buffer, 1024);
	if(buffer[1] == '"' && (StrContains(buffer, "\" (") != -1 || (StrContains(buffer, ".smx\" ") != -1))) 
	{
		DHookSetParamString(hParams, 2, "");
		return MRES_ChangedHandled;
	}
	else if(StrContains(buffer, "To see more, type \"sm plugins") != -1)
	{
		DHookSetParamString(hParams, 2, "¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n 
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n 
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n 
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶¶______¶¶¶____¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶\n
¶¶¶__¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n
¶______¶¶¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶\n
¶¶______¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n
¶¶¶______¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶\n
¶¶¶¶______¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n
¶¶¶¶¶_______¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n
¶¶¶¶¶¶_______¶¶¶_____¶¶______¶¶______¶¶¶___¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶______¶¶¶¶_¶¶¶¶______¶¶¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶___¶¶¶¶¶¶¶¶¶¶¶_____¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶________¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶________¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶__________¶¶¶¶¶¶¶¶¶¶__________¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_________________________¶¶¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶__________________¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶");
		return MRES_ChangedHandled;
	}
	return MRES_Ignored;
}
Ошибки такие
sm_plugins_block.sp(31) : error 173: 'interface' is a newly reserved keyword that may be used in the future; use a different name as an identifier
sm_plugins_block.sp(32) : error 173: 'interface' is a newly reserved keyword that may be used in the future; use a different name as an identifier
sm_plugins_block.sp(32) : error 173: 'interface' is a newly reserved keyword that may be used in the future; use a different name as an identifier
sm_plugins_block.sp(39) : error 173: 'interface' is a newly reserved keyword that may be used in the future; use a different name as an identifier
sm_plugins_block.sp(62) : error 037: invalid string (possibly non-terminated string)
sm_plugins_block.sp(63) : warning 217: loose indentation
sm_plugins_block.sp(63) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(63) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(63) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(63) : fatal error 189: too many error messages on one line
 

SaInT.P

Участник
Сообщения
1,268
Реакции
226
AlmazON, и как сделать лучше? чтоб не палили и не смогли пропалить?
 

SaInT.P

Участник
Сообщения
1,268
Реакции
226
AlmazON, Вот что если поменять на "q"

sm_plugins_block.sp(62 -- 63) : error 037: invalid string (possibly non-terminated string)
sm_plugins_block.sp(64) : error 017: undefined symbol "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"
sm_plugins_block.sp(64) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(65) : error 139: could not find type "n"
sm_plugins_block.sp(65) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(66) : error 139: could not find type "n"
sm_plugins_block.sp(66) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(67) : error 139: could not find type "n"
sm_plugins_block.sp(67) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(68) : error 139: could not find type "n"
sm_plugins_block.sp(68) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(69) : error 139: could not find type "n"
sm_plugins_block.sp(69) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(70) : error 139: could not find type "n"
sm_plugins_block.sp(70) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(71) : error 139: could not find type "n"
sm_plugins_block.sp(71) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(72) : error 139: could not find type "n"
sm_plugins_block.sp(72) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(73) : error 139: could not find type "n"
sm_plugins_block.sp(73) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(74) : error 139: could not find type "n"
sm_plugins_block.sp(74) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(75) : error 139: could not find type "n"
sm_plugins_block.sp(75) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(76) : error 139: could not find type "n"
а с тем выдает
sm_plugins_block.sp(62 -- 63) : error 037: invalid string (possibly non-terminated string)
sm_plugins_block.sp(64) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(64) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(64) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(64) : fatal error 189: too many error messages on one line
 

AlmazON

Не путать с самим yand3xmail
Сообщения
5,099
Реакции
2,756
Вот что если поменять
Дело ещё такое: ты можешь записать до 1024 символов (русских в 2 раза меньше - это предел консоли), а твой импровизированный "фак" более чем в 2 раза больше занимает места. Наверное можно его оставить, но разбить на 3 сообщения.
 
  • Мне нравится
Реакции: TWRP

SaInT.P

Участник
Сообщения
1,268
Реакции
226
AlmazON, Я не сильно шарю именно в этом, можешь сделать пожалуйста?
 

SaInT.P

Участник
Сообщения
1,268
Реакции
226
AlmazON,это с q
sm_plugins_block.sp(62 -- 63) : error 037: invalid string (possibly non-terminated string)
sm_plugins_block.sp(64) : error 017: undefined symbol "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"
sm_plugins_block.sp(64) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(65) : error 139: could not find type "n"
sm_plugins_block.sp(65) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(66) : error 139: could not find type "n"
sm_plugins_block.sp(66) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(67) : error 139: could not find type "n"
sm_plugins_block.sp(67) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(68) : error 139: could not find type "n"
sm_plugins_block.sp(68) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(69) : error 139: could not find type "n"
sm_plugins_block.sp(69) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(70) : error 139: could not find type "n"
sm_plugins_block.sp(70) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(70) : error 037: invalid string (possibly non-terminated string)
sm_plugins_block.sp(70) : fatal error 189: too many error messages on one line

а это с тем знаком
sm_plugins_block.sp(62 -- 63) : error 037: invalid string (possibly non-terminated string)
sm_plugins_block.sp(64) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(64) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(64) : error 029: invalid expression, assumed zero
sm_plugins_block.sp(64) : fatal error 189: too many error messages on one line
 

jonasltu

Участник
Сообщения
28
Реакции
11
использую
 

Вложения

  • plugins block.rar
    6.9 КБ · Просмотры: 366
  • Мне нравится
Реакции: TWRP

SaInT.P

Участник
Сообщения
1,268
Реакции
226
AlmazON, в одну строку компильнулся без ошибок, теперь не могу найти dhooks , качаю тут , ставлю но пишет
L 07/06/2015 - 17:44:02: [SM] Unable to load extension "dhooks.ext": /home/lala/lala/MiniGame/cstrike/addons/sourcemod/extensions/dhooks.ext.so: cannot open shared object file: No such file or directory
L 07/06/2015 - 17:44:03: [SM] Unable to load plugin "sm_plugins_block.smx": Required extension "dhooks" file("dhooks.ext") not running
не могу найти dhooks.ext.so
 

komashchenko

Идиот
Сообщения
916
Реакции
2,573
PHP:
#include <sourcemod>
#include <dhooks>
#include <sdktools>

new Handle:hClientPrintf = INVALID_HANDLE;

public OnPluginStart()
{    
    new Handle:gameconf = LoadGameConfigFile("clientprintf-hook.games");
    if(gameconf == INVALID_HANDLE)
    {
        SetFailState("Failed to find clientprintf-hook.games.txt gamedata");
    }
    new offset = GameConfGetOffset(gameconf, "ClientPrintf");
    if(offset == -1)
    {
        SetFailState("Failed to find offset for ClientPrintf");
        CloseHandle(gameconf);
    }
    StartPrepSDKCall(SDKCall_Static);
    if(!PrepSDKCall_SetFromConf(gameconf, SDKConf_Signature, "CreateInterface"))
    {
        SetFailState("Failed to get CreateInterface");
        CloseHandle(gameconf);
    }
    
    PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer);
    PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Pointer, VDECODE_FLAG_ALLOWNULL);
    PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
    
    new String:interface1[64];
    if(!GameConfGetKeyValue(gameconf, "EngineInterface", interface1, sizeof(interface1)))
    {
        SetFailState("Failed to get engine interface name");
        CloseHandle(gameconf);
    }
    
    new Handle:temp = EndPrepSDKCall();
    new Address:addr = SDKCall(temp, interface1, 0);
    
    CloseHandle(gameconf);
    CloseHandle(temp);
    
    if(!addr) SetFailState("Failed to get engine ptr");
    
    hClientPrintf = DHookCreate(offset, HookType_Raw, ReturnType_Void, ThisPointer_Ignore, Hook_ClientPrintf);
    DHookAddParam(hClientPrintf, HookParamType_Edict);
    DHookAddParam(hClientPrintf, HookParamType_CharPtr);
    DHookRaw(hClientPrintf, false, addr);
}
public MRESReturn:Hook_ClientPrintf(Handle:hParams)
{
    decl String:buffer[1024];
    DHookGetParamString(hParams, 2, buffer, 1024);
    if(buffer[1] == '"' && (StrContains(buffer, "\" (") != -1 || (StrContains(buffer, ".smx\" ") != -1))) 
    {
        DHookSetParamString(hParams, 2, "");
        return MRES_ChangedHandled;
    }
    else if(StrContains(buffer, "To see more, type \"sm plugins") != -1)
    {
        DHookSetParamString(hParams, 2, "¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶¶______¶¶¶____¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶__¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶______¶¶¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶______¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶______¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶______¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶¶_______¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶¶¶_______¶¶¶_____¶¶______¶¶______¶¶¶___¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶______¶¶¶¶_¶¶¶¶______¶¶¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶___¶¶¶¶¶¶¶¶¶¶¶_____¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶________¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶________¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶__________¶¶¶¶¶¶¶¶¶¶__________¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_________________________¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶__________________¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶");
        return MRES_ChangedHandled;
    }
    return MRES_Ignored;
}
 

SaInT.P

Участник
Сообщения
1,268
Реакции
226
komashchenko, Можешь скинуть пожалуста dhooks а то без него не хочет работать, а найти не могу dhooks
 

SaInT.P

Участник
Сообщения
1,268
Реакции
226
AlmazON, не видел чтото
Разделен на три сообщения выдает ошибку при запуске но компилируеться нормально
Добавлено через 9 минут
L 07/06/2015 - 19:15:59: [SM] Native "SetFailState" reported: Failed to get CreateBufferConf
L 07/06/2015 - 19:15:59: [SM] Displaying call stack trace for plugin "sm_plugins_block.smx":
L 07/06/2015 - 19:15:59: [SM] [0] Line 23, sm_plugins_block.sp::OnPluginStart()

Целиком который!
] sm plugins list
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
 
Последнее редактирование:

komashchenko

Идиот
Сообщения
916
Реакции
2,573
от нормально работать будет
PHP:
#include <sourcemod>
#include <dhooks>
#include <sdktools>

new Handle:hClientPrintf = INVALID_HANDLE;

public OnPluginStart()
{
    new Handle:gameconf = LoadGameConfigFile("clientprintf-hook.games");
    if (gameconf == INVALID_HANDLE)
    {
        SetFailState("Failed to find clientprintf-hook.games.txt gamedata");
    }
    new offset = GameConfGetOffset(gameconf, "ClientPrintf");
    if (offset == -1)
    {
        SetFailState("Failed to find offset for ClientPrintf");
        CloseHandle(gameconf);
    }
    StartPrepSDKCall(SDKCall_Static);
    if (!PrepSDKCall_SetFromConf(gameconf, SDKConf_Signature, "CreateInterface"))
    {
        SetFailState("Failed to get CreateInterface");
        CloseHandle(gameconf);
    }
    
    PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer);
    PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Pointer, VDECODE_FLAG_ALLOWNULL);
    PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
    
    new String:interface1[64];
    if (!GameConfGetKeyValue(gameconf, "EngineInterface", interface1, sizeof(interface1)))
    {
        SetFailState("Failed to get engine interface name");
        CloseHandle(gameconf);
    }
    
    new Handle:temp = EndPrepSDKCall();
    new Address:addr = SDKCall(temp, interface1, 0);
    
    CloseHandle(gameconf);
    CloseHandle(temp);
    
    if (!addr)SetFailState("Failed to get engine ptr");
    
    hClientPrintf = DHookCreate(offset, HookType_Raw, ReturnType_Void, ThisPointer_Ignore, Hook_ClientPrintf);
    DHookAddParam(hClientPrintf, HookParamType_Edict);
    DHookAddParam(hClientPrintf, HookParamType_CharPtr);
    DHookRaw(hClientPrintf, false, addr);
}
public MRESReturn:Hook_ClientPrintf(Handle:hParams)
{
    decl String:buffer[1024];
    int iClient = DHookGetParam(hParams, 1);
    DHookGetParamString(hParams, 2, buffer, 1024);
    if (buffer[1] == '"' && (StrContains(buffer, "\" (") != -1 || (StrContains(buffer, ".smx\" ") != -1)))
    {
        DHookSetParamString(hParams, 2, "");
        return MRES_ChangedHandled;
    }
    else if (StrContains(buffer, "To see more, type \"sm plugins") != -1)
    {
        PrintToConsole(iClient, " ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶");
        PrintToConsole(iClient, " ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶¶______¶¶¶____¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶");
        PrintToConsole(iClient, " ¶¶¶__¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶______¶¶¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶______¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶______¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶______¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶¶_______¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶¶¶_______¶¶¶_____¶¶______¶¶______¶¶¶___¶¶¶¶¶¶¶");
        DHookSetParamString(hParams, 2, " ¶¶¶¶¶¶¶¶______¶¶¶¶_¶¶¶¶______¶¶¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶___¶¶¶¶¶¶¶¶¶¶¶_____¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶________¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶________¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶__________¶¶¶¶¶¶¶¶¶¶__________¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_________________________¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶__________________¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n ");
        return MRES_ChangedHandled;
    }
    return MRES_Ignored;
}
 

SaInT.P

Участник
Сообщения
1,268
Реакции
226
komashchenko, Зачет!Спасибо!

Добавлено через 14 часов 0 минут
komashchenko, Почемуто он после смены карты перестал блокировать команду sm plugins list и стал показывать плагины снова
 
Последнее редактирование:
M

miracle

Привет всем.

а для v34 есть такое плагин, который будет на ней работать?
ответьте кто знает
 
Сверху Снизу