Public paste
Undefined
By: bl00b | Date: Dec 30 2009 23:24 | Format: None | Expires: never | Size: 829 B | Hits: 988

  1. void newesp()
  2. {
  3.         hud_player_info_t pInfo;
  4.         gEngfuncs.pfnGetPlayerInfo(pLocal->index, &pInfo);
  5.         int iOwnTeam = GetMyTeam(pInfo.model); // Team holen
  6.         float scr33n[10];
  7.  
  8.         for (int i = 0; i < 33; i++)
  9.         {
  10.                 // Wir selbst wollen nicht auf uns zielen
  11.                 if (pLocal->index == i) continue;
  12.  
  13.                 // Entity holen und prüfen
  14.                 pEnt = gEngfuncs.GetEntityByIndex(i);
  15.                 if (!isValidEnt(pEnt)) continue;
  16.  
  17.                 // PlayerInfo und Team auslesen
  18.                 gEngfuncs.pfnGetPlayerInfo(i, &pInfo);
  19.                 int iTeam = GetMyTeam(pInfo.model);
  20.                 if (CalcScreen(pEnt->origin, scr33n))
  21.  
  22.                         {
  23.                         // Er ist sichtbar!
  24.                                 if (iTeam == 1)
  25.                         {
  26.                                 DrawBox(scr33n[0], scr33n[1], 255, 0, 0, 255, 20, 3);
  27.                         }
  28.                         else if (iTeam == 2)
  29.                         {
  30.                                 DrawBox(scr33n[0], scr33n[1], 0, 0, 255, 255, 20, 3);
  31.                         }
  32.                         else
  33.                         {
  34.                                 continue;
  35.                         }
  36.                 }
  37.         }
  38. }