Modify No-Console (Solved)

Coding Help/Re-API Supported
User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#21

Post by Raheem » 6 years ago

I don't know how this shield maybe bypassed... And i'm not the guy who search for exploits and develop it... Make sense?
He who fails to plan is planning to fail

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

#22

Post by ArminC » 6 years ago

Oh.. now it's time to decrypt it.. but how.. if I find something I will reply..

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

#23

Post by ArminC » 6 years ago

I didn't find any solution.. can you add a cvar (1/0) in order to choose if I wana first "unbindall" or not?

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <reapi>

new const g_szDefaultBinds[][] =
{
	"bind ^"TAB^" ^"+showscores^"",
	"bind ^"ENTER^" ^"+attack^"",
	"bind ^"ESCAPE^" ^"cancelselect^"",
	"bind ^"SPACE^" ^"+jump^"",
	"bind ^"'^" ^"+moveup^"",
	"bind ^"+^" ^"sizeup^"",
	"bind ^",^" ^"buyammo1^"",
	"bind ^"-^" ^"sizedown^"",
	"bind ^".^" ^"buyammo2^"",
	"bind ^"/^" ^"+movedown^"",
	"bind ^"0^" ^"slot10^"",
	"bind ^"1^" ^"slot1^"",
	"bind ^"2^" ^"slot2^"",
	"bind ^"3^" ^"slot3^"",
	"bind ^"4^" ^"slot4^"",
	"bind ^"5^" ^"slot5^"",
	"bind ^"6^" ^"slot6^"",
	"bind ^"7^" ^"slot7^"",
	"bind ^"8^" ^"slot8^"",
	"bind ^"9^" ^"slot9^"",
	"bind ^";^" ^"+mlook^"",
	"bind ^"=^" ^"sizeup^"",
	"bind ^"[^" ^"invprev^"",
	"bind ^"]^" ^"invnext^"",
	"bind ^"`^" ^"toggleconsole^"",
	"bind ^"a^" ^"+moveleft^"",
	"bind ^"b^" ^"buy^"",
	"bind ^"c^" ^"radio3^"",
	"bind ^"d^" ^"+moveright^"",
	"bind ^"e^" ^"+use^"",
	"bind ^"f^" ^"impulse 100^"",
	"bind ^"g^" ^"drop^"",
	"bind ^"h^" ^"+commandmenu^"",
	"bind ^"j^" ^"cheer^"",
	"bind ^"k^" ^"+voicerecord^"",
	"bind ^"l^" ^"showbriefing^"",
	"bind ^"m^" ^"chooseteam^"",
	"bind ^"n^" ^"nightvision^"",
	"bind ^"o^" ^"buyequip^"",
	"bind ^"q^" ^"lastinv^"",
	"bind ^"r^" ^"+reload^"",
	"bind ^"s^" ^"+back^"",
	"bind ^"t^" ^"impulse 201^"",
	"bind ^"u^" ^"messagemode2^"",
	"bind ^"v^" ^"+moveup^"",
	"bind ^"w^" ^"+forward^"",
	"bind ^"x^" ^"radio2^"",
	"bind ^"y^" ^"messagemode^"",
	"bind ^"z^" ^"radio1^"",
	"bind ^"~^" ^"toggleconsole^"",
	"bind ^"UPARROW^" ^"+forward^"",
	"bind ^"DOWNARROW^" ^"+back^"",
	"bind ^"LEFTARROW^" ^"+left^"",
	"bind ^"RIGHTARROW^" ^"+right^"",
	"bind ^"ALT^" ^"+strafe^"",
	"bind ^"CTRL^" ^"+duck^"",
	"bind ^"SHIFT^" ^"+speed^"",
	"bind ^"F1^" ^"autobuy^"",
	"bind ^"F2^" ^"rebuy^"",
	"bind ^"F5^" ^"snapshot^"",
	"bind ^"F6^" ^"save quick^"",
	"bind ^"F7^" ^"load quick^"",
	"bind ^"F10^" ^"quit prompt^"",
	"bind ^"INS^" ^"+klook^"",
	"bind ^"PGDN^" ^"+lookdown^"",
	"bind ^"PGUP^" ^"+lookup^"",
	"bind ^"END^" ^"centerview^"",
	"bind ^"MWHEELDOWN^" ^"invnext^"",
	"bind ^"MWHEELUP^" ^"invprev^"",
	"bind ^"MOUSE1^" ^"+attack^"",
	"bind ^"MOUSE2^" ^"+attack2^"",
	"bind ^"PAUSE^" ^"pause^""
}

new const g_szCustomBinds[][] =
{
	"bind ^"c^" ^"+dellaser^"",
	"bind ^"v^" ^"+setlaser^"",
	"bind ^"x^" ^"+drag^"",
	"bind ^"MWHEELUP^" ^"+jump^""
}

new g_pBlockConsole, g_pDefaultBinds, g_pCustomBinds

public plugin_init()
{
	register_plugin("Client Exec Steam", "1.1", "Raheem")

	// HookChains
	RegisterHookChain(RG_CBasePlayer_PreThink, "Fw_PreThink_Pre", 0)

	// Pointer Cvars
	g_pBlockConsole = register_cvar("block_console_use", "0") // Who to block him from using console inside your server? 0 = Allow all | 1 = Block all | 2 = Allow admins only
	g_pDefaultBinds = register_cvar("bind_default_binds", "1") // Apply default binds at? 0 = No one | 1 = All players | 2 = All players but not admins
	g_pCustomBinds = register_cvar("bind_custom_binds", "1") // Apply custom binds at? 0 = No one | 1 = All players | 2 = All players but not admins
}

public client_authorized(id)
{
	// Default Binds
	if (get_pcvar_num(g_pDefaultBinds) == 0)
	{
		return PLUGIN_CONTINUE
	}
	else if (get_pcvar_num(g_pDefaultBinds) == 1)
	{
		Send_Cmd(id, "unbindall")
		
		for (new i = 0; i <= charsmax(g_szDefaultBinds); i++)
		{
			Send_Cmd(id, g_szDefaultBinds[i])
		}
	}
	else if (get_pcvar_num(g_pDefaultBinds) == 2)
	{
		if (is_user_admin(id))
			return PLUGIN_CONTINUE
		
		Send_Cmd(id, "unbindall")
		
		for (new i = 0; i <= charsmax(g_szDefaultBinds); i++)
		{
			Send_Cmd(id, g_szDefaultBinds[i])
		}
	}
	
	// Custom Binds
	if (get_pcvar_num(g_pCustomBinds) == 0)
	{
		return PLUGIN_CONTINUE
	}
	else if (get_pcvar_num(g_pCustomBinds) == 1)
	{
		for (new i = 0; i <= charsmax(g_szCustomBinds); i++)
		{
			Send_Cmd(id, g_szCustomBinds[i])
		}
	}
	else if (get_pcvar_num(g_pCustomBinds) == 2)
	{
		if (is_user_admin(id))
			return PLUGIN_CONTINUE
		
		for (new i = 0; i <= charsmax(g_szCustomBinds); i++)
		{
			Send_Cmd(id, g_szCustomBinds[i])
		}
	}
	
	return PLUGIN_CONTINUE
}

public Fw_PreThink_Pre(id)
{
	if (get_pcvar_num(g_pBlockConsole) == 0)
	{
		return HC_CONTINUE
	}
	else if (get_pcvar_num(g_pBlockConsole) == 1)
	{
		if (is_user_connected(id))
		{
			Send_Cmd(id, "hideconsole")
		}
	}
	else if (get_pcvar_num(g_pBlockConsole) == 2)
	{
		if (is_user_admin(id))
			return HC_CONTINUE
		
		if (is_user_connected(id))
		{
			Send_Cmd(id, "hideconsole")
		}
	}
	
	return HC_CONTINUE
}

stock Send_Cmd(id, szText[])
{
	message_begin(MSG_ONE, SVC_DIRECTOR, {0, 0, 0}, id)
	write_byte(strlen(szText) + 2)
	write_byte(10)
	write_string(szText)
	message_end()
}

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

#24

Post by ArminC » 6 years ago

Bump (..to put it in list with unsolved one..)

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#25

Post by Night Fury » 6 years ago

Try:

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <reapi>

new const g_szDefaultBinds[][] =
{
	"bind ^"TAB^" ^"+showscores^"",
	"bind ^"ENTER^" ^"+attack^"",
	"bind ^"ESCAPE^" ^"cancelselect^"",
	"bind ^"SPACE^" ^"+jump^"",
	"bind ^"'^" ^"+moveup^"",
	"bind ^"+^" ^"sizeup^"",
	"bind ^",^" ^"buyammo1^"",
	"bind ^"-^" ^"sizedown^"",
	"bind ^".^" ^"buyammo2^"",
	"bind ^"/^" ^"+movedown^"",
	"bind ^"0^" ^"slot10^"",
	"bind ^"1^" ^"slot1^"",
	"bind ^"2^" ^"slot2^"",
	"bind ^"3^" ^"slot3^"",
	"bind ^"4^" ^"slot4^"",
	"bind ^"5^" ^"slot5^"",
	"bind ^"6^" ^"slot6^"",
	"bind ^"7^" ^"slot7^"",
	"bind ^"8^" ^"slot8^"",
	"bind ^"9^" ^"slot9^"",
	"bind ^";^" ^"+mlook^"",
	"bind ^"=^" ^"sizeup^"",
	"bind ^"[^" ^"invprev^"",
	"bind ^"]^" ^"invnext^"",
	"bind ^"`^" ^"toggleconsole^"",
	"bind ^"a^" ^"+moveleft^"",
	"bind ^"b^" ^"buy^"",
	"bind ^"c^" ^"radio3^"",
	"bind ^"d^" ^"+moveright^"",
	"bind ^"e^" ^"+use^"",
	"bind ^"f^" ^"impulse 100^"",
	"bind ^"g^" ^"drop^"",
	"bind ^"h^" ^"+commandmenu^"",
	"bind ^"j^" ^"cheer^"",
	"bind ^"k^" ^"+voicerecord^"",
	"bind ^"l^" ^"showbriefing^"",
	"bind ^"m^" ^"chooseteam^"",
	"bind ^"n^" ^"nightvision^"",
	"bind ^"o^" ^"buyequip^"",
	"bind ^"q^" ^"lastinv^"",
	"bind ^"r^" ^"+reload^"",
	"bind ^"s^" ^"+back^"",
	"bind ^"t^" ^"impulse 201^"",
	"bind ^"u^" ^"messagemode2^"",
	"bind ^"v^" ^"+moveup^"",
	"bind ^"w^" ^"+forward^"",
	"bind ^"x^" ^"radio2^"",
	"bind ^"y^" ^"messagemode^"",
	"bind ^"z^" ^"radio1^"",
	"bind ^"~^" ^"toggleconsole^"",
	"bind ^"UPARROW^" ^"+forward^"",
	"bind ^"DOWNARROW^" ^"+back^"",
	"bind ^"LEFTARROW^" ^"+left^"",
	"bind ^"RIGHTARROW^" ^"+right^"",
	"bind ^"ALT^" ^"+strafe^"",
	"bind ^"CTRL^" ^"+duck^"",
	"bind ^"SHIFT^" ^"+speed^"",
	"bind ^"F1^" ^"autobuy^"",
	"bind ^"F2^" ^"rebuy^"",
	"bind ^"F5^" ^"snapshot^"",
	"bind ^"F6^" ^"save quick^"",
	"bind ^"F7^" ^"load quick^"",
	"bind ^"F10^" ^"quit prompt^"",
	"bind ^"INS^" ^"+klook^"",
	"bind ^"PGDN^" ^"+lookdown^"",
	"bind ^"PGUP^" ^"+lookup^"",
	"bind ^"END^" ^"centerview^"",
	"bind ^"MWHEELDOWN^" ^"invnext^"",
	"bind ^"MWHEELUP^" ^"invprev^"",
	"bind ^"MOUSE1^" ^"+attack^"",
	"bind ^"MOUSE2^" ^"+attack2^"",
	"bind ^"PAUSE^" ^"pause^""
}

