Advertisement
Wolfrost

CSGO PlayerList

Aug 29th, 2016
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma once
  2.  
  3. #include "MenuElements.hpp"
  4.  
  5. class PlayerList : public Element
  6. {
  7. protected:
  8.  
  9.     std::vector<SourceSDK::CBaseEntity*> _ents;
  10.  
  11. public:
  12.  
  13.     PlayerList()
  14.     {
  15.         _ents.clear();
  16.     }
  17.  
  18.     void Think()
  19.     {
  20.         visible = parent->GetVisible();
  21.         if (!visible) return;
  22.  
  23.         for (int i=1; i<=64; i++)
  24.         {
  25.             SourceSDK::CBaseEntity* pEnt = (SourceSDK::CBaseEntity*)I::ClientEntityList->GetClientEntity(i);
  26.             if (!pEnt) continue;
  27.             if (pEnt->IsDormant()) continue;
  28.  
  29.             _ents.push_back(pEnt);
  30.         }
  31.     }
  32.  
  33.     void Paint()
  34.     {
  35.         if (!visible) return;
  36.  
  37.         /// DRAW HERE
  38.     }
  39.  
  40.     std::vector<SourceSDK::CBaseEntity*> GetEntities() { return _ents; }
  41.     void AddEntity(SourceSDK::CBaseEntity* pEntity) { _ents.push_back(pEntity); }
  42. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement