Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onSay(cid, words, param, channel)
- local T = string.explode(param, ",")
- local player = getPlayerByName(T[1])
- local blocked = {1, 2, 3, 4} -- blocked items
- if not player then
- doPlayerSendTextMessage(cid, 27, "Player not found.") return true
- elseif not tonumber(T[2]) or not tonumber(T[3]) then
- doPlayerSendTextMessage(cid, 27, words .. " Player Name, Item Id, type.") return true
- elseif getCreatureName(cid) == T[1] then
- doPlayerSendTextMessage(cid, 27, "You can't send items for yourself.") return true
- elseif not doPlayerRemoveItem(cid, T[2], T[3]) then
- doPlayerSendTextMessage(cid, 27, "[ERROR] You don't have this item.") return true
- elseif isInArray(blocked, T[2]) then
- doPlayerSendTextMessage(cid, 27, "Blocked Id.") return true
- end
- doPlayerSendTextMessage(cid, 27, "You send " .. T[3] .. "x " .. getItemNameById(T[2]) .. " to " .. T[1] .. ".")
- doPlayerSendTextMessage(player, 27, "You received " .. T[3] .. "x " .. getItemNameById(T[2]) .. ".")
- doPlayerAddItem(player, T[2], T[3])
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement