BeamMP allows you to create your own client side plugins as well. We have provided a few functions that you can use to communicate with other multiplayer mods, and other players through the server.
You can create an event your custom functions can hook onto. For example to parse the chat use the ChatMessageReceived event as such:
local function chatReceived(msg) -- Receive event with parameters
print("chat received: "..msg)
local i = string.find(s, ":") -- Find where our first ':' is, used to separate the sender and message
if i == nil then
print("error parsing message: separator could not be found!")
return -- Could not find separator, cancel function
end
print("index of separator: "..tostring(i))
local sender = string.sub(msg, 1, i-1) -- Substring our input to separate its 2 parts
local message = string.sub(msg, i+1, -1)
-- Do whatever you want to with the message
print("sender: " .. sender)
print("message: ".. message)
end
AddEventHandler("ChatMessageReceived", chatReceived)
TriggerServerEvent("ServerEventName", "Data")
AddEventHandler("EventNameToBeCalled", Function())