function onSay(cid, words, param)
local t = string.explode(param, ",")
local target = getPlayerByNameWildcard(t[1])
local check = TRUE
if param == "" then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "You must type a player and some text")
check = FALSE
elseif t[1] == nil or t[2] == nil then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Wrong format, type: /say player,text")
check = FALSE
elseif isPlayer(target) == FALSE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "A player with that name does not exist")
check = FALSE
elseif target == FALSE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "A player with that name is not online")
check = FALSE
elseif t[1] == "" then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "You must type a player")
check = FALSE
elseif t[2] == "" then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "You must type some text")
check = FALSE
end
if t[3] == nil then
t[3] = 1
end
if check ~= FALSE then
doCreatureSay(target, t[2], t[3])
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, t[1].." has said: "..t[2])
end
return TRUE
end