GE Lua Documentation

Press F to search!

onTrafficAction

Definition


-- @/lua/ge/extensions/gameplay/police.lua:476

local function onTrafficAction(id, action, data)
  if gameplay_traffic.getTrafficData()[id] then
    if action == 'changeRole' then
      if data.name == 'police' then
        if not policeVehs[id] then
          policeVehs[id] = gameplay_traffic.getTrafficData()[id]
        end
      elseif data.prevName == 'police' then
        if policeVehs[id] then
          policeVehs[id] = nil
        end
      end
    end
  end
end

Callers

@/lua/ge/extensions/editor/trafficDebug.lua

local function onTrafficAction(id, action, data)
  appendLog(id, action, data)