Raised This Month: $51 Target: $400
 12% 

Hooking bots hurt


Post New Thread Reply   
 
Thread Tools Display Modes
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 02-27-2024 , 18:09   Re: Hooking bots hurt
Reply With Quote #21

Quote:
Originally Posted by WATCH_D0GS UNITED View Post
Not and will not, because you are trying to register ham for bots in a forward which is not called for bots, lol.
This thread is from 2009.
On your quote he is not registering ham, he is registering a forward with fakemeta.
__________________

Last edited by Jhob94; 02-27-2024 at 18:11.
Jhob94 is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 02-27-2024 , 18:33   Re: Hooking bots hurt
Reply With Quote #22

Quote:
Originally Posted by Jhob94 View Post
This thread is from 2009.
On your quote he is not registering ham, he is registering a forward with fakemeta.
It is a unsolved thread from 2009, what cares the day it was published, it could be 00/00/0000.

And We are talking about this:

Quote:
Originally Posted by ConnorMcLeod View Post
Then, you would have to set 3 values for gBotsRegistered :

0 = not registered
1 = registering soon
2 = registered

Advantage is that you don't use any task + it's immediatly registered.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.0.1"

new g_iFhUpdateClientDatag_iFirstBotId

public plugin_init()
{
    
register_plugin("TakeDamage"VERSION"ConnorMcLeod")

    new 
szModName[6]
    
get_modname(szModNamecharsmax(szModName))
    if( !
equal(szModName"czero") || cvar_exists("pb_version") )
    {
        
g_iFhUpdateClientData = -1
    
}

    
RegisterHam(Ham_TakeDamage"player""Player_TakeDamage")
}

public 
client_putinserverid )
{
    if( !
g_iFhUpdateClientData && is_user_bot(id) )
    {
        
g_iFirstBotId id
        g_iFhUpdateClientData 
register_forward(FM_UpdateClientData"UpdateClientData")
    }
    
}

public 
UpdateClientData(id)
{
    if( 
id == g_iFirstBotId )
    {
        
unregister_forward(FM_UpdateClientDatag_iFhUpdateClientData)
        
RegisterHamFromEntity(Ham_TakeDamageid"Player_TakeDamage")
    }
}

public 
Player_TakeDamageid iInflictor iAttackerFloat:flDamage iDamageType )
{


PHP Code:
public UpdateClientData(id)
{
    if( 
id == g_iFirstBotId )
    {
        
unregister_forward(FM_UpdateClientDatag_iFhUpdateClientData)
        
RegisterHamFromEntity(Ham_TakeDamageid"Player_TakeDamage")
    }

__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 02-28-2024 , 04:04   Re: Hooking bots hurt
Reply With Quote #23

Back in 2009 threads didn’t have solved/unsolved feature.

I can’t be 100% sure because i never used bots in my life but that’s how you register takedamage from an entity (taking damage from a npc for example). So it probably also works with bots.
__________________
Jhob94 is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 02-28-2024 , 07:26   Re: Hooking bots hurt
Reply With Quote #24

Quote:
Originally Posted by Jhob94 View Post
Back in 2009 threads didn’t have solved/unsolved feature.

I can’t be 100% sure because i never used bots in my life but that’s how you register takedamage from an entity (taking damage from a npc for example). So it probably also works with bots.
That's the way you register ham from entity, but he tried to make this in a function which is not called for bots.

This means the 'id' he is passing is always from a human player. You need to register ham for bots with a bot id for it to work.

-
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 02-28-2024 , 11:39   Re: Hooking bots hurt
Reply With Quote #25

Since he uses bot id he is not passing a real player id. The only thing that could happen would be the code not work if updateclientdata ignores bots.

Code:
void UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd)
{
	g_cd_hook = cd;
	FM_ENG_HANDLE(FM_UpdateClientData, (Engine[FM_UpdateClientData].at(i), (cell)ENTINDEX(ent), (cell)sendweapons, (cell)cd));
	RETURN_META(mswi(lastFmRes));
}

void UpdateClientData_post(const struct edict_s *ent, int sendweapons, struct clientdata_s *cd)
{
	g_cd_hook = cd;
	FM_ENG_HANDLE_POST(FM_UpdateClientData, (EnginePost[FM_UpdateClientData].at(i), (cell)ENTINDEX(ent), (cell)sendweapons, (cell)cd));
	RETURN_META(MRES_IGNORED);
}
I am on mobile phone so i couldn’t search much about it. From what i found it should work with bots.
I don’t have the opportunity to test it today, maybe you can.
__________________
Jhob94 is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 02-28-2024 , 13:46   Re: Hooking bots hurt
Reply With Quote #26

Quote:
Originally Posted by Jhob94 View Post
Since he uses bot id he is not passing a real player id. The only thing that could happen would be the code not work if updateclientdata ignores bots.
As We have tried to say since the beginning, FM_UpdateClientData is not called for bots, which means his code below will always return false.

PHP Code:
 if( id == g_iFirstBotId 
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 02-28-2024 , 15:11   Re: Hooking bots hurt
Reply With Quote #27

Well if it doesn’t it ain’t a problem. Just register ham from entity on bot connection. Problem solved.

But are you sure it is not called for bots?
__________________
Jhob94 is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 02-28-2024 , 21:32   Re: Hooking bots hurt
Reply With Quote #28

Quote:
Originally Posted by Jhob94 View Post
But are you sure it is not called for bots?
If you are expecting a bot to have framerate.
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED 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 18:31.


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