Help Nametag position snippet

Parazitas

God
Joined
Jan 2, 2017
Messages
3,121
Solutions
5
Reaction score
882
Location
Lithuania
Example of how looks samp NickName and ID Drawing in samp with all calculation information samp 0.3.7 R1
C++:
void FUN_10070d40(void)

{
  int *piVar1;
  int iVar2;
  int **ppiVar3;
  int *piVar4;
  int iVar5;
  undefined4 uVar6;
  int iVar7;
  uint uVar8;
  float10 fVar9;
  float10 fVar10;
  undefined *puVar11;
  uint uVar12;
 
  if ((DAT_1021a0f8 != 0) && (*(char *)(*(int *)(DAT_1021a0f8 + 0x3c5) + 0x38) != '\0')) {
    FUN_100686a0();
    piVar1 = *(int **)(*(int *)(DAT_1021a0f8 + 0x3cd) + 0x18);
    puVar11 = &DAT_1012c8c8;
    FUN_10001010(&DAT_1012c8c8);
    FUN_1009a150(puVar11);
    iVar2 = *piVar1;
    uVar8 = 0;
    if (-1 < iVar2) {
      do {
        if ((((((ushort)uVar8 < 0x3ec) &&
              (*(int *)((int)piVar1 + (uVar8 & 0xffff) * 4 + 0xfde) == 1)) &&
             (ppiVar3 = *(int ***)((int)piVar1 + (uVar8 & 0xffff) * 4 + 0x2e),
             ppiVar3 != (int **)0x0)) &&
            ((piVar4 = *ppiVar3, piVar4 != (int *)0x0 && (*piVar4 != 0)))) &&
           ((*(char *)((int)piVar4 + 9) != '\0' &&
            ((*(int *)((int)piVar4 + 0xb3) != 0 &&
             (fVar9 = (float10)FUN_1009a7d0(),
             fVar10 = (float10)*(float *)(*(int *)(DAT_1021a0f8 + 0x3c5) + 0x27),
             fVar9 < fVar10 != (fVar9 == fVar10))))))) {
          if ((*(char *)((int)piVar4 + 9) == '\x13') &&
             ((piVar4[1] != 0 && (iVar5 = FUN_100b18b0(), iVar5 != 0)))) {
            FUN_1009a150(&DAT_1012c7c8);
            DAT_1012c90c = DAT_1012c7f8;
            DAT_1012c910 = DAT_1012c7fc;
            DAT_1012c914 = DAT_1012c800;
          }
          else {
            iVar5 = FUN_1009aa10();
            if (iVar5 == 0) goto LAB_10070f9b;
            DAT_1012c90c = 0.0;
            DAT_1012c910 = 0.0;
            DAT_1012c914 = 0.0;
            FUN_100a8d20(8,&DAT_1012c90c);
          }
          _DAT_1012c934 = DAT_1012c90c;
          _DAT_1012c938 = DAT_1012c910;
          _DAT_1012c93c = DAT_1012c914;
          iVar5 = FUN_10098320();
          iVar7 = 0;
          if (*(char *)(*(int *)(DAT_1021a0f8 + 0x3c5) + 0x2f) != '\0') {
            iVar7 = FUN_100abcd0(&DAT_100d8348,(double)_DAT_1012c934,(double)_DAT_1012c938,
                                 (double)_DAT_1012c93c,(double)*(float *)(iVar5 + 0xc),
                                 (double)*(float *)(iVar5 + 0x10),(double)*(float *)(iVar5 + 0x14) ,1
                                 ,0,0,1,0);
          }
          if ((*(char *)(*(int *)(DAT_1021a0f8 + 0x3c5) + 0x2f) == '\0') || (iVar7 != 0)) {
            uVar12 = uVar8;
            uVar6 = FUN_10013ce0(uVar8);
            _sprintf(&DAT_1012c848,"%s (%d)",uVar6,uVar12);
            if (*(int *)((int)piVar4 + 0xb) == 0) {
              uVar6 = FUN_10012ba0();
              fVar10 = (float10)FUN_1009a7d0(*(undefined *)(DAT_1021a0f8 + 0x224),uVar6);
              FUN_10012a00((float)fVar10);
              FUN_100686c0();
            }
          }
        }
LAB_10070f9b:
        uVar8 = uVar8 + 1;
      } while ((int)uVar8 <= iVar2);
    }
    FUN_100686b0();
  }
  return;
}
 
Joined
Feb 18, 2005
Messages
2,964
Reaction score
269
C++:
vector camera_posn; // game camera position
vector player_posn; // the position of the player you want to get the healthbar

float cam_distance = distance(camera_posn, player_posn)
player_posn.z += 0.2f + (cam_distance * 0.047499999f)
vector screen_posn = world_to_screen(player_posn) 

draw_rectangle(screen_posn.x - 20.0f, screen_posn.y, 40.0f, 5.0f) // x, y, width, height
 
Top