Command Palette

Search for a command to run...

Allowances

The complete list of what you can tell AstroShield to allow, with time limits and which ones the server knows about.

An allowance tells AstroShield that a change to a player is intended. While it is active, the checks that would otherwise flag the change stay quiet. You create allowances with exports.AstroShield:allow on the client or allowPlayer on the server. Most of the time the shared guard creates them for you.

There are two kinds, and they behave differently.

Time-limitedState
ValueMillisecondstrue / false, or a number
LastsThat many milliseconds. Default 5000, maximum 60000. Calling again extends it, it never shortens it.Until you set a new state. The newest call wins.
Typical useA single action: teleport, heal, revive.A mode: invincible in a safe zone, frozen during a cutscene.

Everything is per player. A client allowance is reported to the server in batches, for the kinds the server needs to know about, so server-side checks accept it too.

Time-limited kinds#

KindAllowsKnown to the server
teleportMoving the player or their vehicle.Yes
reviveResurrecting the player.Yes
healthSetting or restoring health.Yes
armourAdding armor.Yes
fadeFading the player or vehicle in or out.Yes
attachAttaching the player or vehicle to another entity.Yes
warpVehiclePutting the player into a vehicle.Yes
superJumpA super jump.Yes
playerSwitchThe player switch effect, as used by character selection.Yes
screenFadeFading the screen out or in.Yes
cameraCreating or activating a script camera.Yes
ammoAdding or setting ammo.Client only
plateChanging a vehicle's license plate.Client only
handlingChanging vehicle handling.Client only
staminaRestoring or resetting stamina.Client only
forceApplying force, velocity or a boost to the player or vehicle.Client only
controlsDisabling or changing controls. Accepted so that older scripts keep working.Client only
pickupThe player picking up a weapon from the world.Client only

The server-side allowPlayer accepts only the kinds marked Yes.

State kinds#

KindValueAllows
invinciblebooleanThe player being invincible.
vehInvinciblebooleanThe player's vehicle being invincible.
canBeDamagedbooleanSetEntityCanBeDamaged on the player.
proofsbooleanDamage proofs on the player.
maxHealth, maxArmournumberA maximum health or armor above the default.
visible, vehVisiblebooleanThe player or vehicle being invisible.
alphanumberA changed entity alpha.
collision, vehCollisionbooleanCollision switched off.
frozen, vehFrozenbooleanThe player or vehicle being frozen in place.
canRagdollbooleanRagdoll switched off.
cfgFlag6, cfgFlag223booleanThe ped config flags 6 and 223.
infiniteAmmobooleanInfinite ammo.
scriptCambooleanRendering a script camera.
focusbooleanA focus position set by a script.
spectatebooleanSpectator mode.
sprintMult, swimMult, moveRatenumberChanged run, swim or move speed.
nightvision, thermalbooleanNight vision or thermal vision.
dmgMod, defMod, defMod2, meleeDmgMod, meleeDefModnumberWeapon and melee damage or defense modifiers.
pedModelmodel hashA changed player model.
vehPower, vehTopSpeed, vehGravity, vehPowerMult, vehTorqueMultnumberChanged vehicle power, top speed, gravity, engine power or torque.
voiceRangenumberA changed voice range.
menubooleanA menu with a cursor is open.
controlOffbooleanControls disabled by a script.

The server also tracks these states: invincible, canBeDamaged, proofs, visible, collision, frozen, scriptCam, focus, spectate, pedModel, menu and controlOff. The others are checked on the client only.

Weapons and spawns#

KindValueAllows
weaponweapon name or hashThe player having that weapon.
removeWeaponweapon name or hashWithdraws the allowance of one weapon.
removeAllWeaponstrueWithdraws all weapon allowances.
componentcomponent hashA weapon component.
weaponDmg"<weaponHash>:<multiplier>"A custom damage multiplier for one weapon.
recoilweapon hashChanged recoil for that weapon.
spawnVehicle, spawnPed, spawnObjectmodel name or hashSpawning that model.
spawnTraintrain variation numberSpawning a train.

Spawn allowances are sent to the server immediately, so it knows about them before the entity arrives.

From the server to the client#

A server script can also send an allowance straight to a player's client, for any of the kinds above:

Lua
TriggerClientEvent('astroshield:allow', src, 'teleport', 5000)
TriggerClientEvent('astroshield:allow', src, 'invincible', true)

The client only accepts this event from the server. It is applied to the client's checks and not reported back, so use it together with allowPlayer when the server checks matter as well.