Skip to content

Commit

Permalink
Update 2
Browse files Browse the repository at this point in the history
  • Loading branch information
FreezeEngine committed Jul 21, 2024
1 parent 711b372 commit 9044a58
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/Client/Module/Modules/Nick/NickListener.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ class NickListener : public Listener {
static inline std::string backupOri;

void onRaknetTick(RaknetTickEvent &event) override {
if (module->isEnabled()) {
std::string serverIP = SDK::getServerIP();
if(serverIP.find("cubecraft") != std::string::npos) {
if(!module->restricted) {
FlarialGUI::Notify("Can't use Nick on " + serverIP); // TODO: move restrictions to API
module->restricted = true;
}
} else {
module->restricted = false;
}
}
// if (module->isEnabled()) {
// std::string serverIP = SDK::getServerIP();
// if(serverIP.find("cubecraft") != std::string::npos) {
// if(!module->restricted) {
// FlarialGUI::Notify("Can't use Nick on " + serverIP); // TODO: move restrictions to API
// module->restricted = true;
// }
// } else {
// module->restricted = false;
// }
// }
}

void onDrawText(DrawTextEvent &event) override {
Expand All @@ -39,7 +39,7 @@ class NickListener : public Listener {
if (pos != std::string::npos) {
std::string faketxt = *event.getText();
faketxt.replace(pos, localPlayerName.length(),
module->settings.getSettingByName<std::string>("nick")->value);
"§o"+Utils::removeColorCodes(module->settings.getSettingByName<std::string>("nick")->value));
*event.getText() = faketxt;
}
}
Expand All @@ -64,7 +64,7 @@ class NickListener : public Listener {

if (enabled && !module->restricted) {

std::string val = module->settings.getSettingByName<std::string>("nick")->value;
std::string val = "§o"+Utils::removeColorCodes(module->settings.getSettingByName<std::string>("nick")->value);
SDK::clientInstance->getLocalPlayer()->setNametag(&val);
SDK::clientInstance->getLocalPlayer()->playerName = val;

Expand Down

0 comments on commit 9044a58

Please sign in to comment.