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, ",")
local id = tonumber(t[1])
if(not id) then
id = getItemIdByName(t[1], false)
if(not id) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")
return true
end
end
local amount = 1
if(t[2]) then
amount = t[2]
end
doPlayerSendTextMessage(cid, 25, "All players have recieved "..amount.." "..getItemNameById(id)..".")
for _, cid in ipairs(getPlayersOnline()) do
doPlayerAddItem(cid,id,amount)
doPlayerSendTextMessage(cid, 25, "You have recived "..amount.." "..getItemNameById(id)..".")
end
return true
end