Apitov
Man With The Plan
As the title says could someone give me a hand or point me into the direction of a script like this, I searched my ass off and still couldnt find anything lol.
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 and item.uid == 5000 then
doSummonCreature(cid, "Demon", pos)
else
doPlayerSendCancel(cid, "Error.")
end
end
Lua:function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == 1945 and item.uid == 5000 then doSummonCreature(cid, "Demon", pos) else doPlayerSendCancel(cid, "Error.") end end
function onUse(cid, item, fromPosition, itemEx, toPosition)
demon1pos = {x=XXX, y=XXX, z=XXX}
demon2pos = {x=XXX, y=XXX, z=XXX}
demon3pos = {x=XXX, y=XXX, z=XXX}
demon4pos = {x=XXX, y=XXX, z=XXX}
demon5pos = {x=XXX, y=XXX, z=XXX}
demon6pos = {x=XXX, y=XXX, z=XXX}
if item.itemid == 1945 and item.uid == 5000 then
doSummonCreature("Demon", demon1pos)
doSummonCreature("Demon", demon2pos)
doSummonCreature("Demon", demon3pos)
doSummonCreature("Demon", demon4pos)
doSummonCreature("Demon", demon5pos)
doSummonCreature("Demon", demon6pos)
else
doPlayerSendCancel(cid, "Error.")
end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local demonPos =
{
{x=XXX, y=XXX, z=XXX},
{x=XXX, y=XXX, z=XXX},
{x=XXX, y=XXX, z=XXX},
{x=XXX, y=XXX, z=XXX},
{x=XXX, y=XXX, z=XXX},
{x=XXX, y=XXX, z=XXX}
}
if item.itemid == 1945 and item.uid == 5000 then
for i = 1, table.maxn(demonPos) do
doSummonCreature("Demon", demonPos[i])
end
else
doPlayerSendCancel(cid, "Error.")
end
end
-- by Shawak
monster = "Demon" -- monster that will be summon
minutes = 1 -- exhaust minutes
item_uid_id = ITEM.UID ID -- item.uid ID of the switch
monster_pos = { -- position where the monster will be summon
x=xxx,
y=yyy,
z=z
}
function changeSwitch()
doTransformItem(item.uid, 1945)
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 and item.uid == item_uid_id then
doSummonCreature(monster, monster_pos)
doTransformItem(item.uid, 1946)
addEvent(changeSwitch, minutes * 60 * 1000, cid)
else
doPlayerSendCancel(cid, "Please Wait.")
end
return TRUE
end
You want exhausted?
Try this one..
Lua:-- by Shawak monster = "Demon" -- monster that will be summon minutes = 1 -- exhaust minutes item_uid_id = ITEM.UID ID -- item.uid ID of the switch monster_pos = { -- position where the monster will be summon x=xxx, y=yyy, z=z } function changeSwitch() doTransformItem(item.uid, 1945) return TRUE end function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == 1945 and item.uid == item_uid_id then doSummonCreature(monster, monster_pos) doTransformItem(item.uid, 1946) addEvent(changeSwitch, minutes * 60 * 1000, cid) else doPlayerSendCancel(cid, "Please Wait.") end return TRUE end
NOT testet.
Regards,
Shawak
You want exhausted?
Try this one..
Lua:-- by Shawak monster = "Demon" -- monster that will be summon minutes = 1 -- exhaust minutes item_uid_id = ITEM.UID ID -- item.uid ID of the switch monster_pos = { -- position where the monster will be summon x=xxx, y=yyy, z=z } function changeSwitch() doTransformItem(item.uid, 1945) return TRUE end function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == 1945 and item.uid == item_uid_id then doSummonCreature(monster, monster_pos) doTransformItem(item.uid, 1946) addEvent(changeSwitch, minutes * 60 * 1000, cid) else doPlayerSendCancel(cid, "Please Wait.") end return TRUE end
NOT testet.
Regards,
Shawak
function onUse(cid, item, fromPosition, itemEx, toPosition)
local demonPos =
{
{x=XXX, y=XXX, z=XXX},
{x=XXX, y=XXX, z=XXX},
{x=XXX, y=XXX, z=XXX},
{x=XXX, y=XXX, z=XXX},
{x=XXX, y=XXX, z=XXX},
{x=XXX, y=XXX, z=XXX}
}
dofile(getDataDir() .. "lib/exhaustion.lua")
if item.itemid == 1945 and item.uid == 5000 and exhaustion.check(cid, STORAGE ID YOU WANT) == FALSE then
for i = 1, table.maxn(demonPos) do
doSummonCreature("Demon", demonPos[i])
end
exhaustion.set(cid,STORAGE ID,1) // The number 1 is the second you want for the exhaust right now is set for 1 second
else
doPlayerSendCancel(cid, "Error.")
end
end
And what is so dramatic if I use a AddEvent function?
It's the same.