IlDivinoGlade

GTA V PS4 - 1.56 - Get Session Host

Mar 13th, 2026
239
0
Never
12
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. typedef uint64_t(*pfn_GetHostNetGamePlayer)();
  2. static pfn_GetHostNetGamePlayer fn_GetHostNetGamePlayer =
  3.     (pfn_GetHostNetGamePlayer)(GTA_BASE + 0x150E210);
  4.  
  5. int GetSessionHostPlayer()
  6. {
  7.     uint64_t hostGamePlayer = fn_GetHostNetGamePlayer();
  8.     if (!hostGamePlayer) return -1;
  9.  
  10.     return (int)(*(int8_t*)(hostGamePlayer + 0x31));
  11. }
  12.  
  13. int host = GetSessionHostPlayer();
  14. if (host >= 0)
  15. {
  16.     const char* name = GET_PLAYER_NAME(host);
  17.     final_printf("[HOST] Session host is player %d: %s\n", host, name);
  18.                 char notif[64]; snprintf(notif, sizeof(notif), "~b~Session Host: ~w~%s", name);
  19.     drawCenterNotification(notif);
  20. }
Advertisement
Comments
  • Collin382
    249 days
    # text 0.09 KB | 1 0
    1. useless since there is this native: NETWORK_GET_HOST_PLAYER_INDEX to catch the host player id
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
Add Comment
Please, Sign In to add comment