Raised This Month: $ Target: $400
 0% 

Instant AutoTeamBalance


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 05-28-2013 , 01:38   Re: Instant AutoTeamBalance
Reply With Quote #1

how to remove chat message from this code?

Code:
/*	Formatright © 2010, ConnorMcLeod

	This plugin is free software;
	you can redistribute it and/or modify it under the terms of the
	GNU General Public License as published by the Free Software Foundation.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this plugin; if not, write to the
	Free Software Foundation, Inc., 59 Temple Place - Suite 330,
	Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <orpheu>

#define VERSION "0.0.2"
#define PLUGIN "Instant AutoTeam Balance"

new OrpheuFunction:g_OfBalanceTeams 
new OrpheuFunction:g_OfClientPrintAll
new g_pGameRules

public plugin_precache()
{
	OrpheuRegisterHook(OrpheuGetFunction("InstallGameRules"), "OnInstallGameRules_Post", OrpheuHookPost)
}

public OnInstallGameRules_Post()
{
	g_pGameRules = OrpheuGetReturn()
}

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

	g_OfBalanceTeams = OrpheuGetFunction("BalanceTeams", "CHalfLifeMultiplay")
	g_OfClientPrintAll = OrpheuGetFunction("UTIL_ClientPrintAll")

	register_event("TextMsg", "Ev_TextMsg_TeamBalanceNextRound", "a", "1=4", "2=#Auto_Team_Balance_Next_Round")
}

public Ev_TextMsg_TeamBalanceNextRound()
{
	static bool:bHooking = false
	if( bHooking )
	{   // Send BalanceTeams Call the message we are just post hooking...
		return
	}

	bHooking = true
	OrpheuCall(g_OfBalanceTeams, g_pGameRules)
	bHooking = false

	UTIL_ClientPrintAll(print_center, "Teams Auto Balanced")
}

UTIL_ClientPrintAll(msg_dest, const msg_name[], const param1[] = "", const param2[] = "", const param3[] = "", const param4[] = "")
{
	OrpheuCall(g_OfClientPrintAll, msg_dest, msg_name, param1, param2, param3, param4)
}
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 05-28-2013 , 02:00   Re: Instant AutoTeamBalance
Reply With Quote #2

Quote:
Originally Posted by TRUE RED View Post
how to remove chat message from this code?

Code:
/*	Formatright © 2010, ConnorMcLeod

	This plugin is free software;
	you can redistribute it and/or modify it under the terms of the
	GNU General Public License as published by the Free Software Foundation.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this plugin; if not, write to the
	Free Software Foundation, Inc., 59 Temple Place - Suite 330,
	Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <orpheu>

#define VERSION "0.0.2"
#define PLUGIN "Instant AutoTeam Balance"

new OrpheuFunction:g_OfBalanceTeams 
new OrpheuFunction:g_OfClientPrintAll
new g_pGameRules

public plugin_precache()
{
	OrpheuRegisterHook(OrpheuGetFunction("InstallGameRules"), "OnInstallGameRules_Post", OrpheuHookPost)
}

public OnInstallGameRules_Post()
{
	g_pGameRules = OrpheuGetReturn()
}

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

	g_OfBalanceTeams = OrpheuGetFunction("BalanceTeams", "CHalfLifeMultiplay")
	g_OfClientPrintAll = OrpheuGetFunction("UTIL_ClientPrintAll")

	register_event("TextMsg", "Ev_TextMsg_TeamBalanceNextRound", "a", "1=4", "2=#Auto_Team_Balance_Next_Round")
}

public Ev_TextMsg_TeamBalanceNextRound()
{
	static bool:bHooking = false
	if( bHooking )
	{   // Send BalanceTeams Call the message we are just post hooking...
		return
	}

	bHooking = true
	OrpheuCall(g_OfBalanceTeams, g_pGameRules)
	bHooking = false

	UTIL_ClientPrintAll(print_center, "Teams Auto Balanced")
}

UTIL_ClientPrintAll(msg_dest, const msg_name[], const param1[] = "", const param2[] = "", const param3[] = "", const param4[] = "")
{
	OrpheuCall(g_OfClientPrintAll, msg_dest, msg_name, param1, param2, param3, param4)
}
I think you know it.
__________________
youtube:
@holla16
11922911 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 20:14.


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