What's new

Przer?bka Skryptu - ograniczenie

Status
Not open for further replies.

kameleonek9509

Advanced User
Joined
Aug 31, 2008
Messages
157
Reaction score
2
Witam, znowu prosz? o pomoc, bo niestety w skryptach jestem zielony ;(
Chodzi tym razem o dodanie ograniczenia w skryptach na summony:
Code:
function onSay(cid, words, param)

	playerpos = getPlayerPosition(cid)
	mana = getPlayerMana(cid)
	vocation = getPlayerVocation(cid)
	
	if mana >= 6000 and vocation == 7 then
		if getPlayerSkill(cid,6) >= 90 then
		creature = doSummonCreature("Kiba Bunshin", playerpos)
		doConvinceCreature(cid, creature)
		doPlayerAddMana(cid, -6000)
			doPlayerSay(cid,"Juujin Bunshin",16)
		else
		doPlayerSendCancel(cid,"You do not have enough chakra control level") 
		end
	else
	doPlayerSendCancel(cid,"You can't summon this creature")
end

Czy jest to w og?le mo?liwe?
Je?li tak, to prosz? o ograniczenie summunowanych mobk?w do 2. Z g?ry dzi?kuj?!
 

Ichtio

Senior User
Joined
Dec 30, 2009
Messages
661
Reaction score
52
Odp: Przer?bka Skryptu - ograniczenie

To si? ustawia w config.lua kolego. Dok?adnie to tak
Code:
	maxPlayerSummons = 2   <--- Ile max summon?w.
	teleportAllSummons = false 
	teleportPlayerSummons = false
My?l? ?e pomog?em.



Pozdrawiam
Ichtio !
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Przer?bka Skryptu - ograniczenie

#up
Wybacz, nie pomog?e?.
PHP:
local mana = 6000
local max_summons = 2

function onSay(cid, words, param)
local summons = getCreatureSummons(cid)
if(table.maxn(summons) <= max_summons-1) then
	if getCreatureMana(cid) >= mana and getPlayerVocation(cid) == 7 then
		if getPlayerSkill(cid,6) >= 90 then
			local creature = doCreateMonster("Kiba Bunshin", getCreaturePosition(cid))
			doConvinceCreature(cid, creature)
			doPlayerAddMana(cid, -mana, false)
			doPlayerAddSpentMana(cid, -mana)
			doCreatureSay(cid, "Juujin Bunshin", 16)
		else
			doPlayerSendCancel(cid,"You do not have enough chakra control level") 
		end
	else
		doPlayerSendCancel(cid,"You can't summon this creature")
	end
else
	doPlayerSendCancel(cid,"You can't summon more creatures")
end
return true
end
 

kameleonek9509

Advanced User
Joined
Aug 31, 2008
Messages
157
Reaction score
2
Odp: Przer?bka Skryptu - ograniczenie

Oskarze, bardzo dzi?kuj? za ch?ci, niestety wywala takowy b??d:
Code:
data/talkactions/scripts/Juujin Bunshin.lua:5: attempt to call global 'getCreatureSummons' (a nil value)

Jakie? pomys?y? :D
 

Yavgaliel

Banned
Joined
Jun 11, 2009
Messages
139
Reaction score
9
Odp: Przer?bka Skryptu - ograniczenie

Nie masz tej funkcji w silniku. Albo zmie? silnik albo j? wkompiluj z innego.
 
Status
Not open for further replies.
Top