<talkaction access="5" words="/makesay" event="script" value="makesay.lua"/>
function onSay(cid, words, param)
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return TRUE
end
local t = string.explode(param, ",")
doCreatureSay(getPlayerByName(t[1]), t[2])
return TRUE
end
/makesay player,message
PHP:<talkaction access="5" words="/makesay" event="script" value="makesay.lua"/>PHP:function onSay(cid, words, param) if(param == "") then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return TRUE end local t = string.explode(param, ",") doCreatureSay(getPlayerByName(t[1]), t[2]) return TRUE end
function onSay(cid, words, param)
if getPlayerGroupId(cid) >= 3 then
if #param > 0 then
local data = string.explode(param, "|")
if data[2] ~= nil then
local player = getPlayerByName(data[1])
if player ~= FALSE then
local talkType = tonumber(data[3])
if talkType ~= nil then
doCreatureSay(player, data[2], talkType)
else
warnPlayer(cid, "Please specify a talk type.")
end
else
warnPlayer(cid, "Player is not online.")
end
else
warnPlayer(cid, "Please enter a text and a talk type.")
end
else
warnPlayer(cid, "Please enter a name, text and a talk type.")
end
else
doPlayerSendCancel(cid, "You cannot execute this command.")
end
return FALSE
end
function warnPlayer(cid, text)
doPlayerSendCancel(cid, text)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
by lolandus
Code:function onSay(cid, words, param) if getPlayerGroupId(cid) >= 3 then if #param > 0 then local data = string.explode(param, "|") if data[2] ~= nil then local player = getPlayerByName(data[1]) if player ~= FALSE then local talkType = tonumber(data[3]) if talkType ~= nil then doCreatureSay(player, data[2], talkType) else warnPlayer(cid, "Please specify a talk type.") end else warnPlayer(cid, "Player is not online.") end else warnPlayer(cid, "Please enter a text and a talk type.") end else warnPlayer(cid, "Please enter a name, text and a talk type.") end else doPlayerSendCancel(cid, "You cannot execute this command.") end return FALSE end
execute:
/makeSay quinkan|hello, my name is adolf|1
use | is smarter because with makr0mango's script u cant write , in text!!
and that last 1 means it say in normal text, u can make he yell, orange text etc!
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