Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef uint64_t(*pfn_GetHostNetGamePlayer)();
- static pfn_GetHostNetGamePlayer fn_GetHostNetGamePlayer =
- (pfn_GetHostNetGamePlayer)(GTA_BASE + 0x150E210);
- int GetSessionHostPlayer()
- {
- uint64_t hostGamePlayer = fn_GetHostNetGamePlayer();
- if (!hostGamePlayer) return -1;
- return (int)(*(int8_t*)(hostGamePlayer + 0x31));
- }
- int host = GetSessionHostPlayer();
- if (host >= 0)
- {
- const char* name = GET_PLAYER_NAME(host);
- final_printf("[HOST] Session host is player %d: %s\n", host, name);
- char notif[64]; snprintf(notif, sizeof(notif), "~b~Session Host: ~w~%s", name);
- drawCenterNotification(notif);
- }
Advertisement
Comments
-
- useless since there is this native: NETWORK_GET_HOST_PLAYER_INDEX to catch the host player id
-
User was banned
Add Comment
Please, Sign In to add comment