danielkrupinski / Osiris

Cross-platform game hack for Counter-Strike 2 with Panorama-based GUI.
MIT License
3.35k stars 961 forks source link

[Suggestion] Info spammer #2147

Closed Natural-Selection09 closed 1 year ago

Natural-Selection09 commented 4 years ago

Hello, i'm just wanting to make a suggestion, sorry if it's not the right place.

I'm suggesting to add a simple chat spammer that gives the infos on the ennemy team and send them to our team. Where you could configure what it's saying like for exemple the name, the HP of the player, his weapon, his position, and the delay between every messages so it doesn't spam that much.

Here's a simple exemple: Nickname | 100 HP | Palace

It's pretty cool when you are playing with legit players. Anyway, thank you for your work. Hopefully you will add this feature.

KleiFrickHeckDeck264 commented 4 years ago

not that hard to make it ur self ngl just grab the info name from player_info health from the entity and place thru Get_Callout() combine all of that and say it in the team chat

MasterChief220 commented 4 years ago

not that hard to make it ur self ngl just grab the info name from player_info health from the entity and place thru Get_Callout() combine all of that and say it in the team chat

can u add that to the code . Idrk much coding mate

KernCS commented 4 years ago

not very good but here:

    if (config->misc.location_spammer)
    {
        static int lastId = 1;
        if (!interfaces->engine->isInGame())
            return;

        for (int i = lastId; i < interfaces->engine->getMaxClients(); i++)
        {
            const auto Player = interfaces->entityList->getEntity(i);
            lastId++;
            if (lastId == interfaces->engine->getMaxClients())
                lastId = 1;
            if (!Player || Player->isDormant() || !Player->isAlive())
                continue;

            PlayerInfo entityInformation;
            interfaces->engine->getPlayerInfo(i, entityInformation);
            std::string playerName = std::string(entityInformation.name);
            playerName.erase(std::remove(playerName.begin(), playerName.end(), ';'), playerName.end());
            playerName.erase(std::remove(playerName.begin(), playerName.end(), '"'), playerName.end());
            // Remove end line character
            playerName.erase(std::remove(playerName.begin(), playerName.end(), '\n'), playerName.end());
            // Construct a command with our message
            pstring str;
            str << ("say_team") << " \"";

                str << playerName << " | ";

                str << Player->health() << "HP | ";

                str << Player->lastPlaceName();

                str << "\"";

                interfaces->engine->clientCmdUnrestricted(str.c_str());

                break;
        }
    }
aljawary commented 4 years ago

not very good but here:

    if (config->misc.location_spammer)
    {
        static int lastId = 1;
        if (!interfaces->engine->isInGame())
            return;

        for (int i = lastId; i < interfaces->engine->getMaxClients(); i++)
        {
            const auto Player = interfaces->entityList->getEntity(i);
            lastId++;
            if (lastId == interfaces->engine->getMaxClients())
                lastId = 1;
            if (!Player || Player->isDormant() || !Player->isAlive())
                continue;

            PlayerInfo entityInformation;
            interfaces->engine->getPlayerInfo(i, entityInformation);
            std::string playerName = std::string(entityInformation.name);
            playerName.erase(std::remove(playerName.begin(), playerName.end(), ';'), playerName.end());
            playerName.erase(std::remove(playerName.begin(), playerName.end(), '"'), playerName.end());
            // Remove end line character
            playerName.erase(std::remove(playerName.begin(), playerName.end(), '\n'), playerName.end());
            // Construct a command with our message
            pstring str;
            str << ("say_team") << " \"";

                str << playerName << " | ";

                str << Player->health() << "HP | ";

                str << Player->lastPlaceName();

                str << "\"";

                interfaces->engine->clientCmdUnrestricted(str.c_str());

                break;
        }
    }

help ! https://prnt.sc/ubud3p

KernCS commented 4 years ago

help ! https://prnt.sc/ubud3p

My bad Make a new file called pstring.h and input this

#pragma once

#include <string>
#include <sstream>

class pstring : public std::string
{
public:
    pstring() : std::string() {}

    template<typename T>
    pstring(const T v) : std::string(v) {}

    template<typename T>
    pstring& operator<<(const T s)
    {
        std::stringstream stream;
        stream << *this;
        stream << s;
        *this = stream.str();
        return *this;
    }

    pstring& operator+(const unsigned int i)
    {
        std::stringstream stream;
        stream << *this;
        stream << i;
        *this = stream.str();
        return *this;
    }
};
aljawary commented 4 years ago

help ! https://prnt.sc/ubud3p

My bad Make a new file called pstring.h and input this

#pragma once

#include <string>
#include <sstream>

class pstring : public std::string
{
public:
  pstring() : std::string() {}

  template<typename T>
  pstring(const T v) : std::string(v) {}

  template<typename T>
  pstring& operator<<(const T s)
  {
      std::stringstream stream;
      stream << *this;
      stream << s;
      *this = stream.str();
      return *this;
  }

  pstring& operator+(const unsigned int i)
  {
      std::stringstream stream;
      stream << *this;
      stream << i;
      *this = stream.str();
      return *this;
  }
};

can u give me lastplacename entity and where do i need to call this function?

KernCS commented 4 years ago

can u give me lastplacename entity and where do i need to call this function?

Under NETVAR(viewPunchAngle, "CBasePlayer", "m_viewPunchAngle", Vector) Paste NETVAR(lastPlaceName, "CBasePlayer", "m_szLastPlaceName", char[18])

aljawary commented 4 years ago

thx

yaelahrip commented 4 years ago

not very good but here:

    if (config->misc.location_spammer)
    {
        static int lastId = 1;
        if (!interfaces->engine->isInGame())
            return;

        for (int i = lastId; i < interfaces->engine->getMaxClients(); i++)
        {
            const auto Player = interfaces->entityList->getEntity(i);
            lastId++;
            if (lastId == interfaces->engine->getMaxClients())
                lastId = 1;
            if (!Player || Player->isDormant() || !Player->isAlive())
                continue;

            PlayerInfo entityInformation;
            interfaces->engine->getPlayerInfo(i, entityInformation);
            std::string playerName = std::string(entityInformation.name);
            playerName.erase(std::remove(playerName.begin(), playerName.end(), ';'), playerName.end());
            playerName.erase(std::remove(playerName.begin(), playerName.end(), '"'), playerName.end());
            // Remove end line character
            playerName.erase(std::remove(playerName.begin(), playerName.end(), '\n'), playerName.end());
            // Construct a command with our message
            pstring str;
            str << ("say_team") << " \"";

                str << playerName << " | ";

                str << Player->health() << "HP | ";

                str << Player->lastPlaceName();

                str << "\"";

                interfaces->engine->clientCmdUnrestricted(str.c_str());

                break;
        }
    }

Where should i put this to make it works ? was testing and got " too many issued to server bla bla bla " and always get kick while i turn it on.

aljawary commented 4 years ago

not very good but here:

    if (config->misc.location_spammer)
    {
        static int lastId = 1;
        if (!interfaces->engine->isInGame())
            return;

        for (int i = lastId; i < interfaces->engine->getMaxClients(); i++)
        {
            const auto Player = interfaces->entityList->getEntity(i);
            lastId++;
            if (lastId == interfaces->engine->getMaxClients())
                lastId = 1;
            if (!Player || Player->isDormant() || !Player->isAlive())
                continue;

            PlayerInfo entityInformation;
            interfaces->engine->getPlayerInfo(i, entityInformation);
            std::string playerName = std::string(entityInformation.name);
            playerName.erase(std::remove(playerName.begin(), playerName.end(), ';'), playerName.end());
            playerName.erase(std::remove(playerName.begin(), playerName.end(), '"'), playerName.end());
            // Remove end line character
            playerName.erase(std::remove(playerName.begin(), playerName.end(), '\n'), playerName.end());
            // Construct a command with our message
            pstring str;
            str << ("say_team") << " \"";

                str << playerName << " | ";

                str << Player->health() << "HP | ";

                str << Player->lastPlaceName();

                str << "\"";

                interfaces->engine->clientCmdUnrestricted(str.c_str());

                break;
        }
    }

Where should i put this to make it works ? was testing and got " too many issued to server bla bla bla " and always get kick while i turn it on.

Add globalvars->curtime cok biar g ke kick

yaelahrip commented 4 years ago

@aljawary ah i see haha lupa lupa. mantap bor

KernCS commented 4 years ago

