GetPlayerGender

The SD.GetPlayerGender module provides a standardized method for retrieving a player's gender across various frameworks.

Overview

Purpose: Configures a function that returns a player's gender as either 'Male' or 'Female', based on the framework-specific player object.

Returns: string: The gender of the player, returned as 'Male' or 'Female'.

  • ESX: Retrieves the gender directly from the ESX player object’s 'sex' attribute.

  • QB/QBX: Extracts the gender from the QB/QBX player data, where gender is typically stored as an integer (0 for male, 1 for female).

Parameters

  • source (any): The server ID or similar identifier used to fetch the player data.

Usage Example

local gender = SD.GetPlayerGender(source)
if gender then
    print("Player Gender:", gender)
else
    print("Unable to retrieve player gender or framework not supported.")
end

Last updated