GKSHOP
Web StoreDiscord
  • 👋GKSHOP Documentation
  • INFORMATION
    • ⁉️FAQ
    • 💡Discord Roles
    • ⚠️FiveM Asset Escrow System
  • GKSPHONE v2
    • 📔Installation
    • ❓Documentation
    • 👷Exports
      • Client
      • Server
    • 🪛Custom App
    • Configuration
      • Unique phones
      • Custom inventory
      • Custom Wallpapers
      • Custom ringtones and notifications
      • Apps
      • Currency
    • Common Issues
    • 🚒Job Center
  • GKSPHONE v1
    • 📱ESX
      • 📔Installation
      • ❓Documentation
      • Application Usages
      • Developers
        • Server Event
        • Client Event
    • 📱QB
      • 📔Installation
      • ❓Documentation
      • Application Usages
      • Developers
        • Server Event
        • Client Event
  • Other Products
    • ⚒️GKSCRAFT
      • 📘Installation
      • Config
      • Developers
        • Server Event
    • ⛽GKS FUEL
      • 📔Installation
      • Config
      • Exports
    • 📸Media Services (GKSMEDIA)
    • 📲GKSPHONE Real App
  • OTHER
    • Policy
      • Privacy Policy
Powered by GitBook
On this page
  • Configuration
  • Events
  • Exports - Server
  • GetJobGroupByLeader
  • DeleteJobGroup
  • GetGroupByMember
  • Exports - Client
  • IsGroupLeader
  • IsTaskStatus
  • TaskUpdate
  • TaskListUpdate
  • TaskList
  1. GKSPHONE v1
  2. GKSPHONEv2

Job Center

for developers

Last updated 9 months ago

Configuration

Configuration events of files in gksphone/config/jobs

Job list and general settings section of jobs

icon =

MimWorkers = Minimum number of players to work

MaxWorkers = Maximum number of players to work

Location = If there is a position, specify it as vector3 or vector4 if there is no position, make it false

RequiredItem = If there is an item required to see the job, write the item code here, if not, set it to false

IsActive = to set the availability of the job


["sanitation"] = {
        ["Name"] = "Job Code",
        ["Label"] = "Name of the Job",
        ["Description"] = "Job description",
        ["Icon"] = "Icon Name",
        ["IconColor"] = "Icon color",
        ["Rating"] = 2,
        ["MimWorkers"] = 1, 
        ["MaxWorkers"] = 2, 
        ["Location"] = false, 
        ["RequiredItem"] = false, 
},

job code = job code in sh_jobs.lua

TaskId = Start from 1 and increment by one

TaskText = description of the task ( %s can be edited using export )

ExtraDone = 0 -- if it is a stepped job, this is the starting count

ExtraNeed = 10, -- If it is a stepped job, specify the number you want to reach

['jobcode'] = {
  {
    ["TaskId"] = 1,
    ["TaskText"] = "Example",
    ["Finished"] = false
  },
  {
    ["TaskId"] = 2,
    ["TaskText"] = "Example %s",
    ["ExtraDone"] = 0,
    ["ExtraNeed"] = 10,
    ["Finished"] = false
  },
}

Events

Sample files are available in gksphone/client/apps/job and gksphone/server/job.

RegisterNetEvent("gksphone:client:JobStartTask", function (jobInfoName, Tasks)
    -- Event running for all group members
    -- jobInfoName ( job code )
    -- Tasks ( tasks assigned for the job )
end)


RegisterNetEvent("gksphone:client:jobStartLeader", function (jobInfoName)
    -- event running for group leader when job starts
    -- jobInfoName ( job code )
end)


RegisterNetEvent("gksphone:client:JobNextTask", function (NewTaskID)
    -- Event running on all group members and when a new task progresses
    -- NewTaskID = task id of the new task
end)
RegisterNetEvent("gksphone:server:jobStartLeader", function (source, jobName, groupID, groupMembers)
    -- Server event running for group leader
    -- source = group leader player id
    -- jobName = name of job done
    -- groupID = ID of the created group
    -- groupMembers = players in the group
    -- { --groupMember Data
      -- cid = player identifier,
      -- source = player ID,
      -- online = true,
      -- name = character's first and last name
    -- }
end)

There is no finish event, you have to finish it manually and delete the group using export

Exports - Server

GetJobGroupByLeader

Brings the group information of the person who is the Group Leader.

local playerIdentifier = "Player Identifier" 
local groupData = exports["gksphone"]:GetJobGroupByLeader(playerIdentifier)
print(json.encode(groupData, {indent = true}))

DeleteJobGroup

Delete Group

exports["gksphone"]:DeleteJobGroup("jobcode", groupID)

GetGroupByMember

Returns the information of the group with the player identifier

local playerIdentifier = "Player Identifier" 
exports["gksphone"]:GetGroupByMember(playerIdentifier)

Exports - Client

IsGroupLeader

local isLeader = exports["gksphone"]:IsGroupLeader()
print(isLeader) -- true or false

IsTaskStatus

local TaskID = 1
local isLeader = exports["gksphone"]:IsTaskStatus(TaskID)
print(isLeader) -- true or false

TaskUpdate

local TaskID = 1
local TaskStatus = true -- true or false
local ExtraDone = 0 -- if it is a progressive job, you can change the number accordingly
exports["gksphone"]:TaskUpdate(TaskID, TaskStatus, ExtraDone)

TaskListUpdate

If you want to make changes in Task List Text, you can use

-- TaskList == Send all tasks list after making the exchange
exports["gksphone"]:TaskListUpdate(TaskList)

TaskList

local taskList = exports["gksphone"]:TaskList()
📱
🚒
https://fonts.google.com/icons