What's new

Inne Problem z czarami

Status
Not open for further replies.

Agresywny

User
Joined
May 29, 2015
Messages
18
Reaction score
0
Po wpisaniu czaru kt?ry nie dzia?a w konsoli wyskakuj? b??dy :
eug7x3.jpg


Exevo gran mas frigo
PHP:
llocal combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO)

function onGetFormulaValues(cid, level, maglevel)
	local min = level * 2 + maglevel * 5
	local max = level * 3 + maglevel * 6
	return -min, -max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)


local castleStorage, ctfStorage, dtbStorage, rushStorage = '11101', '11201', '11301', '11401'


function onCastSpell(cid, var)
	domodlib('castle_config')
	domodlib('DTB_config')
	domodlib('CTF_config')
	domodlib('config_rush_event')
	domodlib('competition_config')
	
	if getCreatureStorage(cid, castleCfg.storage.playersEvent) == 1 then
		if exhaustion.check(cid, castleStorage) ~= false then
			return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You are exhausted.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		end
	elseif (getCreatureStorage(cid, dtbConfig.blue.storage) == 1) or (getCreatureStorage(cid, dtbConfig.red.storage) == 1) then
		if exhaustion.check(cid, ctfStorage) ~= false then
			return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You are exhausted.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		end
	elseif (getCreatureStorage(cid, ctfConfig.blue.storage) == 1) or (getCreatureStorage(cid, ctfConfig.red.storage) == 1) then
		if exhaustion.check(cid, dtbStorage) ~= false then
			return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You are exhausted.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		end
	elseif tostring(getCreatureStorage(cid, compConfig.fighter)) == 'true' then
		return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You can\'t use this spell on Guild Competition War.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
	elseif tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then
		if exhaustion.check(cid, rushStorage) ~= false then
			return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You are exhausted.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		end
	end

	return doCombat(cid, combat, var), exhaustion.set(cid, castleStorage, 300), exhaustion.set(cid, ctfStorage, 20), exhaustion.set(cid, dtbStorage, 20), exhaustion.set(cid, rushStorage, 20)
end

Exevo gran mas vis
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_BIGCLOUDS)

function onGetFormulaValues(cid, level, maglevel)
	local min = level * 2 + maglevel * 5
	local max = level * 3 + maglevel * 6
	return -min, -max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)

local castleStorage, ctfStorage, dtbStorage, rushStorage = '11104', '11204', '11304', '11404'


function onCastSpell(cid, var)
	domodlib('castle_config')
	domodlib('DTB_config')
	domodlib('CTF_config')
	domodlib('config_rush_event')
	domodlib('competition_config')
	
	if getCreatureStorage(cid, castleCfg.storage.playersEvent) == 1 then
		if exhaustion.check(cid, castleStorage) ~= false then
			return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You are exhausted.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		end
	elseif (getCreatureStorage(cid, dtbConfig.blue.storage) == 1) or (getCreatureStorage(cid, dtbConfig.red.storage) == 1) then
		if exhaustion.check(cid, ctfStorage) ~= false then
			return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You are exhausted.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		end
	elseif (getCreatureStorage(cid, ctfConfig.blue.storage) == 1) or (getCreatureStorage(cid, ctfConfig.red.storage) == 1) then
		if exhaustion.check(cid, dtbStorage) ~= false then
			return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You are exhausted.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		end
	elseif tostring(getCreatureStorage(cid, compConfig.fighter)) == 'true' then
		return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You can\'t use this spell on Guild Competition War.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
	elseif tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then
		if exhaustion.check(cid, rushStorage) ~= false then
			return false, doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You are exhausted.'), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		end
	end

	return doCombat(cid, combat, var), exhaustion.set(cid, castleStorage, 300), exhaustion.set(cid, ctfStorage, 20), exhaustion.set(cid, dtbStorage, 20), exhaustion.set(cid, rushStorage, 20)
end
 

Placek

Blue Waffle
Joined
Sep 30, 2008
Messages
6,793
Reaction score
672
Age
9
Odp: Problem z czarami

Pierwszy skrypt to podales w ogole z dupy, bo nie o ten chodzi. W drugim z kolei masz mase warunkow sprawdzajacych czy czar moze byc uzyty, a nie moze na przyklad na jakims tam evencie itp. Jesli nie masz tego eventu wrzuconego na serwerze, to nie masz tez zmiennych ktorym ten event nadaje wartosc. Jednym slowem, nie ma czegos takiego jak compConfig. Masz 2 opcje, albo wywalasz calego elseifa ktory robi problemy, albo dodajesz event ktory nada odpowiednie wartosci zmiennym ktore teraz sa puste.
Jak chcesz wywalic to w przypadku tego konkretnego bledu wywal linijki 37 i 38. Mozesz tez wywalic domodlib wrzucajacy competition_config bo bedzie zbedny.
A o tym, ze ten skrypt troche z pizdy napisany, bo po chuj 3x to samo na elseifie zrobione to ja nie wiem, to juz nie wspominam ;p Ale mozna i tak.
 
Status
Not open for further replies.
Top