Raised This Month: $32 Target: $400
 8% 

Scoreboard - block or hide C4 status


Post New Thread Reply   
 
Thread Tools Display Modes
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
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-03-2022 , 12:10   Re: Scoreboard - block or hide C4 status
Reply With Quote #2

Quote:
Originally Posted by Soldier.Zi View Post
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?
CSGO or CSS?
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Soldier.Zi
Junior Member
Join Date: Feb 2014
Old 06-03-2022 , 12:15   Re: Scoreboard - block or hide C4 status
Reply With Quote #3

CS:GO
Soldier.Zi is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-03-2022 , 12:18   Re: Scoreboard - block or hide C4 status
Reply With Quote #4

Quote:
Originally Posted by Soldier.Zi View Post
CS:GO
After making some checks I couldn't find a concrete solution. Why not remove the bomb itself?
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Soldier.Zi
Junior Member
Join Date: Feb 2014
Old 06-05-2022 , 12:45   Re: Scoreboard - block or hide C4 status
Reply With Quote #5

Yes it worked. I removed bomb by using RemoveEntity in forward OnEntityCreated
and searching for "weapon_c4".

Last edited by Soldier.Zi; 06-05-2022 at 12:46.
Soldier.Zi is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-06-2022 , 00:50   Re: Scoreboard - block or hide C4 status
Reply With Quote #6

Quote:
Originally Posted by Soldier.Zi View Post
Yes it worked. I removed bomb by using RemoveEntity in forward OnEntityCreated
and searching for "weapon_c4".
"mp_give_player_c4" = "1" min. 0.000000 max. 1.000000 client replicated - Whether this map should spawn a c4 bomb for a player or not.

Might be required to be set via a plugin instead of server.cfg, because the map / engine might change this value
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Reply


Thread Tools
Display Modes

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 02:18.


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