Raised This Month: $ Target: $400
 0% 

Removing bots from scoreboard


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 06-10-2013 , 21:33   Re: Removing bots from scoreboard
Reply With Quote #1

You don't need orpheu or rage. Just hook the correct messages and block when it's related to bots.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-11-2013 , 09:43   Re: Removing bots from scoreboard
Reply With Quote #2

What messages would those be?
Backstabnoob is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-02-2013 , 20:17   Re: Removing bots from scoreboard
Reply With Quote #3

Bump
Backstabnoob is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 11-02-2013 , 20:55   Re: Removing bots from scoreboard
Reply With Quote #4

Wouldnt this work if you edit it a little or am i totaly wrong?

Code:
#include < amxmodx >
#include < fakemeta >
#include < orpheu >

#pragma semicolon 1

#define PLUGIN "Invisible Spectator"
#define VERSION "0.0.1"

#define cm(%0)	( sizeof(%0) - 1 )

const m_iTeam = 114;
const TEAM_SPECTATOR = 3;

new g_bPlayerVisible[33 char];

new g_iMaxPlayers;

public plugin_init()
{
	register_plugin( PLUGIN, VERSION, "ConnorMcLeod" );

	register_clcmd("say", "Host_Say", 0);
	register_clcmd("say_team", "Host_Say", 1);

	register_event("TeamInfo", "Event_TeamInfo", "a", "2=TERRORIST", "2=CT");

	g_iMaxPlayers = get_maxplayers();

	OrpheuRegisterHook( OrpheuGetFunction("SV_FullClientUpdate"), "OnSV_FullClientUpdate_P", OrpheuHookPost);

	register_clcmd("amx_spectate", "ClCmd_Spectate", ADMIN_BAN);
}

// void SV_FullClientUpdate(client_t * client, sizebuf_t *buf)
public OrpheuHookReturn:OnSV_FullClientUpdate_P( /* client, buffer */ )
{
	for(new id=1; id<=g_iMaxPlayers; id++)
	{
		if( !g_bPlayerVisible{id} )
		{
			Util_SVC_UPDATEUSERINFO(0, id, get_user_userid(id), "");
		}
	}

	return OrpheuIgnored;
}

public Host_Say(id)
{
	if( !g_bPlayerVisible{id} )
	{
		client_print(id, print_chat, "You are an invisible spectator, better to be quiet !!!");
		return PLUGIN_HANDLED_MAIN;
	}
	return PLUGIN_CONTINUE;
}

public client_putinserver(id)
{
	g_bPlayerVisible{id} = true;
}

public client_connect(id)
{
	g_bPlayerVisible{id} = true;
}

public client_disconnect(id)
{
	g_bPlayerVisible{id} = true;
}

public ClCmd_Spectate(id, level)
{
	if( get_user_flags(id) & level && !is_user_alive(id) && get_pdata_int(id, m_iTeam) == TEAM_SPECTATOR )
	{
		if( (g_bPlayerVisible{id} = !g_bPlayerVisible{id}) )
		{
			client_print(id, print_chat, "You are now visible");
			ResetUserModelInfo(id);
		}
		else
		{
			client_print(id, print_chat, "You are now invisible");
			Util_SVC_UPDATEUSERINFO(0, id, get_user_userid(id), "");
		}
		
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

ResetUserModelInfo( id )
{
	static const model[] = "model";
	static value[200];
	get_user_info(id, model, value, cm(value));
	set_user_info(id, model, "");
	set_user_info(id, model, value);
}

Util_SVC_UPDATEUSERINFO(id, clId, clUserid, clUserInfo[])
{
	message_begin(id ? MSG_ONE : MSG_ALL, SVC_UPDATEUSERINFO, _, id);
	write_byte(clId-1);
	write_long(clUserid);
	write_string(clUserInfo);
	write_long(0);
	write_long(0);
	write_long(0);
	write_long(0);
	message_end();
}

public Event_TeamInfo()
{
	new id = read_data(1);
	if( !g_bPlayerVisible{id} )
	{
		g_bPlayerVisible{id} = true;
		ResetUserModelInfo(id);
	}
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 11-02-2013 at 20:56.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-02-2013 , 21:20   Re: Removing bots from scoreboard
Reply With Quote #5

Looks like it might, thanks for that. I'll try it.
Backstabnoob is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 11-03-2013 , 02:12   Re: Removing bots from scoreboard
Reply With Quote #6

Quote:
Originally Posted by Backstabnoob View Post
Looks like it might, thanks for that. I'll try it.
It works perfectly and will be suitable for you. I only noticed it a few weeks ago in his invisible spectator thread.

Thought you would have seen it already since you hadn't bumped in 4 months ;)

Last edited by hornet; 11-03-2013 at 02:12.
hornet is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-03-2013 , 07:28   Re: Removing bots from scoreboard
Reply With Quote #7

Awesome. I haven't been that active on AM recently and I also stopped working on the mod for a couple months.

Congratulations on becoming a plugin approver, by the way.
Backstabnoob is offline
Reply



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 16:16.


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