I have a "/do" team, want to make still "/todo". It works approximately so:
function doChat(player, cmd, ...)
if ... then
local message = table.concat({...}, "")
for i, v in pairs(getElementsByType("player")) do
local x, y, z = getElementPosition(player)
local xt, yt, zt = getElementPosition(v)
if getDistanceBetweenPoints3D(x, y, z, xt, yt, zt) <= 10 then
outputChatBox("" ..message.. " (" ..getPlayerName(player).. ")", v, 194, 162, 218, true)
end
end
end
end
addEventHandler("CommmandHandler", getRootElement(), doChat)
addCommandHandler("do", doChat)
The player writes the message: todo text1*text2
As a result to the player such message is displayed: nickname text1 - told text2
How to me to replace "*" with the text necessary to me?