Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Poszukuje Skryptu na zamianę kasy z cc na gold ingot (0.3.5)


Rasta666

Rekomendowane odpowiedzi

Opublikowano

Jak w tytule potrzebuję skrypciku na zamianę cc na ingota (jeśli ktoś ma cały skrypt razem z poprzednimi zamianami z golda na platyny itp to chętnie przygrnę)

Dzieki. Pozdrawiam 

Opublikowano


local cc = 2160
local goldingot = 9999

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if doRemoveItem(cid,cc,100) == true then
		doPlayerAddItem(cid,goldingot,1)
		return true
	elseif doRemoveItem(cid,goldingot,1) == true then
		doPlayerAddItem(cid,cc,100)
		return true
	end
return false
end

napisany na szybko, radze ci i tak przerobić jakiś gotowy bo ten może mieć bugi

 

tutaj łap z czystego tfsa

 

 

local coins = {
	[ITEM_GOLD_COIN] = {
		to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW
	},
	[ITEM_PLATINUM_COIN] = {
		from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE
	},
	[ITEM_CRYSTAL_COIN] = {
		from = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_TEAL
	}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
		return false
	end

	local coin = coins[item.itemid]
	if(not coin) then
		return false
	end

	if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then
		doChangeTypeItem(item.uid, item.type - item.type)
		doPlayerAddItem(cid, coin.to, 1)
		doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)
	elseif(coin.from ~= nil) then
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
		doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)
	end
	return true
end
 

 

 

Opublikowano

local cc = 2160
local goldingot = 9999

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if doRemoveItem(cid,cc,100) == true then
		doPlayerAddItem(cid,goldingot,1)
		return true
	elseif doRemoveItem(cid,goldingot,1) == true then
		doPlayerAddItem(cid,cc,100)
		return true
	end
return false
end

napisany na szybko, radze ci i tak przerobić jakiś gotowy bo ten może mieć bugi

 

tutaj łap z czystego tfsa

 

 

local coins = {
	[ITEM_GOLD_COIN] = {
		to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW
	},
	[ITEM_PLATINUM_COIN] = {
		from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE
	},
	[ITEM_CRYSTAL_COIN] = {
		from = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_TEAL
	}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
		return false
	end

	local coin = coins[item.itemid]
	if(not coin) then
		return false
	end

	if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then
		doChangeTypeItem(item.uid, item.type - item.type)
		doPlayerAddItem(cid, coin.to, 1)
		doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)
	elseif(coin.from ~= nil) then
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
		doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)
	end
	return true
end
 

 

 

 

 To co napisałeś na szybko nie działa wywala błąd :

[27/08/2016 14:48:37] Lua Script Error: [Action Interface] 

[27/08/2016 14:48:37] data/actions/scripts/other/ingot.lua:onUse
 
[27/08/2016 14:48:38] luaDoRemoveItem(). Item not found
 
 
Nie posiadasz może jakiegoś gotowca? Ja próbowałem przerobić ten podstawowy ale też nie dałem rady ;/
Dzięki za chęci:)
Opublikowano


local cc = 2160

local goldingot = 9999

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

if item.itemid == cc and doRemoveItem(cc,100) == true then

doPlayerAddItem(cid,goldingot,1)

return true

elseif item.itemid == goldingot and doRemoveItem(goldingot,1) == true then

doPlayerAddItem(cid,cc,100)

return true

end

return false

end

 

Opublikowano


local coins = {

[ITEM_GOLD_COIN] = {

to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW

},

[ITEM_PLATINUM_COIN] = {

from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE

},

[ITEM_CRYSTAL_COIN] = {

from = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_TEAL

},

[2157] = {

from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_TEAL

}

}

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then

return false

end

 

local coin = coins[item.itemid]

if(not coin) then

return false

end

 

if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then

doChangeTypeItem(item.uid, item.type - item.type)

doPlayerAddItem(cid, coin.to, 1)

doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)

elseif(coin.from ~= nil) then

doChangeTypeItem(item.uid, item.type - 1)

doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)

doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)

end

return true

end

Opublikowano
local coins = {
	[ITEM_GOLD_COIN] = {
		to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW
	},
	[ITEM_PLATINUM_COIN] = {
		from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE
	},
	[ITEM_CRYSTAL_COIN] = {
		from = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_TEAL
	},
	[2157] = {
		from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_TEAL
	}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
		return false
	end

	local coin = coins[item.itemid]
	if(not coin) then
		return false
	end

	if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then
		doChangeTypeItem(item.uid, item.type - item.type)
		doPlayerAddItem(cid, coin.to, 1)
		doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)
	elseif(coin.from ~= nil) then
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
		doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)
	end
	return true
end

Niestety nie działa :(  Próbowałem już wszystkiego najlepiej jak by ktoś podesłał cały działający :)

Ale dzięki za chęci

Opublikowano

dobra juz wiem, co bylo zle ;p

 

 

u mnie taki działa, dodaj do lib/constant

ITEM_GOLD_NUGGET = 2157

potem w actions

local coins = {
	[ITEM_GOLD_COIN] = {
		to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW
	},
	[ITEM_PLATINUM_COIN] = {
		from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE
	},
	[ITEM_CRYSTAL_COIN] = {
		from = ITEM_PLATINUM_COIN, to =  ITEM_GOLD_NUGGET, effect = TEXTCOLOR_TEAL
	},
	[ITEM_GOLD_NUGGET] = {
		from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_TEAL
	}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
		return false
	end

	local coin = coins[item.itemid]
	if(not coin) then
		return false
	end

	if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then
		doChangeTypeItem(item.uid, item.type - item.type)
		doPlayerAddItem(cid, coin.to, 1)
		doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)
	elseif(coin.from ~= nil) then
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
		doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)
	end
	return true
end

Opublikowano

 

dobra juz wiem, co bylo zle ;p

 

 

u mnie taki działa, dodaj do lib/constant

ITEM_GOLD_NUGGET = 2157

potem w actions

local coins = {
	[ITEM_GOLD_COIN] = {
		to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW
	},
	[ITEM_PLATINUM_COIN] = {
		from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE
	},
	[ITEM_CRYSTAL_COIN] = {
		from = ITEM_PLATINUM_COIN, to =  ITEM_GOLD_NUGGET, effect = TEXTCOLOR_TEAL
	},
	[ITEM_GOLD_NUGGET] = {
		from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_TEAL
	}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
		return false
	end

	local coin = coins[item.itemid]
	if(not coin) then
		return false
	end

	if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then
		doChangeTypeItem(item.uid, item.type - item.type)
		doPlayerAddItem(cid, coin.to, 1)
		doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)
	elseif(coin.from ~= nil) then
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
		doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)
	end
	return true
end

Działa  :yay:  Dzięki wielkie :)

Lecz teraz pozostaje mi zapytać jak zrobić by NPC akceptowały nową walute?;P

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...