• 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!

Skrypt - item odnawiający item.

Status
Not open for further replies.

pera

Kopytko
Joined
Jul 16, 2008
Messages
24
Reaction score
0
Location
Poland - ZPP
Witam.
Czy jest ktoś, kto jest w stanie zrobić lub naprowadzić mnie na skrypt, który odnawiałby inny item (lepsze softy).
Kliknięcie na sam item czy użycie itemu na itemie do odnowienia - obojętne.
Nie może to być talkactions.

Pomoże ktoś? ;)
 
No niestety tam mam zupełnie inny skrypt z configiem i nie bardzo wiem jak go zedytować.
Bawię się w tej chwili z podobnym skryptem w actions (item dający exp).
function onUse(cid, item)
doCreatureSay(cid, "Takie it. Yours boots.", TALKTYPE_ORANGE_1)
doCreatureAddItem(item.id, 2358)
doRemoveItem(item.uid, 2157)
return true
end

Wiesz może jak go poprawnie zrobić? Może jestem blisko? ;)
Dzięki.
 
function onUse(cid, item)
doCreatureSay(cid, "Takie it. Yours boots.", TALKTYPE_ORANGE_1)
doCreatureAddItem(cid, 2358)
doRemoveItem(cid, 2157)
return true
end
cid to nasz postać wiec raczej jej dajesz i usuwasz item D:

eni znam sie na lua, napisalem co mysle D:

pewnie zle D:

a moze dobrze D:

hmm D:
 
Ok dzięki wielkie ;>
Jeszcze przydałaby się linijka zabezpieczająca, bo teraz klikając na item za każdym razem dostaje się nowe buciory, a to ma je tylko odnawiać.
Hmm, jak to zrobić?
"kiedy masz item id 2358 to możesz użyć item id 2157"?
Chyba jednak nie..

@edit
Może dodać linijke, która usunie wcześniejsze buty i da wzamian nowe jeżeli mamy item 2157?
I następną, że usunie item 2157 i doda nowy 2358 jeżeli mamy już przy sobie item 2358?

Jeżeli to by zadziałało, to jest ktoś w stanie przetłumaczyć to na lua? :)
 
Last edited:
LUA:
function onUse(cid, item)
local config = {
	wornSoftBoots = XXXX, --id of worn soft boots
	softBoots = XXXX, --id of Soft Boots
	cost = 10000
}

if getPlayerItemCount(cid, config.wornSoftBoots) >= 1 and getPlayerMoney(cid) >= config.cost then
	if(doPlayerRemoveMoney(cid, config.cost) and doPlayerRemoveItem(cid, config.wornSoftBoots, 1)) == TRUE then

	doPlayerAddItem(cid, config.softBoots, 1)

else

	doPlayerSendCancel(cid, "You need a Worn Soft Boots and " .. config.cost .. " gold coins to repair your Soft Boots.")

	end
else

	doPlayerSendCancel(cid, "You need a Worn Soft Boots and " .. config.cost .. " gold coins to repair your Soft Boots.")

	end
return true
end
 
Przerobiłem to na coś takiego
function onUse(cid, item)
local config = {
wornSoftBoots = 2157, --id of worn soft boots
softBoots = 2358, --id of Soft Boots
}

if getPlayerItemCount(cid, config.wornSoftBoots) >= then
if(doPlayerRemoveItem(cid, config.wornSoftBoots)) == TRUE then

doPlayerAddItem(cid, config.softBoots, 1)

else

doPlayerSendCancel(cid, "You need a Worn Soft Boots to repair your Soft Boots.")

end
else

doPlayerSendCancel(cid, "You need a Worn Soft Boots to repair your Soft Boots.")

end
return true
end

Niestety nie działa, nie wiem, zapewne coś przeoczyłem, ale nie spałem 2 noce, mógłby mnie ktoś poprawić?

Chcę żeby stare buty i item odnawiający znikały po jego użyciu a wzamian postać dostawała nowe.

Sory że zamulam, ale już mi trochę mózg słabo działa, a musze to skończyć jak najszybciej.
 
function onUse(cid, item)
local config = {
nugget = 2157, --id of item
bluemaster = 2358, --id of Soft Boots
bluemaster = 2358
}

if getPlayerItemCount(cid, config.bluemaster) >= 1 then
if getPlayerItemCount(cid, config.nugget) >= 1 then
if(doPlayerRemoveItem(cid, config.nugget)) == TRUE then
if(doPlayerRemoveItem(cid, config.bluemaster)) == TRUE then

doPlayerAddItem(cid, config.bluemaster, 1)

else

doPlayerSendCancel(cid, "You need a Special Nugget to repair your Boots of Bluemaster.")

end
else

doPlayerSendCancel(cid, "You need a Special Nugget to repair your Boots of Bluemaster.")

end
return true
end

Kur** zaraz mnie szlag trafi, znowu o czymś zapomniałem?
nugget to item odnawiający
bluemaster to buty.
 
Jak można powtarzać parametrt, bluemaster masz 2x .......

Do tego popatrz endy.

Ja bym to napisał inaczej, ale łap swoim sposobem xd


LUA:
function onUse(cid, item)
local config = {
	nugget = 2157, --id of item
	bluemaster = 2358
}

if getPlayerItemCount(cid, config.bluemaster) >= 1 then
	if getPlayerItemCount(cid, config.nugget) >= 1 then
		if(doPlayerRemoveItem(cid, config.nugget)) == TRUE then
			if(doPlayerRemoveItem(cid, config.bluemaster)) == TRUE then
				doPlayerAddItem(cid, config.bluemaster, 1)
			else
				doPlayerSendCancel(cid, "You need a Jakies tam gowno")
			end
		else
		doPlayerSendCancel(cid, "You need a Special Nugget to repair your Boots of Bluemaster.")
		end
	else
	doPlayerSendCancel(cid, "You need a Special Nugget to repair your Boots of Bluemaster.")
	end
else
doPlayerSendCancel(cid, "You need a Jakies tam gowno.")
end
return true
end

20:00 - Zapomniałem else, sprawdź tera.
 
Last edited:
Okej, dzięki wielkie za cierpliwość, wszystko działa :)
Lecą +

Tu już gotowy skrypt, może komuś się przyda i nie będzie się musiał jakkolwiek męczyć.

PHP:
function onUse(cid, item)
local config = {
	wornBluemaster = 2358, --id of worn soft boots
	Bluemaster = 2358, --id of Soft Boots
	nugget = 2157
}
 
if getPlayerItemCount(cid, config.wornBluemaster) >= 1 and getPlayerItemCount(cid, config.nugget) >= 1 then
	if(doPlayerRemoveItem(cid, config.nugget, 1) and doPlayerRemoveItem(cid, config.wornBluemaster, 1)) == TRUE then
 
	doPlayerAddItem(cid, config.Bluemaster, 1)
 
else
 
	doPlayerSendCancel(cid, "You need a Worn Boots of Bluemaster and Special Nugget to repair your Bluemasters.")
 
	end
else
 
	doPlayerSendCancel(cid, "You need a Worn Boots of Bluemaster and Special Nugget to repair your Bluemasters.")
 
	end
return true
end

Jeszcze raz dzięki i pozdrawiam !
 
Status
Not open for further replies.
Back
Top