Ir para conteúdo

[Error - Talkaction Interface]


TendoTensei

Posts Recomendados

[24/01/2012 11:50:09] [Error - TalkAction Interface]

[24/01/2012 11:50:09] data/talkactions/scripts/creature.lua:onSay

 

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

Editado por TendoTensei
Link para o comentário
Compartilhar em outros sites

data/talkactions/scripts/creature.lua

troque por esse

 


function onSay(cid, words, param)
local func = doCreateMonster
if(words:sub(2, 2) == "n") then
func = doCreateNpc
end

local position = getCreaturePosition(cid)
local effect = CONST_ME_MAGIC_RED
if(func(param, position) == LUA_ERROR) then
effect = CONST_ME_POFF
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)
end

doSendMagicEffect(position, effect)
return TRUE
end

Editado por otal2012
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...