Esc to clear, Enter to open the best match, click an export to open it in its page
Security

Sentinel: Tamper Guard

The Sentinel stops a player's game from forging the facts WHIP shares through statebags: who is dead, on duty or escorted, damage taken, a car's stats. It's on out of the box, with nothing to write.

FiveM lets a player's game change the statebags about them and their car. When one changes a WHIP key, the Sentinel puts the right value back and strikes that player. Honest games never write these keys, so a detection is a modified client.

When it catches oneServer owners

The Monitor shows a red Tampered with <key> row and the console prints TAMPER. At 3 strikes the player is kicked, with a note signed Sentinel in the Player Manager as the lasting record. Strikes wear off after an hour, and reset when they rejoin. A kick isn't a ban: ban them from the Player Manager once you're sure.

A cheat, or a resource? A resource writing WHIP's keys looks exactly like a cheat. One player struck on a key that helps them is a cheat; several struck on one key at once (say, after an admin menu's revive) is a resource: turn kicking off and find it.
Config.SentinelDefaultWhat it does
enabledtruefalse turns the Sentinel off
autoKick3Strikes before a kick. false records them and kicks nobody
strikesForgetMinutes60Minutes without a strike before the count resets. false: never
logDebounceMs1000Repeats of one key by one player within this many ms count as one
bootSweeptrueAt start, put back values left wrong before the restart, with no strikes
damageModifierClamp{ min = 0.05, max = 4.0 }The range damage and melee modifiers are held to (0.05: 5% of the damage)

The first three can be changed live in /whip → Settings → Config → Server (changing a setting in game), where a saved value wins over config.lua and an empty Kick after box turns kicking off.

What it watches

Every WHIP key starts with whip:

For resource developers

RegisterSentinelKey(def)SERVER#

Puts one of your statebag keys under the Sentinel. A player key's truth is what you last wrote with SetSentinelPlayerKey; an entity key's comes from your truth function, since entities come and go.

FieldTypeDescription
def.keystringThe key. One another resource watches is refused
def.familystring'player' or 'entity'
def.truthfunction?Required for entity keys: function(entity) → value|nil, run when the key changes. nil removes the key: return it at the default, not {}
Returns: true, or false, reason. Watches go when your resource stops
Whip.core:RegisterSentinelKey({ key = 'mygang_tag', family = 'player' })   -- inside Whip.register
SetSentinelPlayerKey(src, key, value) / GetSentinelTruth(src, key)SERVER#

Set records a value on the server, then writes the statebag. Truth reads that record, never the statebag: gate server checks on it. It reads WHIP's keys too.

ParamTypeDescription
srcnumberServer id; to set, they must be connected
keystringTo set: your keys or unwatched ones; another resource's and WHIP's are refused
valueanySet only. nil for "off", not false: an absent key costs nothing
Returns: set: true, or false, reason ('no such player', 'key "whipDead" is owned by whip_core') · truth: the value written (false and nil differ)
SetSentinelEntityKey(entity, key, value)SERVER#

Writes one of your entity keys. Update the table your truth reads first; if they disagree, the console warns, nobody is struck, and the key is set back to your truth.

ParamTypeDescription
entitynumberThe entity (it must exist)
keystringYour keys or unwatched ones; another resource's and WHIP's are refused
valueanynil removes it
Returns: true, or false, reason ('no such entity', 'key "x" is owned by …')
tunes[plate] = t                                                -- your table, first
exports.whip_core:SetSentinelEntityKey(veh, 'mytune_data', t)   -- then the key
Not Entity(e).state:set. A bare write strikes whoever runs the entity: for a car, its driver.