EZ Scripts
DiscordTebex
  • 💡Welcome To EZ Scripts
  • 🛡️Ez Admin Authority
    • Config File
  • 🫳Ez Item Spawner
    • Config File
    • Permission Check
    • Add Item
    • Get Items
  • FIVEM
    • 🍀EZ White Widow
      • Config File
      • Add more locations
      • Common Issues
    • 🟣EZ Lean Drug
      • Config File
      • Add more locations
    • 🛡️Ez Admin Authority
    • 🔠EZ Plate Changer
      • Config File
    • 📑Ez Lib
      • Config File
    • ❄️EZ Coke & Crack Drug
      • Config File
      • Add more locations
    • 🫳Ez Item Spawner
  • RedM
    • 💼EZ Society & Job Menu
      • Config File
      • Exports
        • Duty System Exports
      • Syn Society
    • 🌍EZ Fast Travel
      • Config File
    • 🍖Ez Consumables
      • Config File
    • 📺Ez HUD
      • Config File
      • Exports and Events
    • 🛡️Ez Admin Authority
    • 🚷EZ Combat Logging
      • Config File
    • 🗽EZ Life Style
      • Getting Life Style
      • Config File
    • ☢️EZ Radial Menu
      • Config File
    • 🫳Ez Item Spawner
    • ❓Ez Report Menu
      • Config File
Powered by GitBook
On this page
  1. RedM
  2. 💼EZ Society & Job Menu

Exports

Server and Client side exports for your other scripts

PreviousConfig FileNextDuty System Exports

Last updated 25 days ago

Was this helpful?

CtrlK
  • 🔧 Duty System
  • 🎖 Role Utilities
  • 💰 Society Finances

Was this helpful?


🔧 Duty System

SetPlayerDuty(source: number, value: boolean|string|nil): void

Sets the duty status for a player.

Parameters

  • source (number): The player's server ID.

  • value (boolean|string|nil):

    • true — Puts the player on duty.

    • false — Takes the player off duty.

    • string — Represents a region (for regional duty).

    • nil — Toggles the current duty status.

Behavior

  • If duty is toggled on and the society has regional duty enabled, it will prompt the client to select a region.

  • Sends a Discord webhook for status changes.

Example

SetPlayerDuty(23, true)
SetPlayerDuty(23, false)
SetPlayerDuty(23, nil)
SetPlayerDuty(23, "Valentine")

IsPlayerOnDuty(source: number): boolean, string|nil, any

Checks if a player is currently on duty.

Parameters

  • source (number): The player's server ID.

Returns

  • boolean: Whether the player is on duty.

  • string|nil: The job name (if on duty).

  • any: Region or associated duty value.

Example

local isOnDuty, job, region = IsPlayerOnDuty(23)
print(isOnDuty, job, region)

Output

true    "police"    "Valentine"

GetPlayersOnDuty(society: string, aslist: boolean, region?: string): table

Returns a list or map of players currently on duty.

Parameters

  • society (string)

  • aslist (boolean)

  • region (string, optional)

Returns

  • table: List or map of players on duty.

Examples

-- Flat list
local policeOnDuty = GetPlayersOnDuty("police", true)
print(json.encode(policeOnDuty))

Output:

{ 12, 33, 45 }
-- Filtered by region
local valentinePolice = GetPlayersOnDuty("police", true, "Valentine")
print(json.encode(valentinePolice))

Output:

{ 12, 33 }
-- Map with region
local detailedDutyMap = GetPlayersOnDuty("police", false)
print(json.encode(detailedDutyMap))

Output:

{
  ["12"] = "Valentine",
  ["33"] = "Valentine",
  ["45"] = "Rhodes"
}

🎖 Role Utilities

IsBoss(society: string, grade: number|string): boolean

Checks if the given grade in a society is a boss.

Example

local isBoss = IsBoss("police", 4)
print(isBoss)

Output:

true

IsRecrank(society: string, grade: number|string): boolean

Checks if the grade is a "recruit rank" or boss.

Example

local isRecruitOrBoss = IsRecrank("sheriff", 0)
print(isRecruitOrBoss)

Output:

true

💰 Society Finances

SocietyMoneyAdd(society: string, amount: number): boolean

Adds money to the society account.

Example

local success = SocietyMoneyAdd("lawman", 500)
print(success)

Output:

true

SocietyMoney(society: string): number|boolean

Gets current society account balance.

Example

local money = SocietyMoney("doctor")
print(money)

Output:

1500