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

Sklep na dźwignie

Creesh

New Member
Joined
Jul 11, 2009
Messages
97
Reaction score
0
Location
Poland
Witam.Mam skrypt który kupuje itemy na dzwignie i mam pytanie jak zrobić żeby nie kupował w bp i żeby runki/potiony łączyły się ze sobą?

oto skrypt :

PHP:
-- Script by ErMex
local tablica = {
    [5500] = {bp = 2001, potion_lub_runa = 7620, cena = 50, sztuk = 1}, -- mana potion
    [5501] = {bp = 2001, potion_lub_runa = 7589, cena = 80, sztuk = 1}, -- strong mana potion
    [5502] = {bp = 2001, potion_lub_runa = 7590, cena = 120, sztuk = 1}, -- great mana potion
    [5503] = {bp = 2000, potion_lub_runa = 7618, cena = 45, sztuk = 1}, -- health potion
    [5504] = {bp = 2000, potion_lub_runa = 7588, cena = 100, sztuk = 1}, -- strong health potion
    [5505] = {bp = 2000, potion_lub_runa = 7591, cena = 190, sztuk = 1}, -- great health potion
    [5506] = {bp = 2000, potion_lub_runa = 8473, cena = 310, sztuk = 1}, -- ultimate health potion
    [5507] = {bp = 2002, potion_lub_runa = 2274, cena = 145, sztuk = 1}, -- avalanche
    [5508] = {bp = 2003, potion_lub_runa = 2261, cena = 115, sztuk = 1}, -- destroy field 
    [5509] = {bp = 2001, potion_lub_runa = 2313, cena = 20000, sztuk = 1}, -- explosion
    [5510] = {bp = 11236, potion_lub_runa = 2286, cena = 115, sztuk = 1}, -- fire bomb
    [5511] = {bp = 5949, potion_lub_runa = 2278, cena = 1500, sztuk = 1}, -- paralyze
    [5512] = {bp = 7342, potion_lub_runa = 8472, cena = 20000, sztuk = 1}, -- sprit potion
    [5513] = {bp = 5926, potion_lub_runa = 2268, cena = 1500, sztuk = 1}, -- SD
    [5514] = {bp = 3940, potion_lub_runa = 2273, cena = 20000, sztuk = 1}, -- UH
    [5515] = {bp = 9774, potion_lub_runa = 2293, cena = 1500, sztuk = 1}, -- magic wall
    [5516] = {bp = 10522, potion_lub_runa = 2269, cena = 1500, sztuk = 1} -- krzaki
                }
function onUse(cid, item, fromPosition, itemEx, toPosition)
local zmienna = tablica[item.actionid]
local nazwa = getItemNameById(zmienna.potion_lub_runa)
        if doPlayerRemoveMoney(cid, zmienna.cena) == TRUE then
        bag = doPlayerAddItem(cid, zmienna.bp, 1)
            doSendAnimatedText(fromPosition, "Zakupiono!", TEXTCOLOR_YELLOW)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Zakupiles Backpack of "..nazwa.." za "..zmienna.cena.." gold coin.")
            for i=1,20 do
            doAddContainerItem(bag, zmienna.potion_lub_runa, zmienna.sztuk)
            end
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Potrzebujesz "..zmienna.cena.." gold coin aby kupic backpack of "..nazwa..".")
    doSendMagicEffect(fromPosition, 2)
    return false
    end
    end
 
[5500] = {potion_lub_runa = 7620, cena = 50, sztuk = TUTAJWPISZLICZBERUNILEMABYC}, -- mana potion
i pousuwaj zmienne bp z skryptu
 
PHP:
--[[
	Rune Script 8.6
	By Bartastkd
]]--

local config = {

       [7000] = {potion = 2268, cost = 5000,}, -- sudden death rune
	[7001] = {potion = 2293, cost = 5000}, -- magic Wall rune
	[7002] = {potion = 2278, cost = 5000}, -- paralyze rune
	[7003] = {potion = 2269, cost = 10000,}, -- wild growth rune
 
	[7004] = {potion = 2305, cost = 8000,}, -- firebomb rune
	[7005] = {potion = 2274, cost = 8000,}, -- avalanche
	[7006] = {potion = 2273, cost = 8000,}, -- ultimate healing rune

   
} -- config end --
 
function onUse(cid, item, fromPosition, itemEx, toPosition)

	local potion = config[item.uid]
	if isInArray({1945, 1946}, item.itemid) ~= TRUE then

		return TRUE
	end
 

	if doPlayerRemoveMoney(cid,potion.cost) == TRUE then 
	doPlayerAddItem(cid,potion.potion,100)
	 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Zakupiles " .. getItemNameById(potion.potion) .. "") 



 	else
		doPlayerSendCancel(cid, "Nie masz kasy.")
			end
    return false
    end

Sprawdź, nie testowalem.
 
Last edited:
@up

nie działa

[Error - LuaScriptInterface::loadFile] data/actions/scripts/mshop.lua:8: '}' exp
ected (to close '{' at line 6) near '['
 
Last edited:
@up

nie działa

[Error - LuaScriptInterface::loadFile] data/actions/scripts/mshop.lua:8: '}' exp
ected (to close '{' at line 6) near '['

Zrobiłeś gdzieś błąd w configu, testowałem. Działa pięknie =]

18:54 Zakupiles ultimate healing rune.
 
Last edited:
Nie zamknales klamry, jak nie potrafisz zrozumiec tak prostych bledow to zycze Ci powodzenia :thumbup:
 
Back
Top