designer1337 / csgo-cheat-base

simple csgo internal base.
MIT License
238 stars 50 forks source link

NoFlash Help #93

Open cppjax opened 3 years ago

cppjax commented 3 years ago

I'm just using this base to get into creating CSGO cheats.

This is my current code for the NoFlash / Flash Reducer

void misc::visuals::reduceflash(c_usercmd* cmd)
{
    float flashalpha = !csgo::local_player->flash_alpha();
         while (true) {
           if (!variables::noflash_enable)
            return;
        if (!csgo::local_player->is_flashed())
              flashalpha = 0.f;
        return;

    }
}

It's really just a temporary code that I'm trying to figure out before I can even use this coding style / framework, as I don't currently understand it, critique would be nice. Don't need to be spoonfed. It makes sense in my head but doesn't work in game, at all.

designer1337 commented 3 years ago

void misc::visuals::reduceflash() { csgo::local_player->flash_alpha() = variables::noflash_enable ? 0.f : 255.f; }

designer1337 commented 3 years ago

Overall ur code doesn't make sense at all, remove everything and replace it with line i provided above

Don't pass cmd as argument it's not even used, also don't call this in create move, frame stage notify is the right place

cppjax commented 3 years ago

Understood, this coding style i'm just not used to and I'm new to making csgo cheats, I appreciate it dude! This well help me with the rest of the features.

cppjax commented 3 years ago

And yeah it was kind of a mess with the variables, I tried many different things.

milkshakegirlcollector commented 3 years ago
void misc::antiflash() {
    if (!variables::misc::antiflash || !csgo::local_player->is_alive())
        return;

    if (csgo::local_player->flash_duration() > 0) {
        csgo::local_player->flash_duration() = 0;
    }
};
drcrypter2007 commented 3 years ago

you aren't updating "flash_alpha", you're just updating it's copy from the function stack, not the player's flash alpha.