function main()
while not isSampAvailable() do wait(0); end
while true do
wait(0);
if isKeyJustPressed(8) and not sampIsChatInputActive() then
enabled = not enabled;
sampAddChatMessage(tostring(enabled), -1);
freezeCharPosition(PLAYER_PED, enabled);
end
if enabled then
setVirtualKeyDown(1, true);
wait(1);
setVirtualKeyDown(1, false);
end
end
end