I dont know if it is a bug or something
but the following code does not work like it should
1) i run this plugin and type !test
2) i expect that motd window will popup
3) and i expect log message will be in logs like this "TEST FOUND name=[info]"
but
4) no motd was popup
5) in logs i have only this lines "TEST FOUND name=[]"
Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <cstrike>
public Plugin:myinfo = {
name = "Test motd",
author = "Altex",
description = "Test motd",
version = "1.0",
url = ""
};
public OnPluginStart() {
RegConsoleCmd("test", TestCmd, "Test");
HookUserMessage(GetUserMessageId("VGUIMenu"), FuncVGuiMenu);
}
public Action:TestCmd(client, args) {
//ShowMOTDPanel(client, "", "http://otstrel.ru/csgo_ggdm_winner/csgo.php?close=15", MOTDPANEL_TYPE_URL);
SendSourceModMOTD(client);
return Plugin_Handled;
}
public Action:FuncVGuiMenu(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init) {
new String:name[10];
PbReadString(bf, "name", name, sizeof(name));
LogMessage("TEST FOUND name=[%s]", name);
}
stock SendSourceModMOTD(client)
{
new Handle:pb = StartMessageOne("VGUIMenu", client);
PbSetString(pb, "name", "info");
PbSetBool(pb, "show", true);
new Handle:subkey;
subkey = PbAddMessage(pb, "subkeys");
PbSetString(subkey, "name", "type");
PbSetString(subkey, "str", "2"); // MOTDPANEL_TYPE_URL
subkey = PbAddMessage(pb, "subkeys");
PbSetString(subkey, "name", "title");
PbSetString(subkey, "str", "TESTING");
subkey = PbAddMessage(pb, "subkeys");
PbSetString(subkey, "name", "msg");
PbSetString(subkey, "str", "http://otstrel.ru/csgo_ggdm_winner/csgo.php?close=15");
EndMessage();
}
__________________