FPlayer

Table with focused lua methods to the defined player

Usage

FPlayer is inserted in the callback function of the RegCommand field of the library

-- Export method
local HRLib = exports.HRLib:getLibFunctions()
local myFPlayer = HRLib.GetFPlayer(1)

-- or in the RegCommand field

HRLib.RegCommand('test', function(_, _, IPlayer, FPlayer)
    FPlayer:Notify(('Your Id: %s'):format(IPlayer.source)) -- Output: (Informational notification) Your Id: (integer)
end)

-- Import method
local myFPlayer = HRLib.GetFPlayer(1)

-- or in the RegCommand field
-- (it is the same as for the export method)

Last updated