Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can u add onentitycreated and deleteentity to cheat #44

Closed
mp3096 opened this issue Aug 29, 2022 · 7 comments
Closed

Can u add onentitycreated and deleteentity to cheat #44

mp3096 opened this issue Aug 29, 2022 · 7 comments
Labels
idea Something which can be a good thing to make in future

Comments

@mp3096
Copy link

mp3096 commented Aug 29, 2022

class IClientEntityListener
{
public:
virtual void OnEntityCreated( C_BaseEntity* pEntity ) {}
virtual void OnEntityDeleted( C_BaseEntity* pEntity ) {}
};

class CClientEntityList
{
public:
virtual ~CClientEntityList() {}

void AddListenerEntity( IClientEntityListener* pListener )
{
	m_entityListeners.AddToTail( pListener );
}

void RemoveListenerEntity( IClientEntityListener* pListener )
{
	m_entityListeners.FindAndRemove( pListener );
}

private:
CUtlVector<IClientEntityListener*> m_entityListeners;
};

//
class CClientEntityListener : public IClientEntityListener
{
void OnEntityCreated( C_BaseEntity* pEntity ) override
{
// use pEntity
}

void OnEntityDeleted( C_BaseEntity* pEntity ) override
{
	// use pEntity
}

};
m_Listener = new CClientEntityListener();
entitylist->AddListenerEntity( m_Listener );

//
entitylist->RemoveListenerEntity( m_Listener );
delete m_Listener;
this is partial code u might find whole code somewhere
Thank you.

@Bartis1313
Copy link
Owner

Bartis1313 commented Aug 29, 2022

Any explanation of why would it be helpful in my code?
Also, following the code you have one global listener field which is on heap for no reason, and to recreate you probably reallocate this filed. This is not what do you want to store on the heap at all.

This addon makes no sense, you can see how easily it is in source to deal with events handled by yourself, comments will help you.
I ignored part that this particular part of code does not apply to this source at all.

@Bartis1313 Bartis1313 added the wrong Makes no sense or the logic is completely wrong label Aug 29, 2022
@mp3096
Copy link
Author

mp3096 commented Aug 29, 2022

Thanks for quick response the code I posted above was from difference source https://gitlab.com/counterstrikesource/ze-elite/-/blob/master/Project/ClientEntityListener.h

I was trying to port css feature to this cheat (auto laser )but couldn’t find those 2 (on create and delete)that’s why I was curious. I will tinker with it Events . Thanks for help

@Bartis1313
Copy link
Owner

You shouldn't rely on people's code, but rely on valve's public or leaked SDKs.
Events are here, and any cheat will use them in the same way. Maybe some people want to hook vfunc themselves and listen events like that, which doesn't work well for some events.
Anyway, for example you can take a look at: hitmarker, bullet tracer.
I also have no idea what "auto laser" is.

@mp3096
Copy link
Author

mp3096 commented Aug 30, 2022

You have discord I can add u in? Btw here is demo of auto laser https://youtu.be/NF174hOwDOc
Basically there is boss entity which spawns laser either u crouch/jump to avoid them else die simple that was feature for css I was trying to implement for csgo

@Bartis1313
Copy link
Owner

I don't think this is what most people want, this is more like a personal request.
There are several ways how to achieve it. My logic would be:

  1. Get the latest laser entity.
  2. Get your current position
  3. Get the laser position with width
  4. Now you can use tracing or calculate it by yourself if width is "touching" your player model. By calculating delta in positions you can easily test when to jump or crouch. And delay must be related to the boss ent velocity speed, you don't want to crouch/jump all the time. Stop is basically when boss entity is behind you (use dot product or W2S to detect it)
  5. Profit

@mp3096
Copy link
Author

mp3096 commented Aug 30, 2022

Thanks for help by any chance can u add me in discord if possible - flick7k#7284
You can close this.

@Bartis1313 Bartis1313 removed the wrong Makes no sense or the logic is completely wrong label Apr 9, 2023
@Bartis1313
Copy link
Owner

Sorry for bumping.
For reader: use cache entity system provided in the cheat, add own types if needed

@Bartis1313 Bartis1313 added the idea Something which can be a good thing to make in future label Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Something which can be a good thing to make in future
Projects
None yet
Development

No branches or pull requests

2 participants