• logo_cipsoft
    Nowe serwery zostały otwarte 19 Lut 2025:
    Noctalia (Open PvP) Ignitera (Open PvP) us_logo Xybra (Open PvP)

Pewien Skrypt

Status
Zamknięty.

Dblegend

Active User
Dołączył
Sierpień 12, 2008
Posty
133
Liczba reakcji
1
Witam.
Poszukuje skryptu, gdy mamy np. 20 arrow damy na nie use to zabierze nam np. 200 many i te 20 arrow, a da 5 poison arrow.
Za pomoc Reput.
 
Odp: Pewien Skrypt

Nie testowa?em, ale ten skrypt jest tak prosty, ?e na pewno zadzia?a.

local arrows = 20 - ile strza? potrzeba, aby zamieni? je na poison
local mana = 200 - ile many potrzeba
local poisonarrows = 5 - ile dostanie sie poison arrows
local idpoison = 2545 - id poison arrows (je?li masz takie samo, to nie zmieniaj, je?li nie zmie? w skrypcie oraz w actions.xml)

Actions.xml:
Kod:
<action itemid="2545" event="script" value="arrowsnapoison.lua"/>

arrowsnapoison.lua:
Kod:
function onUse(cid, item, FromPosition, itemEx, toPosition)
	[B]local arrows = 20[/B]
	[B]local mana = 200[/B]
	[B]local posionarrows = 5[/B]
	[B]local idpoison = 2545[/B]
	
	if(getPlayerItemCount(cid, item.itemid) >= arrows) then
		if(getCreatureMana(cid) >= mana) then
			doCreatureAddMana(cid, -mana)
			doPlayerRemoveItem(cid, item.itemid, arrows)
			doPlayerAddItem(cid, idpoison, poisonarrows)
		else
			doPlayerSendTextMessage(cid, 22, "Potrzebujesz "..mana..", aby zamienic strzaly na zatrute strzaly!")
			return true
		end
	else
		doPlayerSendTextMessage(cid, 22, "Potrzebujesz "..arrows.." strzal, aby je zamienic na zatrute strzaly!")
		return true
	end
	return true
end
 
Ostatnia edycja:
Odp: Pewien Skrypt

wywala blad w konsoli ze niemoze zaladowac actions/scrypts, ale niewiem czy to od tego twego skryptu, czy ja cos nagrzebalem pojawia sie napis podczas wczytywania actions
...Permission denied.
Kilka skryptow z actions niedziala wraz z twoim(reszty nie sprawdzalem)
Prosze Help.
 
Odp: Pewien Skrypt

Zmie? to:
function onUse(cid, item, FromPosition, itemEx, toPosition)
na to:
function onUse(cid, item, frompos, item2, topos)
 
Odp: Pewien Skrypt

W actions.xml zamiast tego, co ci poda?em, wrzu?:
Kod:
<action itemid="2545" script="arrowsnapoison.lua" />
 
Odp: Pewien Skrypt

wywala silnik ze funkca "getCreatureMana" niedziala
 
Odp: Pewien Skrypt

No to u?yj tego skryptu:

Kod:
function onUse(cid, item, frompos, item2, topos) 
	local arrows = 20
	local mana = 200
	local posionarrows = 5
	local idpoison = 2545
	if(getPlayerItemCount(cid, item.itemid) >= arrows) then
		if(getPlayerMana(cid) >= mana) then
			doPlayerAddMana(cid, -mana)
			doPlayerRemoveItem(cid, item.itemid, arrows)
			doPlayerAddItem(cid, idpoison, poisonarrows)
		else
			doPlayerSendTextMessage(cid, 22, "Potrzebujesz "..mana..", aby zamienic strzaly na zatrute strzaly!")
			return true
		end
	else
		doPlayerSendTextMessage(cid, 22, "Potrzebujesz "..arrows.." strzal, aby je zamienic na zatrute strzaly!")
		return true
	end
	return true
end
 
Odp: Pewien Skrypt

jest jeszcze 1 blad, jak niemam poison arrow w bp to mi nie dodaje tych 5, wogle mi nie dodaje, a arrows snikaja , ale jak mam 1 to wtedy jak dam use mam 6.
 
Ostatnia edycja:
Status
Zamknięty.
Do góry