hlsdk

hlsdk

Jan 22nd, 2010
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <vector>
  2. CON_COMMAND(ms_mimic, "name borrowing")
  3. {
  4.     char tmp[50];
  5.     int playerCount = 0;
  6.     std::vector<std::string> nameList;
  7.     nameList.clear();
  8.    
  9.     int playerCount = 0;
  10.     for (int i=0;i<clientEntList->GetHighestEntityIndex();i++)
  11.     {
  12.         player_info_t pinfo;
  13.         engine->GetPlayerInfo(i, &pinfo);
  14.  
  15.         if(i>31 || pinfo.name[0] == NULL)
  16.         continue;
  17.  
  18.         nameList[playerCount] = pinfo.name;
  19.         playerCount++;
  20.  
  21.         Msg("Player Name Found: \t%s \n", nameList[playerCount]);
  22.     }
  23.  
  24.     // Print this to debug before trying to set your name to it. -> nameList[rand()%playerCount]
  25. }
Add Comment
Please, Sign In to add comment