Here, this one you will not get kicked :)

    if (!interfaces->engine->isInGame())
        return;
    static DWORD lastspammed = 0;
    if (GetTickCount() - lastspammed > 800)
    {
        if (config->misc.location_spammer)
        {
            static int lastId = 1;
            lastspammed = GetTickCount();
            for (int i = lastId; i < interfaces->engine->getMaxClients(); i++)
            {
                const auto Player = interfaces->entityList->getEntity(i);
                lastId++;
                if (lastId == interfaces->engine->getMaxClients())
                    lastId = 1;
                if (!Player || Player->isDormant() || !Player->isAlive())
                    continue;
                PlayerInfo entityInformation;
                interfaces->engine->getPlayerInfo(i, entityInformation);
                std::string playerName = std::string(entityInformation.name);
                playerName.erase(std::remove(playerName.begin(), playerName.end(), ';'), playerName.end());
                playerName.erase(std::remove(playerName.begin(), playerName.end(), '"'), playerName.end());
                // Remove end line character
                playerName.erase(std::remove(playerName.begin(), playerName.end(), '\n'), playerName.end());
                // Construct a command with our message
                pstring str;
                str << ("say_team") << " \"";

                str << playerName << " | ";
                str << Player->health() << "HP | ";
                str << Player->lastPlaceName();
                str << "\"";

                interfaces->engine->clientCmdUnrestricted(str.c_str());

                break;
            }
        }
    }
yaelahrip commented 4 years ago

Entity.h

NETVAR(m_iCompetitiveRanking, "DT_CSPlayerResource", "m_iCompetitiveRanking", int) NETVAR(m_iCompetitiveWins, "DT_CSPlayerResource", "m_iCompetitiveWins", int) int GetCompetitiveRanking(int index) { return (int)((uintptr_t)this + m_iCompetitiveRanking() + index * 4); }

int GetCompetitiveWins(int index)
{
    return *(int*)((uintptr_t)this + m_iCompetitiveWins() + index * 4);
}

@KernCS @aljawary let's also add this one haha

aljawary commented 4 years ago

Entity.h

 NETVAR(m_iCompetitiveRanking, "DT_CSPlayerResource", "m_iCompetitiveRanking", int)
NETVAR(m_iCompetitiveWins, "DT_CSPlayerResource", "m_iCompetitiveWins", int)
 int GetCompetitiveRanking(int index)
{
    return *(int*)((uintptr_t)this + m_iCompetitiveRanking() + index * 4);
}

int GetCompetitiveWins(int index)
{
    return *(int*)((uintptr_t)this + m_iCompetitiveWins() + index * 4);
}

@KernCS @aljawary let's also add this one haha

This is for ranks and compewins right?

yaelahrip commented 4 years ago

@aljawary yas it is.

yaelahrip commented 4 years ago

@KernCS @aljawary bruh is it only for team mate (spammin) ?

aljawary commented 4 years ago

@KernCS @aljawary bruh is it only for team mate (spammin) ?

No its for all teams but mostly our team show up, i was wondering how to make it work in only enemy team

yaelahrip commented 4 years ago

@KernCS @aljawary bruh is it only for team mate (spammin) ?

No its for all teams but mostly our team show up, i was wondering how to make it work in only enemy team

sebelum proses tinggal di tambah if aja if(Player->isenemy())

aljawary commented 4 years ago

@KernCS @ bruh, apakah hanya untuk rekan satu tim (spammin)?

Tidak ada untuk semua tim tetapi sebagian besar tim kami muncul, saya bertanya-tanya bagaimana membuatnya bekerja hanya di tim musuh

sebelum proses tinggal di tambah if aja if (Player-> isenemy ())

Thx

KernCS commented 4 years ago

Entity.h

 NETVAR(m_iCompetitiveRanking, "DT_CSPlayerResource", "m_iCompetitiveRanking", int)
NETVAR(m_iCompetitiveWins, "DT_CSPlayerResource", "m_iCompetitiveWins", int)
 int GetCompetitiveRanking(int index)
{
    return *(int*)((uintptr_t)this + m_iCompetitiveRanking() + index * 4);
}

int GetCompetitiveWins(int index)
{
    return *(int*)((uintptr_t)this + m_iCompetitiveWins() + index * 4);
}

@KernCS @aljawary let's also add this one haha

Would be funny, but with that method it's just crashing zgNe7qf

yaelahrip commented 4 years ago

Entity.h

 NETVAR(m_iCompetitiveRanking, "DT_CSPlayerResource", "m_iCompetitiveRanking", int)
NETVAR(m_iCompetitiveWins, "DT_CSPlayerResource", "m_iCompetitiveWins", int)
 int GetCompetitiveRanking(int index)
{
    return *(int*)((uintptr_t)this + m_iCompetitiveRanking() + index * 4);
}

int GetCompetitiveWins(int index)
{
    return *(int*)((uintptr_t)this + m_iCompetitiveWins() + index * 4);
}

@KernCS @aljawary let's also add this one haha

Would be funny, but with that method it's just crashing zgNe7qf

yea help me to fix this @KernCS haha.

Natural-Selection09 commented 4 years ago

Here, this one you will not get kicked :)

    if (!interfaces->engine->isInGame())
        return;
    static DWORD lastspammed = 0;
    if (GetTickCount() - lastspammed > 800)
    {
        if (config->misc.location_spammer)
        {
            static int lastId = 1;
            lastspammed = GetTickCount();
            for (int i = lastId; i < interfaces->engine->getMaxClients(); i++)
            {
                const auto Player = interfaces->entityList->getEntity(i);
                lastId++;
                if (lastId == interfaces->engine->getMaxClients())
                    lastId = 1;
                if (!Player || Player->isDormant() || !Player->isAlive())
                    continue;
                PlayerInfo entityInformation;
                interfaces->engine->getPlayerInfo(i, entityInformation);
                std::string playerName = std::string(entityInformation.name);
                playerName.erase(std::remove(playerName.begin(), playerName.end(), ';'), playerName.end());
                playerName.erase(std::remove(playerName.begin(), playerName.end(), '"'), playerName.end());
                // Remove end line character
                playerName.erase(std::remove(playerName.begin(), playerName.end(), '\n'), playerName.end());
                // Construct a command with our message
                pstring str;
                str << ("say_team") << " \"";

                str << playerName << " | ";
                str << Player->health() << "HP | ";
                str << Player->lastPlaceName();
                str << "\"";

                interfaces->engine->clientCmdUnrestricted(str.c_str());

                break;
            }
        }
    }

i'm an autistic paster, how can i please use it? what do i exactly need to do? thank you.

KernCS commented 4 years ago

i'm an autistic paster, how can i please use it? what do i exactly need to do? thank you.

Make a new Function in Misc

void Misc::ChatSpamer() noexcept
{
     if (!interfaces->engine->isInGame())
        return;
    static DWORD lastspammed = 0;
    if (GetTickCount() - lastspammed > 800)
    {
        if (config->misc.location_spammer)
        {
            static int lastId = 1;
            lastspammed = GetTickCount();
            for (int i = lastId; i < interfaces->engine->getMaxClients(); i++)
            {
                const auto Player = interfaces->entityList->getEntity(i);
                lastId++;
                if (lastId == interfaces->engine->getMaxClients())
                    lastId = 1;
                if (!Player || Player->isDormant() || !Player->isAlive())
                    continue;
                PlayerInfo entityInformation;
                interfaces->engine->getPlayerInfo(i, entityInformation);
                std::string playerName = std::string(entityInformation.name);
                playerName.erase(std::remove(playerName.begin(), playerName.end(), ';'), playerName.end());
                playerName.erase(std::remove(playerName.begin(), playerName.end(), '"'), playerName.end());
                // Remove end line character
                playerName.erase(std::remove(playerName.begin(), playerName.end(), '\n'), playerName.end());
                // Construct a command with our message
                pstring str;
                str << ("say_team") << " \"";

                str << playerName << " | ";
                str << Player->health() << "HP | ";
                str << Player->lastPlaceName();
                str << "\"";

                interfaces->engine->clientCmdUnrestricted(str.c_str());

                break;
            }
        }
    }
}

In Hooks.cpp under SkinChanger::run(stage); add Misc::ChatSpamer();

MasterChief220 commented 4 years ago

i'm an autistic paster, how can i please use it? what do i exactly need to do? thank you.

Make a new Function in Misc

void Misc::ChatSpamer() noexcept
{
     if (!interfaces->engine->isInGame())
        return;
    static DWORD lastspammed = 0;
    if (GetTickCount() - lastspammed > 800)
    {
        if (config->misc.location_spammer)
        {
            static int lastId = 1;
            lastspammed = GetTickCount();
            for (int i = lastId; i < interfaces->engine->getMaxClients(); i++)
            {
                const auto Player = interfaces->entityList->getEntity(i);
                lastId++;
                if (lastId == interfaces->engine->getMaxClients())
                    lastId = 1;
                if (!Player || Player->isDormant() || !Player->isAlive())
                    continue;
                PlayerInfo entityInformation;
                interfaces->engine->getPlayerInfo(i, entityInformation);
                std::string playerName = std::string(entityInformation.name);
                playerName.erase(std::remove(playerName.begin(), playerName.end(), ';'), playerName.end());
                playerName.erase(std::remove(playerName.begin(), playerName.end(), '"'), playerName.end());
                // Remove end line character
                playerName.erase(std::remove(playerName.begin(), playerName.end(), '\n'), playerName.end());
                // Construct a command with our message
                pstring str;
                str << ("say_team") << " \"";

                str << playerName << " | ";
                str << Player->health() << "HP | ";
                str << Player->lastPlaceName();
                str << "\"";

                interfaces->engine->clientCmdUnrestricted(str.c_str());

                break;
            }
        }
    }
}

