The OTX VERSION Version: (1.0.X.SERIES - -)TFS version?
which of the twoNão estou disponível com as versões personalizadas do TFS
mostre-me qualquer um dos seus scripts de movimento para que eu possa ajudar
local removeSummons_system = {}
function removeSummons_system:HasSummons(cid)
if not cid then
return nil
end
local list = getCreatureSummons(cid)
if #list <= 0 then
return false
end
return true
end
function removeSummons_system:deleteSummons(cid)
if not cid then
return nil
end
local list = getCreatureSummons(cid)
for index, summon_uid in pairs(list) do
if isCreature(summon_uid) then
local pos = getCreaturePosition(summon_uid)
doSendMagicEffect(pos, CONST_ME_POFF)
doRemoveThing(summon_uid)
end
end
end
function removeSummons_system:shouldRemove(cid)
if not cid then
return nil
end
if not removeSummons_system:HasSummons(cid) then
return false
end
local pos = getCreaturePosition(cid)
if getTilePzInfo(pos) then
return true
end
return false
end
function onLogin(cid)
registerCreatureEvent(cid, "onThink_removesummons")
return true
end
function onThink(cid, interval)
if not removeSummons_system:shouldRemove(cid) then
return true
end
removeSummons_system:deleteSummons(cid)
return true
end
<event type="login" name="onLogin_removesummons" event="script" value="remove summons.lua"/>
<event type="think" name="onThink_removesummons" event="script" value="remove summons.lua"/>
unfortunately it doesn't work, and it didn't return any errorremovesummons.lua
Lua:local removeSummons_system = {} function removeSummons_system:HasSummons(cid) if not cid then return nil end local list = getCreatureSummons(cid) if #list <= 0 then return false end return true end function removeSummons_system:deleteSummons(cid) if not cid then return nil end local list = getCreatureSummons(cid) for index, summon_uid in pairs(list) do if isCreature(summon_uid) then local pos = getCreaturePosition(summon_uid) doSendMagicEffect(pos, CONST_ME_POFF) doRemoveThing(summon_uid) end end end function removeSummons_system:shouldRemove(cid) if not cid then return nil end if not removeSummons_system:HasSummons(cid) then return false end local pos = getCreaturePosition(cid) if getTilePzInfo(pos) then return true end return false end function onLogin(cid) registerCreatureEvent(cid, "onThink_removesummons") return true end function onThink(cid, interval) if not removeSummons_system:shouldRemove(cid) then return true end removeSummons_system:deleteSummons(cid) return true end
XML:<event type="login" name="onLogin_removesummons" event="script" value="remove summons.lua"/> <event type="think" name="onThink_removesummons" event="script" value="remove summons.lua"/>
Thats my proposition by using creaturescripts event
I don't understand the point of all the extra code tho xDremovesummons.lua
Lua:local removeSummons_system = {} function removeSummons_system:HasSummons(cid) if not cid then return nil end local list = getCreatureSummons(cid) if #list <= 0 then return false end return true end function removeSummons_system:deleteSummons(cid) if not cid then return nil end local list = getCreatureSummons(cid) for index, summon_uid in pairs(list) do if isCreature(summon_uid) then local pos = getCreaturePosition(summon_uid) doSendMagicEffect(pos, CONST_ME_POFF) doRemoveThing(summon_uid) end end end function removeSummons_system:shouldRemove(cid) if not cid then return nil end if not removeSummons_system:HasSummons(cid) then return false end local pos = getCreaturePosition(cid) if getTilePzInfo(pos) then return true end return false end function onLogin(cid) registerCreatureEvent(cid, "onThink_removesummons") return true end function onThink(cid, interval) if not removeSummons_system:shouldRemove(cid) then return true end removeSummons_system:deleteSummons(cid) return true end
XML:<event type="login" name="onLogin_removesummons" event="script" value="remove summons.lua"/> <event type="think" name="onThink_removesummons" event="script" value="remove summons.lua"/>
Thats my proposition by using creaturescripts event
function onLogin(cid)
registerCreatureEvent(cid, "onThink_removesummons")
return true
end
function onThink(cid, interval)
if getTilePzInfo(getCreaturePosition(cid)) == true then
local summons = getCreatureSummons(cid)
if #summons > 0 then
for i = #summons, 1, -1 do
doSendMagicEffect(getCreaturePosition(summons[i]), CONST_ME_POFF)
doRemoveThing(summons[i])
end
end
end
return true
end
I just practice for myself to make code like that for more complicated systems ^^.I don't understand the point of all the extra code tho xD
just make it like 7 lines inside of onThink
Lua:function onLogin(cid) registerCreatureEvent(cid, "onThink_removesummons") return true end function onThink(cid, interval) if getTilePzInfo(getCreaturePosition(cid)) == true then local summons = getCreatureSummons(cid) if #summons > 0 then for i = #summons, 1, -1 do doSendMagicEffect(getCreaturePosition(summons[i]), CONST_ME_POFF) doRemoveThing(summons[i]) end end end return true end