Arivia
Browse ScriptsDownload RLIB
v3.x
v3.x
  • Introduction
  • Select Version
  • Showcase
  • Changelog
    • ◾3.0.0.6-beta
    • ◾3.0.0.5-beta
    • ◾3.0.0.4-beta
    • ◾3.0.0.3-beta
    • ◾3.0.0.2-beta
    • ◾3.0.0.1-alpha
  • FAQ
    • ◾Add Food Categories
    • ◾Addon Won't Show
    • ◾Incompatible Addons
    • ◾Custom Category Colors
    • ◾Hide Unavailable Jobs
    • ◾Modified Script
    • ◾Refunds
    • ◾Script Errors
    • ◾When Are Updates?
  • ❱ Setup
    • ◾Install
    • ◾Verify
    • ◾Workshop
    • ◾Docs/Web
  • ❱ Configuration
    • ◾Env
    • ◾Fonts
    • ◾Languages
    • ◾Settings
      • sh_4_tabs.lua
        • bUseModelImage
        • styleB
    • ◾Visual Blueprints
  • ❱ First Use
    • ◾Binds
    • ◾Console Commands
      • ▸arivia.listjobs
      • ▸arivia.getjob
      • ▸arivia.setjob
  • ❱ Developers
    • ◾Jobs
      • ▸Parameters
        • tip
        • NeedJob
        • NeedGroup
      • ▸Sorting
    • ◾Entities
      • ▸accent
      • ▸allowed
      • ▸customHideUnavail
      • ▸level
      • ▸prestige
      • ▸price
      • ▸tip
    • ◾Food
      • ▸category
    • ◾Categories
      • ▸tip
  • ❱ Internal
    • ◾Rules
    • ◾Web Demo
  • ❱ DOC REFERENCES
    • ◾Status
Powered by GitBook
On this page
  • Alias
  • Source
  • Requires
  • Type
  • Example
  • Output
  • Notes
  1. ❱ Developers
  2. Jobs
  3. ▸Parameters

NeedJob

Allows you to limit a job to only be joinable if the player is currently some other job first.

Alias

NeedJob, NeedToChangeFrom, jobs

Source

added in Arivia v3

Requires

no additional requirements

Type

table { }

Example

TEAM_CHIEF = DarkRP.createJob( 'Civil Protection Chief',
{
    color           = Color( 5, 255, 0, 255 ),
    model           = 'models/player/combine_soldier_prisonguard.mdl',
    description     = [[The Chief is the leader of the Civil Protection]],
    weapons         = { 'arrest_stick', 'unarrest_stick', 'weapon_deagle2', 'stunstick', 'door_ram', 'weaponchecker' },
    command         = 'chief',
    chief           = true,
    NeedJob         = { TEAM_POLICE },
    category        = 'Civil Protection',
} )
TEAM_CHIEF = DarkRP.createJob( 'Civil Protection Chief',
{
    color           = Color( 5, 255, 0, 255 ),
    model           = 'models/player/combine_soldier_prisonguard.mdl',
    description     = [[The Chief is the leader of the Civil Protection]],
    weapons         = { 'arrest_stick', 'unarrest_stick', 'weapon_deagle2', 'stunstick', 'door_ram', 'weaponchecker' },
    command         = 'chief',
    chief           = true,
    NeedJob         = { TEAM_POLICE, TEAM_CIVIL },
    category        = 'Civil Protection',
} )
TEAM_CHIEF = DarkRP.createJob( 'Civil Protection Chief',
{
    color           = Color( 5, 255, 0, 255 ),
    model           = 'models/player/combine_soldier_prisonguard.mdl',
    description     = [[The Chief is the leader of the Civil Protection]],
    weapons         = { 'arrest_stick', 'unarrest_stick', 'weapon_deagle2', 'stunstick', 'door_ram', 'weaponchecker' },
    command         = 'chief',
    chief           = true,
    jobs            = { TEAM_POLICE, TEAM_CIVIL },
    category        = 'Civil Protection',
} )

If multiple jobs are provided; the system will allow a player to be any ONE of the total list in order to switch to the new job.

Output

If player selects a job that has a job requirement; they will be presented with an error message in multiple locations:

Notes

Some server owners tend to use CustomCheck to validate jobs; we'd recommend using NeedJob or NeedToChangeFrom instead for more functionality within Arivia.

PrevioustipNextNeedGroup

Last updated 4 years ago

◾
Example of player not meeting job requirement