In Hooks.cpp under SkinChanger::run(stage); add Misc::ChatSpamer();

so i have to just add it to the code anywhere?right????

KernCS commented 4 years ago

so i have to just add it to the code anywhere?right????

Basically yes

newcommerdontblame commented 4 years ago

@KernCS Make a pull bro

KernCS commented 4 years ago

@KernCS Make a pull bro

Haven't found a way to only spam enemies yet :p so rather not do it

newcommerdontblame commented 4 years ago

Haven't found a way to only spam enemies yet :p so rather not do it

Ah okay it just looks messy in here i didn't try

SmokingDuckk commented 3 years ago

i'm an autistic paster, how can i please use it? what do i exactly need to do? thank you.

Make a new Function in Misc

void Misc::ChatSpamer() noexcept
{
     if (!interfaces->engine->isInGame())
        return;
    static DWORD lastspammed = 0;
    if (GetTickCount() - lastspammed > 800)
    {
        if (config->misc.location_spammer)
        {
            static int lastId = 1;
            lastspammed = GetTickCount();
            for (int i = lastId; i < interfaces->engine->getMaxClients(); i++)
            {
                const auto Player = interfaces->entityList->getEntity(i);
                lastId++;
                if (lastId == interfaces->engine->getMaxClients())
                    lastId = 1;
                if (!Player || Player->isDormant() || !Player->isAlive())
                    continue;
                PlayerInfo entityInformation;
                interfaces->engine->getPlayerInfo(i, entityInformation);
                std::string playerName = std::string(entityInformation.name);
                playerName.erase(std::remove(playerName.begin(), playerName.end(), ';'), playerName.end());
                playerName.erase(std::remove(playerName.begin(), playerName.end(), '"'), playerName.end());
                // Remove end line character
                playerName.erase(std::remove(playerName.begin(), playerName.end(), '\n'), playerName.end());
                // Construct a command with our message
                pstring str;
                str << ("say_team") << " \"";

                str << playerName << " | ";
                str << Player->health() << "HP | ";
                str << Player->lastPlaceName();
                str << "\"";

                interfaces->engine->clientCmdUnrestricted(str.c_str());

                break;
            }
        }
    }
}

In Hooks.cpp under SkinChanger::run(stage); add Misc::ChatSpamer();

hey sorry to ask you that but how do i add location_spammer to Config::Misc? thank you.

(Error: C2039 'location_spammer' isn't a member of 'Config::Misc')

KernCS commented 3 years ago

(Error: C2039 'location_spammer' isn't a member of 'Config::Misc')

bool location_spammer = false ?????????????

SmokingDuckk commented 3 years ago

(Error: C2039 'location_spammer' isn't a member of 'Config::Misc')

bool location_spammer = false ?????????????

Where do i add it please? I'm not a coder, sorry.

SmokingDuckk commented 3 years ago

Nvm it's working perfectly thank you, i just didn't know how to completely add a feature into the cheat since i'm not a coder, i watched some pull requests to see how people added their features in the gui etc, it works, thank you. The only problem is that it gives the infos about my mates too lol any ideas how to fix this?

KernCS commented 3 years ago

Nvm it's working perfectly thank you, i just didn't know how to completely add a feature into the cheat since i'm not a coder, i watched some pull requests to see how people added their features in the gui etc, it works, thank you. The only problem is that it gives the infos about my mates too lol any ideas how to fix this?

Gonna make a pull requests:)

SmokingDuckk commented 3 years ago

Nvm it's working perfectly thank you, i just didn't know how to completely add a feature into the cheat since i'm not a coder, i watched some pull requests to see how people added their features in the gui etc, it works, thank you. The only problem is that it gives the infos about my mates too lol any ideas how to fix this?

Gonna make a pull requests:)

Thanks a lot :D

KernCS commented 3 years ago

Nvm it's working perfectly thank you, i just didn't know how to completely add a feature into the cheat since i'm not a coder, i watched some pull requests to see how people added their features in the gui etc, it works, thank you. The only problem is that it gives the infos about my mates too lol any ideas how to fix this?

Gonna make a pull requests:)

Thanks a lot :D

2492