Senzu

Status
Zamknięty.

muiosh997

Active User
Zarejestrowany
Dołączył
Maj 30, 2009
Posty
74
Liczba reakcji
7
Witam ,tworz? (mam zamiar) stworzy? dragon ball otsa od 0! i podczas testowania senzu wyskakuje mi b??d.


function onUse(cid, item, frompos, item2, topos)
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local exhausted_seconds = 1
local exhausted_storagevalue = 7480
local mana_minimum = 70000
local mana_maximum = 70000
local mana_add = math.random(mana_minimum, mana_maximum)
if(item.type >= 100) then
if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
if(isPlayer(cid) == 1) then
doSendMagicEffect(topos,12)
doPlayerAddMana(cid, mana_add)
doPlayerAddHealth(cid, mana_add)
doPlayerSay(cid,":)",1)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doChangeTypeItem(item.uid, item.type - 0)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exchausted.")
end
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted.")
end
else
if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted.")
else
if(isPlayer(cid) == 1) then
doSendMagicEffect(topos,12)
doPlayerAddMana(cid, mana_add)
doPlayerAddHealth(cid, mana_add*1.5)
doPlayerSay(cid,"I feel the best",1)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doRemoveItem(item.uid, 1)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exchausted.")
end
end
end
return 1
end

?le co? ze skryptem?
 
Odp: Senzu

PHP:
function onUse(cid, item, frompos, item2, topos)
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local exhausted_seconds = 1
local exhausted_storagevalue = 7480
local mana_minimum = 70000
local mana_maximum = 70000
local mana_add = math.random(mana_minimum, mana_maximum)
if(item.type >= 100) then
if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
if(isPlayer(cid) == 1) then
doSendMagicEffect(topos,12)
doPlayerAddMana(cid, mana_add)
doPlayerAddHealth(cid, mana_add)
doPlayerSay(cid,":)",1)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doChangeTypeItem(item.uid, item.type - 0)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exchausted.")
end
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted.")
end
else
if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted.")
else
if(isPlayer(cid) == 1) then
local mana_add2 = mana_add*1.5
doSendMagicEffect(topos,12)
doPlayerAddMana(cid, mana_add)
doPlayerAddHealth(cid, mana_add2)
doPlayerSay(cid,"I feel the best",1)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doRemoveItem(item.uid, 1)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exchausted.")
end
end
end
return 1
end

Nie mo?na wykonywa? oblicze? w funkcji. Doda?em zmienn? mana_add2 i pod ni? podpisa?em mana_add*1.5.
 
Ostatnia edycja:
Odp: Senzu

@up
-.-
@topic
PHP:
doPlayerAddMana
Tw?j TFS nie posiada takiej funkcji, spr?buj zamieni? na
PHP:
doCreatureAddMana
lub poszukaj w ?r?d?ach.
 
Odp: Senzu

34 linijka tyczy si? doPlayerAddHealth, a nie doPlayerAddMana. :confused:
Btw. funkcja doPlayerAddHealth pojawi?a si? ju? wcze?niej w kodzie i silnik nie wysypa? ?adnego b??du.
 
Odp: Senzu

wie kto? jak doda? do red senzu exhausted?
 
Odp: Senzu

Twoj silnik nie ma wbudowanej funkcji
doPlayerAddHealth
musisz u?y?
doCreatureAddHealth
a co do exhausted
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions')))
doAddCondition(cid, exhaust)
?ap, tak to powinno wygl?dac
function onUse(cid, item, frompos, item2, topos)
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions')))
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local exhausted_seconds = 1
local exhausted_storagevalue = 7480
local mana_minimum = 70000
local mana_maximum = 70000
local mana_add = math.random(mana_minimum, mana_maximum)
if(item.type >= 100) then
if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
if(isPlayer(cid) == 1) then
doSendMagicEffect(topos,12)
doPlayerAddMana(cid, mana_add)
doCreatureAddHealth(cid, mana_add)
doPlayerSay(cid,":)",1)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doChangeTypeItem(item.uid, item.type - 0)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exchausted.")
end
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted.")
end
else
if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted.")
else
if(isPlayer(cid) == 1) then
local mana_add2 = mana_add*1.5
doSendMagicEffect(topos,12)
doPlayerAddMana(cid, mana_add)
doPlayerAddHealth(cid, mana_add2)
doPlayerSay(cid,"I feel the best",1)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doRemoveItem(item.uid, 1)
doAddCondition(cid, exhaust)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exchausted.")
end
end
end
return 1
end
 
Status
Zamknięty.
Back
Do góry