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

how to hook primammo for bot?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Leech_v2
Senior Member
Join Date: Mar 2011
Location: Chinese GuangDong
Old 07-23-2021 , 22:06   how to hook primammo for bot?
Reply With Quote #1

CS_InternalCommand and client_command is not work for bot.
I want to break "ammo1", "ammo2", "primammo", "secammo" command for czbot.
Code:
static cell AMX_NATIVE_CALL client_cmd(AMX *amx, cell *params) /* 2 param */
{
	int len;
	char* cmd = format_amxstring(amx, params, 2, len);
	cmd[len++] = '\n';
	cmd[len] = 0;

	if (params[1] == 0)
	{
		for (int i = 1; i <= gpGlobals->maxClients; ++i)
		{
			CPlayer* pPlayer = GET_PLAYER_POINTER_I(i);
			if (!pPlayer->IsBot() && pPlayer->initialized /*&& pPlayer->ingame*/)
				CLIENT_COMMAND(pPlayer->pEdict, "%s", cmd);
		}
	} else {
		int index = params[1];

		if (index < 1 || index > gpGlobals->maxClients)
		{
			LogError(amx, AMX_ERR_NATIVE, "Invalid player id %d", index);
			return 0;
		}

		CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);

		if (!pPlayer->IsBot() && pPlayer->initialized /*&& pPlayer->ingame*/)
			CLIENT_COMMAND(pPlayer->pEdict, "%s", cmd);
	}

	return len;
}
Leech_v2 is offline
Leech_v2
Senior Member
Join Date: Mar 2011
Location: Chinese GuangDong
Old 07-24-2021 , 01:48   Re: how to hook primammo for bot?
Reply With Quote #2

amx1.9.3
Leech_v2 is offline
Leech_v2
Senior Member
Join Date: Mar 2011
Location: Chinese GuangDong
Old 07-24-2021 , 05:16   Re: how to hook primammo for bot?
Reply With Quote #3

Is this not allowed?
Leech_v2 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 19:47.


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