Code:
function onSay(cid, words, param)
monsterarena = param
local aret = monsterarena
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_YELLOW_RINGS)
if monsterarena == "pandora" then
local aret = "husky"
doCreatureSay(cid, "Pandora is not allowed!", TALKTYPE_ORANGE_1)
doCreatureSay(cid, "Changed to husky!", TALKTYPE_ORANGE_1)
print(monsterarena)
elseif monsterarena == "ice demon" then
local aret = "husky"
doCreatureSay(cid, "Ice Demon is not allowed!", TALKTYPE_ORANGE_1)
doCreatureSay(cid, "Changed to husky!", TALKTYPE_ORANGE_1)
print(monsterarena)
elseif monsterarena == "ice guard" then
local aret = "husky"
doCreatureSay(cid, "Ice Guard is not allowed!", TALKTYPE_ORANGE_1)
doCreatureSay(cid, "Changed to husky!", TALKTYPE_ORANGE_1)
print(monsterarena)
elseif monsterarena == "black hero" then
local aret = "husky"
doCreatureSay(cid, "Black Hero is not allowed!", TALKTYPE_ORANGE_1)
doCreatureSay(cid, "Changed to husky!", TALKTYPE_ORANGE_1)
print(monsterarena)
elseif monsterarena == "gorlic" then
local aret = "husky"
doCreatureSay(cid, "Gorlic is not allowed!", TALKTYPE_ORANGE_1)
doCreatureSay(cid, "Changed to husky!", TALKTYPE_ORANGE_1)
print(monsterarena)
elseif monsterarena == "grim" then
monsterarena = "husky"
doCreatureSay(cid, "Grim is not allowed!", TALKTYPE_ORANGE_1)
doCreatureSay(cid, "Changed to husky!", TALKTYPE_ORANGE_1)
print(monsterarena)
else
doCreatureSay(cid, "You choose: " .. aret .. ".", TALKTYPE_ORANGE_1)
end
end
I am not sure how to create good loop for not allowed monsters, tryied 2 times but always did not work, without any error in logs.