• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Problem z duration

Status
Not open for further replies.

Kurczok

Newbie
Joined
Oct 22, 2009
Messages
497
Reaction score
4
Witam mam problem z upływam czasu w itemkach a dokładniej chciałem zrobić exp ring który by znikał po 15 min i mam problem ponieważ nie upływa czas (cały czas jest 15 min ale po prze logowaniu postaci na ringu pokazany jest już czas który realnie pozostał jednak nadal nie upływa)

Wcześniej też chciałem coś zrobić (nie pamiętam co to było) ale też miałem taki sam problem.

wpis w items.xml
PHP:
	<item id="10591" article="an" name="exp ring">
		<attribute key="weight" value="90"/>
		<attribute key="slotType" value="ring"/>
		<attribute key="decayTo" value="0"/>
		<attribute key="transformDeEquipTo" value="10592"/>
		<attribute key="duration" value="900"/>
		<attribute key="showduration" value="1"/>
	</item>
	
	<item id="10592" article="an" name="exp ring">
		<attribute key="weight" value="90"/>
		<attribute key="slotType" value="ring"/>
		<attribute key="transformEquipTo" value="10591"/>
		<attribute key="stopduration" value="1"/>
		<attribute key="showduration" value="1"/>
	</item>

w movements.xml
PHP:
	<movevent type="Equip" itemid="10591" slot="ring" event="script" value="expring.lua"/>
    <movevent type="DeEquip" itemid="10591" slot="ring" event="script" value="expring.lua"/>
    <movevent type="DeEquip" itemid="10592" slot="ring" event="script" value="expring.lua"/>
    <movevent type="Equip" itemid="10592" slot="ring" event="script" value="expring.lua"/>

i sam plik expring.lua znajdujący się w movements/scripts
PHP:
function onEquip(cid, item, slot)
doTransformItem(item.uid, 10591, 1)
doPlayerSendTextMessage(cid, 22, 'Now you have 2x extra experience!')
doPlayerSetExperienceRate(cid, 2)
return TRUE
end

function onDeEquip(cid, item, slot)
doTransformItem(item.uid, 10592, 1)
doPlayerSendTextMessage(cid, 22, 'Extra experience ended.')
doPlayerSetExperienceRate(cid, 1)


return TRUE
end

przy zakładaniu ringa 2x wyświetla komunikat

Code:
02:27 Now you have 2x extra experience!
 
Dodaj doDecayItem(item.uid) przed return TRUE do obu funkcji (Equip i DeEquip).

PS
Uwielbiam pomagać takim ludziom- konkrety, to jest to.
 
Dzięki teraz normalnie czas upływa :D

Nadal mam 2x komunikat ale poradzę sobie z tym
 
Już Ci tłumacze-

Code:
    <movevent type="Equip" itemid="10591" slot="ring" event="script" value="expring.lua"/>
    <movevent type="DeEquip" itemid="10591" slot="ring" event="script" value="expring.lua"/>
    <movevent type="DeEquip" itemid="10592" slot="ring" event="script" value="expring.lua"/>
    <movevent type="Equip" itemid="10592" slot="ring" event="script" value="expring.lua"/>

zmień kolego na (ponieważ onDeEquip powinno być tylko dla jednego, a onEquip dla drugiego itema):

Code:
    <movevent type="DeEquip" itemid="10591" slot="ring" event="script" value="expring.lua"/>
    <movevent type="Equip" itemid="10592" slot="ring" event="script" value="expring.lua"/>
 
Status
Not open for further replies.

Similar threads

Replies
0
Views
183
Back
Top