Hello everybody~
I've saw a function like that many times requested before, so i thought I'll just make one myself.
It's basicly a Summon function but with a max ammount of Monsters you can just summon 2 monsters instead of as much as you want.
You should be prepared that the function need the StorageValue from 30001-30003 else it will curse errors for you.
Put the following Code on the bottom of your Global.lua
kind regards, Evil Hero
I've saw a function like that many times requested before, so i thought I'll just make one myself.
It's basicly a Summon function but with a max ammount of Monsters you can just summon 2 monsters instead of as much as you want.
You should be prepared that the function need the StorageValue from 30001-30003 else it will curse errors for you.
Put the following Code on the bottom of your Global.lua
Code:
-- Function Made by Evil Hero currently version 1.0 --
function doSummonMonster(cid, monster)
if isCreature(getPlayerStorageValue(cid, 30002)) == FALSE then
summon = doSummonCreature("".. monster .."", getPlayerPosition(cid))
doConvinceCreature(cid, summon)
setPlayerStorageValue(cid, 30002, summon)
setPlayerStorageValue(cid, 30003, summon+1)
return TRUE
elseif isCreature(getPlayerStorageValue(cid, 30001)) == FALSE then
summon = doSummonCreature("".. monster .."", getPlayerPosition(cid))
doConvinceCreature(cid, summon)
setPlayerStorageValue(cid, 30001, summon)
setPlayerStorageValue(cid, 30003, summon+1)
return TRUE
elseif isCreature((getPlayerStorageValue(cid, 30003)) == summon+2) then
doPlayerSendCancel(cid, "You can't summon more monsters!")
return FALSE
end
end
kind regards, Evil Hero