Ir para conteúdo

Posts Recomendados

 

function onSay(cid, words, param, channel)
local func = doCreateMonster
if(words:sub(2, 2) == "n") then
func = doCreateNpc
end
 
local pid = cid
local t = string.explode(param, ",")
if(t[2]) then
pid = getPlayerByNameWildcard(t[2])
if(not pid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
return true
end
end
 
local position = getCreaturePosition(pid)
local effect = CONST_ME_MAGIC_RED
local ret = func(t[1], position, false)
if(tonumber(ret) == nil) then
effect = CONST_ME_POFF
doPlayerSendDefaultCancel(cid, (ret == false and RETURNVALUE_NOTPOSSIBLE or RETURNVALUE_NOTENOUGHROOM))
end
 
doSendMagicEffect(position, effect)
return true
end
Link para o comentário
https://xtibia.com/forum/topic/235260-erros-m/#findComment-1658907
Compartilhar em outros sites

Tente esse:

function onSay(cid, words, param, channel)

local func = doCreateMonster
if(words:sub(2, 2) == "n") then
func = doCreateNpc
end
local pid = cid
local t = string.explode(param, ",")
local position = getCreaturePosition(pid)
local effect = CONST_ME_MAGIC_RED
local ret = func(t[1], position, false)
if(tonumber(ret) == nil) then
effect = CONST_ME_POFF
doPlayerSendDefaultCancel(cid, (ret == false and RETURNVALUE_NOTPOSSIBLE or RETURNVALUE_NOTENOUGHROOM))
end
doSendMagicEffect(position, effect)
return true
end

Link para o comentário
https://xtibia.com/forum/topic/235260-erros-m/#findComment-1658913
Compartilhar em outros sites

  • 4 weeks later...
Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...