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

Bledy

Soul_Bullock

New Member
Joined
May 4, 2011
Messages
53
Reaction score
1
Tutaj są błędy
PHP:
[Error - LuaScriptInterface::loadFile] data/actions/scripts/other/changegold.lua:15: '}' expected (to close '{' at line 1) near 'function'
[09/06/2012 13:07:35] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/changegold.lua)
[09/06/2012 13:07:35] data/actions/scripts/other/changegold.lua:15: '}' expected (to close '{' at line 1) near 'function'
[09/06/2012 13:07:35] [Error - LuaScriptInterface::loadFile] data/actions/scripts/moje/itemseller.lua:70: 'end' expected (to close 'function' at line 66) near '<eof>'
[09/06/2012 13:07:35] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/moje/itemseller.lua)
[09/06/2012 13:07:35] data/actions/scripts/moje/itemseller.lua:70: 'end' expected (to close 'function' at line 66) near '<eof>'
[09/06/2012 13:07:35] Reloaded actions.

Skrypt 1
PHP:
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_GOLDEN_BAR, effect = TEXTCOLOR_TEAL
	},
	[ITEM_GOLDEN_BAR] = {
		from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_GREEN
}

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

Skrypt 2
PHP:
local config = { 
           		[2493] = 2500, 
				[2494] = 2500, 
				[2495] = 2500, 
				[10022] = 2500, 
				[2520] = 2500, 
				[2136] = 2500, 
				[2216] = 2500, 
				[2187] = 2500, 
				[7368] = 2500, 
				[2392] = 2500, 
				[2432] = 2500, 
				[7430] = 2500, 
				[7901] = 5000, 
				[7898] = 5000, 
				[7895] = 5000, 
				[7893] = 5000, 
				[8908] = 5000, 
				[7889] = 5000, 
				[2203] = 5000, 
				[8920] = 5000, 
				[7367] = 5000, 
				[7873] = 5000, 
				[7876] = 5000, 
				[7881] = 5000, 
				[10016] = 7500, 
				[8866] = 7500, 
				[7730] = 7500, 
				[2640] = 7500, 
				[2542] = 7500, 
				[2198] = 7500, 
				[2202] = 7500, 
				[2433] = 7500, 
				[8858] = 7500, 
				[6528] = 7500, 
				[7420] = 7500, 
				[7421] = 7500, 
				[7458] = 10000, 
				[7463] = 10000, 
				[7464] = 10000, 
				[7457] = 10000, 
				[3973] = 10000, 
				[3965] = 10000, 
				[2384] = 10000, 
				[2429] = 10000, 
				[2417] = 10000, 
				[2129] = 10000, 
				[2218] = 10000,
				[7426] = 10000, 
				[2496] = 12500, 
				[8889] = 12500, 
				[2648] = 12500, 
				[5462] = 12500, 
				[2521] = 12500, 
				[2200] = 12500, 
				[6301] = 12500, 
				[7379] = 12500, 
				[2410] = 12500, 
				[7407] = 12500,
				[7388] = 12500, 
				[7427] = 12500, 
                [3151] = 200, 
                --[itemId] = priceForEach, 
                } 

function onUse(cid, item, fromPosition, itemEx, toPosition) 
if config[itemEx.itemid] then 
    return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You sold '..getItemNameById(itemEx.itemid)..' for '..config[itemEx.itemid]..' gold coin'..(config[itemEx.itemid] > 1 and 's' or '')..'.') and doPlayerAddMoney(cid, config[itemEx.itemid]) and doRemoveItem(itemEx.uid, 1) 
end 
return false

I jednak jeszcze mały problem w 3 xD (nie znika tp) Dlaczego?
Nie ma błędu w consoli ale jednak tp nie znika po rozpoczeciu eventu, (a powinien)
PHP:
local config = {
    playerCount = 2001, -- Global storage for counting the players in the event
    maxPlayers = 15, -- Max players who can participate
 
    }
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if getGlobalStorageValue(config.playerCount) < config.maxPlayers then
        setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)+1)
        if getGlobalStorageValue(config.playerCount) == config.maxPlayers then
            doBroadcastMessage("The Zombie event is now full [" .. getGlobalStorageValue(config.playerCount) .. " players]! The event will soon start.")
        else    
            doBroadcastMessage(getPlayerName(cid) .. " entered the Zombie event! Currently " .. getGlobalStorageValue(config.playerCount) .. " players have joined!", MESSAGE_STATUS_CONSOLE_RED)
        end    
    else
        addEvent(tpBack, 1000, cid, fromPosition)
        doPlayerSendCancel(cid, "The event is full. There is already " .. config.maxPlayers .. " players participating in the quest.")
        return false
    end
    print(getStorage(config.playerCount) .. " Players in the zombie event.")
    return true
