Difference between revisions of "Player Lua API"
(6 intermediate revisions by 3 users not shown) | |||
Line 5: | Line 5: | ||
== Functions == | == Functions == | ||
=== AddItemToInventory === | === AddItemToInventory === | ||
− | <syntaxhighlight source lang="lua">Player.AddItemToInventory( | + | <syntaxhighlight source lang="lua">Player.AddItemToInventory(itemName)</syntaxhighlight> |
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 11: | Line 11: | ||
! Name !! Type | ! Name !! Type | ||
|- | |- | ||
− | | | + | | itemName || string |
|} | |} | ||
− | '''Description''': Adds an item to the players inventory | + | '''Description''': Adds an item to the players inventory (silently, wihtout a notification. Also check Mission.SendData() ). |
'''Returns''': Nothing | '''Returns''': Nothing | ||
=== RemoveItemFromInventory === | === RemoveItemFromInventory === | ||
− | <syntaxhighlight source lang="lua">Player.RemoveItemFromInventory( | + | <syntaxhighlight source lang="lua">Player.RemoveItemFromInventory(itemName)</syntaxhighlight> |
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 24: | Line 24: | ||
! Name !! Type | ! Name !! Type | ||
|- | |- | ||
− | | | + | | itemName || string |
|} | |} | ||
'''Description''': Removes an item to the players inventory | '''Description''': Removes an item to the players inventory | ||
Line 50: | Line 50: | ||
=== SetPlayerNFCData === | === SetPlayerNFCData === | ||
− | <syntaxhighlight source lang="lua">Player.SetPlayerNFCData(dataTable)</syntaxhighlight> | + | <syntaxhighlight source lang="lua">Player.SetPlayerNFCData(internalName, dataTable)</syntaxhighlight> |
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 56: | Line 56: | ||
! Name !! Type | ! Name !! Type | ||
|- | |- | ||
− | | dataTable || Lua | + | | internalName || string |
+ | |- | ||
+ | | dataTable || Lua Table | ||
|} | |} | ||
'''Description''': Sets the NFC data on the players phone | '''Description''': Sets the NFC data on the players phone | ||
Line 63: | Line 65: | ||
=== AddDataFile === | === AddDataFile === | ||
− | <syntaxhighlight source lang="lua">Player.AddDataFile(dataTable)</syntaxhighlight> | + | <syntaxhighlight source lang="lua">Player.AddDataFile(internalName, dataTable)</syntaxhighlight> |
'''Expected parameter types''' | '''Expected parameter types''' | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 69: | Line 71: | ||
! Name !! Type | ! Name !! Type | ||
|- | |- | ||
− | | dataTable || Lua | + | | internalName || string |
+ | |- | ||
+ | | dataTable || Lua Table | ||
|} | |} | ||
'''Description''': Adds a data file directly to the players data inventory without a sender | '''Description''': Adds a data file directly to the players data inventory without a sender | ||
Line 80: | Line 84: | ||
'''Returns''': Nothing | '''Returns''': Nothing | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== HasDataFile === | === HasDataFile === | ||
Line 151: | Line 149: | ||
|} | |} | ||
'''Description''': Sets the data string of a data file in the players data inventory | '''Description''': Sets the data string of a data file in the players data inventory | ||
+ | |||
+ | '''Returns''': Nothing | ||
+ | |||
+ | === GetAllDataFileNames === | ||
+ | <syntaxhighlight source lang="lua">Player.GetAllDataFileNames()</syntaxhighlight> | ||
+ | '''Description''': Return internalNames of all files in the players data inventory | ||
+ | |||
+ | '''Returns''': System.String[] | ||
+ | |||
+ | === GetAllDataFiles === | ||
+ | <syntaxhighlight source lang="lua">Player.GetAllDataFiles()</syntaxhighlight> | ||
+ | '''Description''': Return a table of all files in the players data inventory | ||
+ | |||
+ | '''Returns''': Lua Type | ||
+ | |||
+ | === SendData === | ||
+ | <syntaxhighlight source lang="lua">Player.SendData(internalName, receiver)</syntaxhighlight> | ||
+ | '''Expected parameter types''' | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Name !! Type | ||
+ | |- | ||
+ | | internalName || Lua Type | ||
+ | |- | ||
+ | | receiver || Lua Type | ||
+ | |} | ||
+ | '''Description''': Send a file from player's inventory to receiver | ||
+ | |||
+ | '''Returns''': Nothing | ||
+ | |||
+ | === GetSocialProfileSize === | ||
+ | <syntaxhighlight source lang="lua">Player.GetSocialProfileSize(internalName)</syntaxhighlight> | ||
+ | '''Expected parameter types''' | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Name !! Type | ||
+ | |- | ||
+ | | internalName || string | ||
+ | |} | ||
+ | '''Description''': Returns the size of the background profile player has collected about a character | ||
+ | |||
+ | '''Returns''': number | ||
+ | |||
+ | === SocialProfileContainsTag === | ||
+ | <syntaxhighlight source lang="lua">Player.SocialProfileContainsTag(internalName, tag)</syntaxhighlight> | ||
+ | '''Expected parameter types''' | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Name !! Type | ||
+ | |- | ||
+ | | internalName || string | ||
+ | |- | ||
+ | | tag || string | ||
+ | |} | ||
+ | '''Description''': Returns true if social profile contains any character data with specified tag | ||
+ | |||
+ | '''Returns''': bool | ||
+ | |||
+ | === SocialProfileContainsTagData === | ||
+ | <syntaxhighlight source lang="lua">Player.SocialProfileContainsTagData(internalName, tag, data)</syntaxhighlight> | ||
+ | '''Expected parameter types''' | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Name !! Type | ||
+ | |- | ||
+ | | internalName || string | ||
+ | |- | ||
+ | | tag || string | ||
+ | |- | ||
+ | | data || string | ||
+ | |} | ||
+ | '''Description''': Returns true if social profile contains character data matching both tag and data | ||
+ | |||
+ | '''Returns''': bool | ||
+ | |||
+ | === SocialProfileContainsData === | ||
+ | <syntaxhighlight source lang="lua">Player.SocialProfileContainsData(internalName, data)</syntaxhighlight> | ||
+ | '''Expected parameter types''' | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Name !! Type | ||
+ | |- | ||
+ | | internalName || string | ||
+ | |- | ||
+ | | data || string | ||
+ | |} | ||
+ | '''Description''': Returns true if social profile contains specified character data (regardless of it's tag) | ||
+ | |||
+ | '''Returns''': bool | ||
+ | |||
+ | === AddSocialProfileInformation === | ||
+ | <syntaxhighlight source lang="lua">Player.AddSocialProfileInformation(internalName, tag, data)</syntaxhighlight> | ||
+ | '''Expected parameter types''' | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Name !! Type | ||
+ | |- | ||
+ | | internalName || string | ||
+ | |- | ||
+ | | tag || string | ||
+ | |- | ||
+ | | data || string | ||
+ | |} | ||
+ | '''Description''': Add new background data about a character to SocialInventory | ||
+ | |||
+ | '''Returns''': Nothing | ||
+ | |||
+ | === GetSocialProfileInformation === | ||
+ | <syntaxhighlight source lang="lua">Player.GetSocialProfileInformation(internalName)</syntaxhighlight> | ||
+ | '''Expected parameter types''' | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Name !! Type | ||
+ | |- | ||
+ | | internalName || string | ||
+ | |} | ||
+ | '''Description''': Get all known background data about a character from player's SocialInventory | ||
+ | |||
+ | '''Returns''': Lua Type | ||
+ | |||
+ | === GetPlayerTrackingState === | ||
+ | <syntaxhighlight source lang="lua">Player.GetPlayerTrackingState()</syntaxhighlight> | ||
+ | '''Description''': Get current tracking state from Player's phone. | ||
+ | |||
+ | '''Returns''': PlayerPhone+TrackingStates | ||
+ | |||
+ | === GetNetPointsCount === | ||
+ | <syntaxhighlight source lang="lua">Player.GetNetPointsCount()</syntaxhighlight> | ||
+ | '''Description''': Get current amount of NetPoints the player has. | ||
+ | |||
+ | '''Returns''': number | ||
+ | |||
+ | === SetNetPointsCount === | ||
+ | <syntaxhighlight source lang="lua">Player.SetNetPointsCount(count)</syntaxhighlight> | ||
+ | '''Expected parameter types''' | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Name !! Type | ||
+ | |- | ||
+ | | count || number | ||
+ | |} | ||
+ | '''Description''': Set player's NetPoints count. | ||
+ | |||
+ | '''Returns''': Nothing | ||
+ | |||
+ | === AddNetPoints === | ||
+ | <syntaxhighlight source lang="lua">Player.AddNetPoints(count)</syntaxhighlight> | ||
+ | '''Expected parameter types''' | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Name !! Type | ||
+ | |- | ||
+ | | count || number | ||
+ | |} | ||
+ | '''Description''': Add more NetPoints to player | ||
+ | |||
+ | '''Returns''': Nothing | ||
+ | |||
+ | === RemoveNetPoints === | ||
+ | <syntaxhighlight source lang="lua">Player.RemoveNetPoints(count)</syntaxhighlight> | ||
+ | '''Expected parameter types''' | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Name !! Type | ||
+ | |- | ||
+ | | count || number | ||
+ | |} | ||
+ | '''Description''': Take NetPOintsa from player. | ||
'''Returns''': Nothing | '''Returns''': Nothing | ||
Line 159: | Line 325: | ||
'''Returns''': string | '''Returns''': string | ||
+ | |||
+ | === GetLightLevel === | ||
+ | <syntaxhighlight source lang="lua">Player.GetLightLevel()</syntaxhighlight> | ||
+ | '''Description''': Get the light level around the player | ||
+ | |||
+ | '''Returns''': number | ||
=== SetAlwaysRagdoll === | === SetAlwaysRagdoll === | ||
Line 190: | Line 362: | ||
This file is auto generated, please don't edit manually! | This file is auto generated, please don't edit manually! | ||
− | '''Docs last hacked together on''': 10/ | + | '''Docs last hacked together on''': 13/10/2021 15:55 |
− | [[ | + | [[Category:Modding]][[Category:LuaAPI]] |
Latest revision as of 08:54, 14 October 2021
Contents
- 1 Player
- 1.1 Description
- 1.2 Functions
- 1.2.1 AddItemToInventory
- 1.2.2 RemoveItemFromInventory
- 1.2.3 HasItem
- 1.2.4 ClearInventory
- 1.2.5 SetPlayerNFCData
- 1.2.6 AddDataFile
- 1.2.7 ClearDataInventory
- 1.2.8 HasDataFile
- 1.2.9 HasEncryptedFile
- 1.2.10 HasDecryptedFile
- 1.2.11 GetDataString
- 1.2.12 SetDataString
- 1.2.13 GetAllDataFileNames
- 1.2.14 GetAllDataFiles
- 1.2.15 SendData
- 1.2.16 GetSocialProfileSize
- 1.2.17 SocialProfileContainsTag
- 1.2.18 SocialProfileContainsTagData
- 1.2.19 SocialProfileContainsData
- 1.2.20 AddSocialProfileInformation
- 1.2.21 GetSocialProfileInformation
- 1.2.22 GetPlayerTrackingState
- 1.2.23 GetNetPointsCount
- 1.2.24 SetNetPointsCount
- 1.2.25 AddNetPoints
- 1.2.26 RemoveNetPoints
- 1.2.27 GetName
- 1.2.28 GetLightLevel
- 1.2.29 SetAlwaysRagdoll
- 1.2.30 SetInvisible
Player
Description
The Player API handles querying and setting the state of the player
Functions
AddItemToInventory
Player.AddItemToInventory(itemName)
Expected parameter types
Name | Type |
---|---|
itemName | string |
Description: Adds an item to the players inventory (silently, wihtout a notification. Also check Mission.SendData() ).
Returns: Nothing
RemoveItemFromInventory
Player.RemoveItemFromInventory(itemName)
Expected parameter types
Name | Type |
---|---|
itemName | string |
Description: Removes an item to the players inventory
Returns: Nothing
HasItem
Player.HasItem(itemName)
Expected parameter types
Name | Type |
---|---|
itemName | string |
Description: Is an item in the players inventory
Returns: true if the item is in the players inventory, else false
ClearInventory
Player.ClearInventory()
Description: Removes all items from the players inventory
Returns: Nothing
SetPlayerNFCData
Player.SetPlayerNFCData(internalName, dataTable)
Expected parameter types
Name | Type |
---|---|
internalName | string |
dataTable | Lua Table |
Description: Sets the NFC data on the players phone
Returns: Nothing
AddDataFile
Player.AddDataFile(internalName, dataTable)
Expected parameter types
Name | Type |
---|---|
internalName | string |
dataTable | Lua Table |
Description: Adds a data file directly to the players data inventory without a sender
Returns: Nothing
ClearDataInventory
Player.ClearDataInventory()
Description: Removes all data files from the players data inventory
Returns: Nothing
HasDataFile
Player.HasDataFile(dataFileName)
Expected parameter types
Name | Type |
---|---|
dataFileName | string |
Description: Does the player have a data file with this name?
Returns: bool
HasEncryptedFile
Player.HasEncryptedFile(dataFileName)
Expected parameter types
Name | Type |
---|---|
dataFileName | string |
Description: Does the player have a file with the name _dataFileName_ and is it encrypted?
Returns: bool
HasDecryptedFile
Player.HasDecryptedFile(dataFileName)
Expected parameter types
Name | Type |
---|---|
dataFileName | string |
Description: Does the player have a file with the name _dataFileName_ and is it unencrypted?
Returns: bool
GetDataString
Player.GetDataString(internalName)
Expected parameter types
Name | Type |
---|---|
internalName | string |
Description: Returns the data string of a file in the players inventory, takes in the internal name of the file
Returns: string
SetDataString
Player.SetDataString(internalName, newString)
Expected parameter types
Name | Type |
---|---|
internalName | string |
newString | string |
Description: Sets the data string of a data file in the players data inventory
Returns: Nothing
GetAllDataFileNames
Player.GetAllDataFileNames()
Description: Return internalNames of all files in the players data inventory
Returns: System.String[]
GetAllDataFiles
Player.GetAllDataFiles()
Description: Return a table of all files in the players data inventory
Returns: Lua Type
SendData
Player.SendData(internalName, receiver)
Expected parameter types
Name | Type |
---|---|
internalName | Lua Type |
receiver | Lua Type |
Description: Send a file from player's inventory to receiver
Returns: Nothing
GetSocialProfileSize
Player.GetSocialProfileSize(internalName)
Expected parameter types
Name | Type |
---|---|
internalName | string |
Description: Returns the size of the background profile player has collected about a character
Returns: number
SocialProfileContainsTag
Player.SocialProfileContainsTag(internalName, tag)
Expected parameter types
Name | Type |
---|---|
internalName | string |
tag | string |
Description: Returns true if social profile contains any character data with specified tag
Returns: bool
SocialProfileContainsTagData
Player.SocialProfileContainsTagData(internalName, tag, data)
Expected parameter types
Name | Type |
---|---|
internalName | string |
tag | string |
data | string |
Description: Returns true if social profile contains character data matching both tag and data
Returns: bool
SocialProfileContainsData
Player.SocialProfileContainsData(internalName, data)
Expected parameter types
Name | Type |
---|---|
internalName | string |
data | string |
Description: Returns true if social profile contains specified character data (regardless of it's tag)
Returns: bool
AddSocialProfileInformation
Player.AddSocialProfileInformation(internalName, tag, data)
Expected parameter types
Name | Type |
---|---|
internalName | string |
tag | string |
data | string |
Description: Add new background data about a character to SocialInventory
Returns: Nothing
GetSocialProfileInformation
Player.GetSocialProfileInformation(internalName)
Expected parameter types
Name | Type |
---|---|
internalName | string |
Description: Get all known background data about a character from player's SocialInventory
Returns: Lua Type
GetPlayerTrackingState
Player.GetPlayerTrackingState()
Description: Get current tracking state from Player's phone.
Returns: PlayerPhone+TrackingStates
GetNetPointsCount
Player.GetNetPointsCount()
Description: Get current amount of NetPoints the player has.
Returns: number
SetNetPointsCount
Player.SetNetPointsCount(count)
Expected parameter types
Name | Type |
---|---|
count | number |
Description: Set player's NetPoints count.
Returns: Nothing
AddNetPoints
Player.AddNetPoints(count)
Expected parameter types
Name | Type |
---|---|
count | number |
Description: Add more NetPoints to player
Returns: Nothing
RemoveNetPoints
Player.RemoveNetPoints(count)
Expected parameter types
Name | Type |
---|---|
count | number |
Description: Take NetPOintsa from player.
Returns: Nothing
GetName
Player.GetName()
Description: Get the Player's internalName
Returns: string
GetLightLevel
Player.GetLightLevel()
Description: Get the light level around the player
Returns: number
SetAlwaysRagdoll
Player.SetAlwaysRagdoll(state)
Expected parameter types
Name | Type |
---|---|
state | bool |
Description: Player character aways ragdolls on death
Returns: Nothing
SetInvisible
Player.SetInvisible(state)
Expected parameter types
Name | Type |
---|---|
state | bool |
Description: Player character is invisible
Returns: Nothing
This file is auto generated, please don't edit manually!
Docs last hacked together on: 13/10/2021 15:55