Raised This Month: $ Target: $400
 0% 

Scoreboard - block or hide C4 status


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Soldier.Zi
Junior Member
Join Date: Feb 2014
Old 06-03-2022 , 11:43   Scoreboard - block or hide C4 status
Reply With Quote #1

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?

Last edited by Soldier.Zi; 06-03-2022 at 11:44.
Soldier.Zi is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode