Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onSay(cid, words, param)
- local t = string.explode(param, ",")
- local pos = getCreaturePosition(cid)
- local cfg = {
- max_summon = 9,
- price = 100000,
- }
- if #getPlayersInArea({fromx = pos.x+4, fromy = pos.y+4, fromz = pos.z, tox = pos.x-4, toy = pos.y-4, toz = pos.z}) > 1 then
- doPlayerSendTextMessage(cid, 20, "Do this in a place where no other players.") return true end
- if not t[1] or not t[2] or not tonumber(t[2]) then
- doPlayerSendTextMessage(cid, 20, "The command does not recognize these parameters.") return true end
- if tonumber(t[2]) > cfg.max_summon then
- doPlayerSendTextMessage(cid, 20, "Maximum monsters in your spawn is "..cfg.max_summon..", rushed.") return true end
- if not doPlayerRemoveMoney(cid, cfg.price) then
- doPlayerSendTextMessage(cid, 20, "You do not have enough money to buy their own spawn!") return true end
- for i = 1, t[2] do
- doCreateMonster(t[1], {x = pos.x+3, y = pos.y+3, z = pos.z})
- end
- doPlayerSendTextMessage(cid, 20, "His spawn was summoned, good level up for you!")
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement