enriel
Big L
Anyone that can make a script like,
if you use !summonmonk it will take a item and summon a monk for 24hours?
if you use !summonmonk it will take a item and summon a monk for 24hours?
function onSay(cid, words, param)
local pos = getPlayerPosition(cid)
local summonPos = {x=pos.x+1,y=pos.y,z=pos.z, stackpos=STACKPOS_TOP_CREATURE}
local item = XXXX
local timer = 60*60*24
if getPlayerItemCount(cid, XXXX) >= 1 then
doPlayerRemoveItem(cid, XXXX, 1)
doSummonCreature("monk", summonPos)
local summon = getThingfromPos(summonPos)
addEvent(removeSummon, timer*1000)
return TRUE
else
doPlayerSendCancel(cid, 22, "Sorry, you do not have the required item.")
return 1
end
end
function removeSummon()
local pos = getPlayerPosition(cid)
for areax = pos.x-2, pos.x+2 do
for areay = pos.y-2, pos.y+2 do
areapos = {x=areax, y=areay, z=pos.z, stackpos=STACKPOS_TOP_CREATURE}
local summon = getThingfromPos(areapos)
if isMonster(summon) == TRUE then
doRemoveCreature(summon.uid, 1)
end
end
end
end
This is as far as I could get. I failed on a proper check for summoning and desummoning the monster. I don't know if this script works at all, hehe.
PHP:function onSay(cid, words, param) local pos = getPlayerPosition(cid) local summonPos = {x=pos.x+1,y=pos.y,z=pos.z, stackpos=STACKPOS_TOP_CREATURE} local item = XXXX local timer = 60*60*24 if getPlayerItemCount(cid, XXXX) >= 1 then doPlayerRemoveItem(cid, XXXX, 1) doSummonCreature("monk", summonPos) local summon = getThingfromPos(summonPos) addEvent(removeSummon, timer*1000) return TRUE else doPlayerSendCancel(cid, 22, "Sorry, you do not have the required item.") return 1 end end function removeSummon() local pos = getPlayerPosition(cid) for areax = pos.x-2, pos.x+2 do for areay = pos.y-2, pos.y+2 do areapos = {x=areax, y=areay, z=pos.z, stackpos=STACKPOS_TOP_CREATURE} local summon = getThingfromPos(areapos) if isMonster(summon) == TRUE then doRemoveCreature(summon.uid, 1) end end end end
if getTilePzInfo(pos) == TRUE then
return FALSE
-- joke from here
else
return TRUE