Player Lua API: Difference between revisions

From Off Grid Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| itemTable || Lua Type
| itemTable || Lua Type
Line 19: Line 21:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| itemTable || Lua Type
| itemTable || Lua Type
Line 30: Line 34:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| itemName || string
| itemName || string
Line 47: Line 53:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| dataTable || Lua Type
| dataTable || Lua Type
Line 58: Line 66:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| dataTable || Lua Type
| dataTable || Lua Type
Line 81: Line 91:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| dataFileName || string
| dataFileName || string
Line 92: Line 104:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| dataFileName || string
| dataFileName || string
Line 103: Line 117:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| dataFileName || string
| dataFileName || string
Line 114: Line 130:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| internalName || string
| internalName || string
Line 125: Line 143:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| internalName || string
| internalName || string
Line 144: Line 164:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| state || bool
| state || bool
Line 155: Line 177:
'''Expected parameter types'''
'''Expected parameter types'''
{| class="wikitable"
{| class="wikitable"
|-
! Name !! Type
|-
|-
| state || bool
| state || bool
Line 166: Line 190:
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''': 13/09/2017 14:00
'''Docs last hacked together on''': 10/11/2017 11:07
 
[[Catagory:Modding]][[Catagory:LuaAPI]]
[[Category:Modding]]
[[Category:LuaAPI]]

Revision as of 11:52, 10 November 2017

Player

Description

The Player API handles querying and setting the state of the player

Functions

AddItemToInventory

Player.AddItemToInventory(itemTable)

Expected parameter types

Name Type
itemTable Lua Type

Description: Adds an item to the players inventory

Returns: Nothing

RemoveItemFromInventory

Player.RemoveItemFromInventory(itemTable)

Expected parameter types

Name Type
itemTable Lua Type

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(dataTable)

Expected parameter types

Name Type
dataTable Lua Type

Description: Sets the NFC data on the players phone

Returns: Nothing

AddDataFile

Player.AddDataFile(dataTable)

Expected parameter types

Name Type
dataTable Lua Type

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

ItemInQuickSlot

Player.ItemInQuickSlot()

Description: Gets the name of the item currently in the players quick slot

Returns: string

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

GetName

Player.GetName()

Description: Get the Player's internalName

Returns: string

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: 10/11/2017 11:07 Catagory:ModdingCatagory:LuaAPI