INFINITYCORE FRAMEWORK
  • Getting started Infinity Core
  • INTRODUCTION
    • Framework FAQ
    • The World Map
    • Onesync & Txadmin
    • Chat/Vocal & Discord
    • Multi-Characters
    • Moonshiners DLC Remake
    • Performances
    • Zombies Population (add-on)
  • Roleplay Functions
    • Player commands
    • Admin commands
  • Global Functions
    • Player Datas
    • Notifications
    • Economy & jobs
    • Inventory
    • Levels & XP (RPG)
    • Functions Core
    • Permissions
    • Discord Sync API
    • DEBUG TOOLS
  • CORE TEAM & CREDITS
    • Official Team
    • Credits
Powered by GitBook
On this page
  1. Global Functions

Economy & jobs

Examples usages for economy
  --
  ADDGOLD               = exports.infinity_core:AddGold(_UndeadSource, goldAmount)
  REMOVEGOLD            = exports.infinity_core:RemoveGold(_UndeadSource, goldAmount)
  --
  ADDXP                 = exports.infinity_core:AddXP(_UndeadSource, xpAmount)
  REMOVEXP              = exports.infinity_core:RemoveXP(_UndeadSource, xpAmount)
  --
  ADDCASH               = exports.infinity_core:AddCash(_UndeadSource, value)
  REMOVECASH            = exports.infinity_core:RemoveCash(_UndeadSource, value)
  -- 
  ADDCASHBANK           = exports.infinity_core:addCashBank(_UndeadSource, value)
  
  
-- add a job farmer rank 1 to the player
RegisterCommand('newjob', function(source, args)
    TriggerServerEvent("infinity_core:setJob", _InfinitySource, _InfinitySource, 'farmer', 1)
end)

-- check a job trigger
RegisterCommand('checkjob', function(source, args)
    local PlayerDatas = exports.infinity_core:GetPlayerSession(_UndeadSource)
    exports.infinity_core:notification(_InfinitySource, PlayerDatas._Job, 'Rank '..PlayerDatas._JobGrade, 'center_left', 'infinitycore', 2500)
end)

-- remove current job to unmployed
RegisterCommand('removejob', function(source, args)
    TriggerServerEvent("infinity_core:setJob", _InfinitySource, _InfinitySource, 'unmployed', 0)
end)


 -- DOCUMENTATION
TriggerServerEvent("infinity_core:setJob", _InfinitySource, _InfinitySource, 'unmployed', 0)

    1. _InfinitySource= id of executor cmd
    2. _InfinitySource= id player receive the job
    3. '' = jobname db
    4. 0 to infinite = job rank
  

PreviousNotificationsNextInventory

Last updated 1 month ago