View Single Post
Author Message
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 01-11-2021 , 18:15   This code is blocking console commands
Reply With Quote #1

Hey there.
I use the below codes to create two spec bots.
Bots work fine but the problem which I am facing is that these codes are completely blocking all the console commands of other plugins. Means when I am using these codes none of the amx_ commands work even blocking my other sub plugin's console commands like those of zp_.

Somebody please help me fix this problem.

Codes --

In plugin_init() section --
Code:
set_task(0.5, "Task_CheckBots")
Task_CheckBots() function --
Code:
public Task_CheckBots()
{
	if (get_playersnum(1) < g_maxplayers && g_iBotsCount < 2)
	{
		static i
		for (i = 0; i < sizeof g_cBotNames; i++)
		{
			CreateBot(g_cBotNames[i]);
		}
	}
	return 0;
}
And Finally CreateBot() funtion --
Code:
public CreateBot(const iBotName[])
{
	static iBot;

	iBot = engfunc( EngFunc_CreateFakeClient, iBotName );
		
	dllfunc( MetaFunc_CallGameEntity, "player", iBot );
	set_pev( iBot, pev_flags, FL_FAKECLIENT );

	set_pev( iBot, pev_model, "" );
	set_pev( iBot, pev_viewmodel2, "" );
	set_pev( iBot, pev_modelindex, 0 );

	set_pev( iBot, pev_renderfx, kRenderFxNone );
	set_pev( iBot, pev_rendermode, kRenderTransAlpha );
	set_pev( iBot, pev_renderamt, 0.0 );

	set_pdata_int( iBot, 114, 3 );
	cs_set_user_team( iBot, CS_TEAM_UNASSIGNED );

	g_iBotsCount += 1;
	
	return PLUGIN_HANDLED
}
Waiting for your reply.
Thanks

Last edited by Abhinash; 01-13-2021 at 17:31.
Abhinash is offline