OldSchoolHack

Registrieren / Anmelden Deutsch

DayZ SA SDK 0.58

not available
  • Kategorie: Sourcecode
  • Entwickler:
  • Hochgeladen von: System
  • Hinzugefügt am:
  • System: Windows
Download (22.12 KB)

VirusTotal Ergebnis: 0/54

virustotal

Beschreibung

You can't just c&p and expect it to compile. Some helper functions are missing. If
you don't manage to implement these, please do not spam for more spoonfeed here.

Needed function:
CPP Code:
  1. template <typename Type, typename Base, typename Offset>
  2. static inline Type Ptr(Base base, Offset offset)
  3. {
  4. static_assert(std::is_pointer<Type>::value || std::is_integral<Type>::value, "Type must be a pointer or address");
  5. static_assert(std::is_pointer<Base>::value || std::is_integral<Base>::value, "Base must be a pointer or address");
  6. static_assert(std::is_pointer<Offset>::value || std::is_integral<Offset>::value, "Offset must be a pointer or address");
  7.  
  8. return base ? (Type)((uint64_t)base + (uint64_t)offset) : Type();
  9. }


How to use it:
CPP Code:
  1. auto pNetworkManager = Game::NetworkManager::GetSingletonPtr();
  2. if (!pNetworkManager->isIngame())
  3. return;
  4.  
  5. auto pWorld = Game::World::GetSingletonPtr();
  6. if (!pWorld)
  7. return;
  8.  
  9. auto pLandscape = Game::Landscape::GetSingletonPtr();
  10. if (!pLandscape)
  11. return;
  12.  
  13. auto pLocalPlayer = pWorld->getLocalPlayer();
  14. if (!pLocalPlayer)
  15. return;
  16.  
  17. auto pLocalPlayerName = pLocalPlayer->getName();
  18. if (!pLocalPlayerName)
  19. return;
  20.  
  21. const auto &localPos = pLocalPlayer->getPosition();
  22.  
  23. std::list<Game::Entity *> entities;
  24. std::list<Game::Player *> players;
  25. std::list<Game::Zombie *> zombies;
  26. std::list<Game::Animal *> animals;
  27. std::list<Game::Car *> cars;
  28. std::list<Game::Item *> items;
  29. std::list<Game::House *> houses;
  30.  
  31. pLandscape->getObjects(entities, localPos.getX(), localPos.getZ(), 1000);
  32. for (auto &pEntity : entities)
  33. {
  34. switch (pEntity->getType())
  35. {
  36. case Game::Entity::Type::Player:
  37. players.push_back(reinterpret_cast<Game::Player *>(pEntity));
  38. break;
  39.  
  40. case Game::Entity::Type::Zombie:
  41. zombies.push_back(reinterpret_cast<Game::Zombie *>(pEntity));
  42. break;
  43.  
  44. case Game::Entity::Type::Animal:
  45. animals.push_back(reinterpret_cast<Game::Animal *>(pEntity));
  46. break;
  47.  
  48. case Game::Entity::Type::Car:
  49. cars.push_back(reinterpret_cast<Game::Car *>(pEntity));
  50. break;
  51.  
  52. case Game::Entity::Type::Item:
  53. items.push_back(reinterpret_cast<Game::Item *>(pEntity));
  54. break;
  55.  
  56. case Game::Entity::Type::House:
  57. houses.push_back(reinterpret_cast<Game::House *>(pEntity));
  58. break;
  59.  
  60. default:
  61. break;
  62. }
  63. }


Little bonus. Since they really pissed me off, I'm going to return the favour

Spawn grenades:
CPP Code:
  1. // You can frame other players if you set the owner of the shot.
  2. Game::Shot::CreateShot(nullptr, Game::EntityTypeBank::GetSingletonPtr()->getEntityType(ENCRYPT("G_Grenade")), shotPos, shotSpeed);
  3.  
  4. // Interesting ammo types are
  5. LaserBombCore
  6. G_Grenade
  7. G_FlashGrenadeHand
  8. B_Flare
  9. A_composite
  10. B_762x54_Ball

Download DayZ SA SDK 0.58