new const g_szCustomBinds[][] =
{
	"bind ^"c^" ^"+dellaser^"",
	"bind ^"v^" ^"+setlaser^"",
	"bind ^"x^" ^"+drag^"",
	"bind ^"MWHEELUP^" ^"+jump^""
}

new g_pBlockConsole, g_pDefaultBinds, g_pCustomBinds, g_pUnbindAll

public plugin_init()
{
	register_plugin("Client Exec Steam", "1.1", "Raheem")

	// HookChains
	RegisterHookChain(RG_CBasePlayer_PreThink, "Fw_PreThink_Pre", 0)

	// Pointer Cvars
	g_pBlockConsole = register_cvar("block_console_use", "0") // Who to block him from using console inside your server? 0 = Allow all | 1 = Block all | 2 = Allow admins only
	g_pDefaultBinds = register_cvar("bind_default_binds", "1") // Apply default binds at? 0 = No one | 1 = All players | 2 = All players but not admins
	g_pCustomBinds = register_cvar("bind_custom_binds", "1") // Apply custom binds at? 0 = No one | 1 = All players | 2 = All players but not admins
	g_pUnbindAll = register_cvar("unbindall", "0")
}

public client_authorized(id)
{
	// Default Binds
	if (get_pcvar_num(g_pDefaultBinds) == 0)
	{
		return PLUGIN_CONTINUE
	}
	else if (get_pcvar_num(g_pDefaultBinds) == 1)
	{
		if (get_pcvar_num(g_pUnbindAll) == 1)
		{
			Send_Cmd(id, "unbindall")
		}
		
		for (new i = 0; i <= charsmax(g_szDefaultBinds); i++)
		{
			Send_Cmd(id, g_szDefaultBinds[i])
		}
	}
	else if (get_pcvar_num(g_pDefaultBinds) == 2)
	{
		if (is_user_admin(id))
			return PLUGIN_CONTINUE
		
		if (get_pcvar_num(g_pUnbindAll) == 1)
		{
			Send_Cmd(id, "unbindall")
		}
		
		for (new i = 0; i <= charsmax(g_szDefaultBinds); i++)
		{
			Send_Cmd(id, g_szDefaultBinds[i])
		}
	}
	
	// Custom Binds
	if (get_pcvar_num(g_pCustomBinds) == 0)
	{
		return PLUGIN_CONTINUE
	}
	else if (get_pcvar_num(g_pCustomBinds) == 1)
	{
		for (new i = 0; i <= charsmax(g_szCustomBinds); i++)
		{
			Send_Cmd(id, g_szCustomBinds[i])
		}
	}
	else if (get_pcvar_num(g_pCustomBinds) == 2)
	{
		if (is_user_admin(id))
			return PLUGIN_CONTINUE
		
		for (new i = 0; i <= charsmax(g_szCustomBinds); i++)
		{
			Send_Cmd(id, g_szCustomBinds[i])
		}
	}
	
	return PLUGIN_CONTINUE
}

public Fw_PreThink_Pre(id)
{
	if (get_pcvar_num(g_pBlockConsole) == 0)
	{
		return HC_CONTINUE
	}
	else if (get_pcvar_num(g_pBlockConsole) == 1)
	{
		if (is_user_connected(id))
		{
			Send_Cmd(id, "hideconsole")
		}
	}
	else if (get_pcvar_num(g_pBlockConsole) == 2)
	{
		if (is_user_admin(id))
			return HC_CONTINUE
		
		if (is_user_connected(id))
		{
			Send_Cmd(id, "hideconsole")
		}
	}
	
	return HC_CONTINUE
}

stock Send_Cmd(id, szText[])
{
	message_begin(MSG_ONE, SVC_DIRECTOR, {0, 0, 0}, id)
	write_byte(strlen(szText) + 2)
	write_byte(10)
	write_string(szText)
	message_end()
}
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

#26

Post by ArminC » 6 years ago

But now I see that it don't bind.. I tried more clients.. and more cvars .. nothing :-? (Same with old versions)

Edit: If I apply only Custom binds it don't work.. If I apply first the default binds then the custom binds it work :-/

Custom Binds only don't apply
Default Binds -> Custom Binds - apply
:x

Help?

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 1 guest