Skip to content

fix(menu): prevent frozen players from bypassing freeze via vehicle spawn#1107

Open
YgorLeal wants to merge 1 commit into
citizenfx:developfrom
YgorLeal:fix/freeze-vehicle-bypass
Open

fix(menu): prevent frozen players from bypassing freeze via vehicle spawn#1107
YgorLeal wants to merge 1 commit into
citizenfx:developfrom
YgorLeal:fix/freeze-vehicle-bypass

Conversation

@YgorLeal
Copy link
Copy Markdown

@YgorLeal YgorLeal commented Apr 9, 2026

Summary

Fixes #1000 — Frozen players can no longer bypass freeze by spawning and entering a vehicle.

Problem

The freeze handler called FreezeEntityPosition only once. If a frozen player spawned a vehicle (e.g. via a server menu) and entered it, the freeze was effectively lost since the vehicle itself wasn't frozen and the ped freeze could be overridden.

Solution

Added a persistent thread that runs while the player is frozen:

  • Continuously re-applies FreezeEntityPosition on the ped every frame
  • Disables the "enter vehicle" control (control 75)
  • If the player manages to enter a vehicle, freezes the vehicle and ejects them

The thread exits cleanly when the player is unfrozen.

Testing

  1. Freeze a player via txAdmin menu
  2. Have the player spawn a vehicle (via any server menu/script)
  3. Player should NOT be able to enter or drive the vehicle
  4. Unfreeze the player
  5. Player should be able to enter and drive vehicles normally

…pawn (citizenfx#1000)

Replace the one-shot FreezeEntityPosition call with a persistent thread
that continuously re-applies freeze, disables vehicle entry controls,
and ejects+freezes any vehicle the player manages to enter.
@YgorLeal YgorLeal requested a review from tabarra as a code owner April 9, 2026 01:20
DisableControlAction(0, 75, true) -- disable entering vehicles
local veh = GetVehiclePedIsIn(ped, false)
if veh ~= 0 then
FreezeEntityPosition(veh, true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is the vehicle unfrozen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants