Requesting help. To do a single thing

Hello everyone :).

Please could one of you point me in the right direction to do that.

I know how to kick players.
But I’m requesting help for kick player when they are typing something in the F8 console.

Is the chat and F8 console the same ?

On my framework (VRP) yes F8 is pretty the same as chat (im using the fiveM chat resource) but it have a little difference on chat i have to write “/command” in F8 just “command” something like that would work (not tested) :
server.lua :

AddEventHandler( 'chatMessage', function( source, n, msg )  
    msg = string.lower( msg )
    -- Check to see if a client typed in /dv
    if ( msg[1] == "/" ) then 
        -- Cancel the chat message event (stop the server from posting the message)
        CancelEvent() 
        --Kick the bad player !
    end
end )

Ok, I have bad and good new.
Bad one : This doesn’t work for me. Does I have to put it in chat ressource or it does not work ?

Good one : I know how cheaters are injecting cheat inside server.

They are using the /exec command.

This is native right ?
Where is located this command ? So i can change the effect of it. And make a new exec command with different name ?

It’s just a way to execute a command like you would using the console or chat. Just listen for a command using RegisterCommand

Sorry no, don’t do that. Force the user to trigger a server event that passes GetRegisteredCommands(). Then check server side against some commands you don’t want.

Something like

Client side

Citizen.CreateThread(
    function()
        while true do
            -- Check every 10 seconds. They may not start the cheat straight away when they load in
            Citizen.Wait(10000)
            TriggerServerEvent("arewenaughtyornot", GetRegisteredCommands())
        end
    end
)

Server side

-- Thanks to Jaymo and Smallo
local bannedClientCommands = {
  ["somebannedcommand"] = true,
  ["morebannedcommands"] = true
}

local LastCaughtNaughty = -1

RegisterNetEvent("arewenaughtyornot")
AddEventHandler(
  "arewenaughtyornot",
  function(commandsTable)
    local _source = source

    if (LastCaughtNaughty ~= -1 and LastCaughtNaughty == _source) then
      CancelEvent()
      return
    end

    if commandsTable and type(commandsTable) == "table" then
      for i, cmdObj in ipairs(commandsTable) do
        if bannedClientCommands[cmdObj.name] then
          -- Triggered it so do something here like banning them
          LastCaughtNaughty = _source
          CancelEvent()
          return
        end
      end
    end
  end
)

And according to this : Controls - Cfx.re Docs

	> elseif (IsControlJustPressed(1, 37) and IsControlJustPressed(1, 34)) then --tab + a
  	TriggerServerEvent("Drop_player" )

Why i can’t protect the TAB+a combination ? it work for insert or single key but not double ones.

@d0p3t ty for your answer.

Can’t get this work … no one have already bind tab + key ?