end
 
function tpBack(cid, fromPosition)
    doTeleportThing(cid, fromPosition, true)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
end

Jakieś pomysły? Co jest źle?? Obojetnie do jakiego ;p ale proszę o pomoc xD
 
changegold.lua

Lua:
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_GOLDEN_BAR, effect = TEXTCOLOR_TEAL 
    }, 
    [ITEM_GOLDEN_BAR] = { 
        from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_GREEN 
} 
}
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

itemseller.lua

Lua:
local config = {  
                   [2493] = 2500,  
                [2494] = 2500,  
                [2495] = 2500,  
                [10022] = 2500,  
                [2520] = 2500,  
                [2136] = 2500,  
                [2216] = 2500,  
                [2187] = 2500,  
                [7368] = 2500,  
                [2392] = 2500,  
                [2432] = 2500,  
                [7430] = 2500,  
                [7901] = 5000,  
                [7898] = 5000,  
                [7895] = 5000,  
                [7893] = 5000,  
                [8908] = 5000,  
                [7889] = 5000,  
                [2203] = 5000,  
                [8920] = 5000,  
                [7367] = 5000,  
                [7873] = 5000,  
                [7876] = 5000,  
                [7881] = 5000,  
                [10016] = 7500,  
                [8866] = 7500,  
                [7730] = 7500,  
                [2640] = 7500,  
                [2542] = 7500,  
                [2198] = 7500,  
                [2202] = 7500,  
                [2433] = 7500,  
                [8858] = 7500,  
                [6528] = 7500,  
                [7420] = 7500,  
                [7421] = 7500,  
                [7458] = 10000,  
                [7463] = 10000,  
                [7464] = 10000,  
                [7457] = 10000,  
                [3973] = 10000,  
                [3965] = 10000,  
                [2384] = 10000,  
                [2429] = 10000,  
                [2417] = 10000,  
                [2129] = 10000,  
                [2218] = 10000, 
                [7426] = 10000,  
                [2496] = 12500,  
                [8889] = 12500,  
                [2648] = 12500,  
                [5462] = 12500,  
                [2521] = 12500,  
                [2200] = 12500,  
                [6301] = 12500,  
                [7379] = 12500,  
                [2410] = 12500,  
                [7407] = 12500, 
                [7388] = 12500,  
                [7427] = 12500,  
                [3151] = 200,  
                --[itemId] = priceForEach,  
                }  

function onUse(cid, item, fromPosition, itemEx, toPosition)  
if config[itemEx.itemid] then  
    return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You sold '..getItemNameById(itemEx.itemid)..' for '..config[itemEx.itemid]..' gold coin'..(config[itemEx.itemid] > 1 and 's' or '')..'.') and doPlayerAddMoney(cid, config[itemEx.itemid]) and doRemoveItem(itemEx.uid, 1)  
end  
return false  
end

Co do 3 skrypta to użyj tego: http://otland.net/f82/zombie-event-new-version-bug-free-updated-128664/
 
Last edited by a moderator:
Itemseller zadziałał (za co bardzo dziękuje)
Jednak changegold nadal nie dziala ;/ (nie mam pojęcia dlaczego ;;//)
PHP:
[09/06/2012 14:42:37] [Error - Action Interface] 
[09/06/2012 14:42:37] data/actions/scripts/other/changegold.lua
[09/06/2012 14:42:37] Description: 
[09/06/2012 14:42:37] data/actions/scripts/other/changegold.lua:13: table index is nil
[09/06/2012 14:42:37] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/changegold.lua)
 
musiałeś mu tak miło powiedzieć?
teraz na tnecie mojego wykładu pewnie nawet nie przeczyta ;f
 
Back
Top