I want to prevent displaying bomb on the scoreboard, because I want to remove all bomb defuse related stuff from de_* maps.
In sourcepawn it could be done by this:
Code:
#define ATTRIB_BOMB (1<<1)
public plugin_init()
{
register_message(get_user_msgid("ScoreAttrib"), "msg_scoreattrib")
}
public msg_scoreattrib(msgid, dest, id)
{
static attrib
attrib = get_msg_arg_int(2)
if(attrib == ATTRIB_BOMB)
set_msg_arg_int(2, ARG_BYTE, 0)
}
How to achieve that in sourcemod?
I tried id in similar way by hooking to user message:
Code:
public OnPluginStart()
{
g_msg_scoreattrib = GetUserMessageId("ScoreAttrib");
HookUserMessage(g_msg_scoreattrib, msg_scoreattrib, true);
}
public Action msg_scoreattrib(UserMsg msg_id, Protobuf msg, const int[] players, int playersNum, bool reliable, bool init)
{
// code
}
but I acutally don't know what to do in callback. I read that in sourcemod we can use Protobuf to read and write data, regardless of arguments order:
Code:
{
Protobuf.ReadInt(...)
int ReadInt(const char[] field, int index)
}
And i don't what are the names of field.
Any suggestions?