alza54 / opensource2

(Open)Source² — a reasonable CS2 Open Source SDK for your projects.
MIT License
96 stars 12 forks source link

Problem with CUserCmdBase #11

Open unknownguy1993 opened 1 year ago

unknownguy1993 commented 1 year ago

I am trying to give 450.f value like in csgo to m_forwardmove, but it doesn't really do anything, I tried to print the value and I get only 0, I want to know if it is an offsets problem or something else to implement?

class CUserCmdBase { public: PAD_CLASS(0x40); QAngle m_viewangles; int m_command_number; int m_tick_count; float m_forwardmove; float m_rightmove; float m_upmove; };

unknownguy1993 commented 1 year ago

In cs:go the forward move range was from -450.f to 450.f, and now it goes from -1.f to 1.f, I try to give it a value from createmove but it doesn't really work, any idea?

class CUserCmdBase { public: PAD_CLASS(0x40); QAngle m_viewangles; int m_command_number; float m_forwardmove; float m_sidemove; };

class CUserCmd {
 public:
  PAD_CLASS(0x20);
  CSubTickContainer m_sub_tick_container;
  CUserCmdBase* m_base_cmd;
  int m_start_history_index_attack1;
  int m_start_history_index_attack2;
  int m_start_history_index_attack3;
  PAD_CLASS(0x8);
  uint64_t m_buttons;
  uint64_t m_buttons_changed;
  uint64_t m_buttons_scroll;

  PAD_CLASS(0x8);
};

 CUserCmd* cmd = input->get_user_cmd();

  if (cmd == nullptr) {
   return;
  }

  auto base_cmd = *cmd->m_base_cmd;
  base_cmd.m_forwardmove = 1.f;`
maecry commented 1 year ago

auto base_cmd = *cmd->m_base_cmd;

why would you deref the ptr? ofc it wont modify anything dumbass (bro even went on new github acc to avoid getting bully 💀💀💀)

alza54 commented 1 year ago

@unknownguy1993 can’t really assist right now. The class has to be verified is it up-to-date. Current goals are around visuals.

Suggest a feature and it will be added in next releases.

unknownguy1993 commented 1 year ago

auto base_cmd = *cmd->m_base_cmd;

¿Por qué eliminarías el ptr? Por supuesto, no modificará nada, tonto (el hermano incluso ingresó a una nueva cuenta de github para evitar ser intimidado 💀💀💀)

auto base_cmd = *cmd->m_base_cmd;

why would you deref the ptr? ofc it wont modify anything dumbass (bro even went on new github acc to avoid getting bully 💀💀💀)

I just created my account because I didn't have one, I'm new to this, I was asking you with the best of intentions, because now m_forwardmove in csgo was going from -450.f to 450.f and now it only goes from -1.f to 1.f, and I can't modify its value, I was waiting for help, but I didn't expect you to be toxic

unknownguy1993 commented 1 year ago

auto base_cmd = *cmd->m_base_cmd;

why would you deref the ptr? ofc it wont modify anything dumbass (bro even went on new github acc to avoid getting bully 💀💀💀)

And thanks for your sarcastic comment, the error was the "" that was in cmd->m_base_cmd, I moved it to "auto" and now it works, thanks

alza54 commented 1 year ago

@unknownguy1993 Could you elaborate? What are you trying to create and what did help you?

alza54 commented 1 year ago

Your comment might help other users so it’s good to share the information.

maecry commented 1 year ago

@unknownguy1993 Could you elaborate? What are you trying to create and what did help you?

Just dont deref the ptr and it should be fine as i said earlier Aka auto base_cmd = cmd->m_base_cmd; (no "*" symbol !!!!!) He was making a copy to base cmd ptr, so he just modified the copied one, not the actual basecmd

unknownguy1993 commented 1 year ago

@unknownguy1993 Could you elaborate? What are you trying to create and what did help you?

Just dont deref the ptr and it should be fine as i said earlier Aka auto base_cmd = cmd->m_base_cmd; (no "*" symbol !!!!!) He was making a copy to base cmd ptr, so he just modified the copied one, not the actual basecmd

auto* base_cmd = cmd->m_base_cmd; I just did that and it works, it needs the * anyway, the problem was where I placed it :)

unknownguy1993 commented 1 year ago

@unknownguy1993 Could you elaborate? What are you trying to create and what did help you?

in game_hooks.cpp on line 94 instead of auto base_cmd = *cmd->m_base_cmd; is -> auto* base_cmd = cmd->m_base_cmd;