Server Exports

Here you will find the list of usable exports for Weed Plants, you can use them if you have basic or advanced programming knowledge, we do not recommend using these if you do not have such knowledge.


getPlayerStats

With following export you can get player statistics and use some functions.

exports['p_plants']:getPlayerStats(identifier)
  • identifier: string

    • Identifier of existing player

Return:

  • identifier: string

  • reputation: table<zoneName, {exp: number, level: number}>

  • sellAbility: {exp: number, level: number}

  • drugsSold: number

  • earnings: number

  • addReputation: function

  • removeReputation: function

  • getReputation: function

  • addSellAbility: function

  • removeSellAbility: function


addReputation

Example of usage

local identifier = 'char:123456789' -- replace with existing player identifier
local player = exports['p_plants']:getPlayerStats(identifier)
if player then
   local zoneName = 'GroveStreet'
   local amount = 10
   player.addReputation(zoneName, amount)
end

removeReputation

Example of usage

local identifier = 'char:123456789' -- replace with existing player identifier
local player = exports['p_plants']:getPlayerStats(identifier)
if player then
   local zoneName = 'GroveStreet'
   local amount = 10
   player.removeReputation(zoneName, amount)
end

getReputation

Example of usage

local identifier = 'char:123456789' -- replace with existing player identifier
local player = exports['p_plants']:getPlayerStats(identifier)
if player then
   local zoneName = 'GroveStreet'
   local reputation = player.getReputation(zoneName)
   print(reputation.level, reputation.exp)
end

addSellAbility

Example of usage

local identifier = 'char:123456789' -- replace with existing player identifier
local player = exports['p_plants']:getPlayerStats(identifier)
if player then
   local amount = 10
   player.addSellAbility(amount)
end

removeSellAbility

Example of usage

local identifier = 'char:123456789' -- replace with existing player identifier
local player = exports['p_plants']:getPlayerStats(identifier)
if player then
   local amount = 10
   player.removeSellAbility(amount)
end

Last updated