CityRP Documentation Repository

core.plugins.passivemode.sv_init

Passive Mode

Functions

Servercityrp.passivemode.activate()Source ☍

Activate passivemode, overwrite functions and refund contraband.

Servercityrp.passivemode.contra()Source ☍

Refunds all contraband and pots for all players.

Servercityrp.passivemode.deactivate(calling_ply)Source ☍

Deactivate passivemode, overwrite functions and refund contraband.

Parameters

  • calling_plyanyOptional param used to callback if it fails.
Servercityrp.passivemode.hasAccess(ply, access) → booleanSource ☍

Overwritten hasAccess which disallows weapons.

Parameters

  • plyanyThe player to check access for.
  • accessanyThe access to check against.

Returns

  1. booleanif access is weapons. Otherwise regular hasAccess return.
Servercityrp.passivemode.itemdrop(ply, item, dropAmount, position) → booleanSource ☍

Overwritten itemdrop which disallows contraband.

Parameters

  • plyanyThe player using the item.
  • itemanyThe item being used.
  • dropAmountanyThe number of items being dropped.
  • positionanyThe position at which the items were being dropped.

Returns

  1. booleanif item is weed or contraband. Otherwise regular itemdrop return.
Servercityrp.passivemode.itemuse(ply, item) → booleanSource ☍

Overwritten itemuse which disallows contraband.

Parameters

  • plyanyThe player using the item.
  • itemanyThe item being used.

Returns

  1. booleanif item is weed or contraband. Otherwise regular itemuse return.
Servercityrp.passivemode.reequip(loadouts, ply)Source ☍

Hands a player back what passive mode took, once it ends. Only a player who is alive, free and not arrested is granted their kit; a restraint or knockout keeps its hold on the stash and returns it by its own route, and an arrested player is granted afresh on release.

Parameters

  • loadoutstableThe loadouts plugin.
  • plyPlayer
Servercityrp.passivemode.strip()Source ☍

Strips all weapons from all players, resets weapon mods and clears ragdoll weapons.

Servercityrp.passivemode.strips(class) → booleanSource ☍

Whether passive mode takes a weapon class off players.

Parameters

  • classstring

Returns

  1. boolean
Servercityrp.passivemode.stripweapon(ply, class, wType, wName)Source ☍

Check if a specific weapon is to be stripped from a player, and strip it if so.

Parameters

  • plyanyThe player being stripped.
  • classanyThe class of the weapon being stripped.
  • wTypeanyThe weapon type of the weapon being stripped.
  • wNameanyThe name of the weapon bineg stripped.

Tables

Servercityrp.passivemodeSource ☍

Table containing all data for passivemode.

Servercityrp.passivemode.functionsSource ☍

Table which contains the old functions, replaced when passivemode is activated.

Fields

Servercityrp.passivemode.activeSource ☍

States if passive mode has been activated already.

Servercityrp.passivemode.functions.hasAccessSource ☍
Servercityrp.passivemode.functions.itemdropSource ☍
Servercityrp.passivemode.functions.itemuseSource ☍
ServercontrabandEntsSource ☍