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

Rozmienianie golda

Status
Not open for further replies.

zaneria hoster

Monte :)
Joined
Oct 20, 2010
Messages
321
Reaction score
5
Witam, jak można dać exustased na rozmienianie gp na otsie? Tutaj skrypt:

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, 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
 
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition) 

local exh = 3
local storage = 34231
if(exhaustion.check(cid, storage) == true) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wolneij, musisz poczekac " .. exhaustion.get(cid, storage) .. "sekundy.")
        return 0
    end
exhaustion.set(cid, storage, exh)

    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

Tak ładniej chyba:

PHP:
local coins = {
	[ITEM_GOLD_COIN] = {
		to = ITEM_PLATINUM_COIN
	},
	[ITEM_PLATINUM_COIN] = {
		from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN
	},
	[ITEM_CRYSTAL_COIN] = {
		from = ITEM_PLATINUM_COIN
	}
}

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

local exh = 3 
local storage = 34231 
if(exhaustion.check(cid, storage) == true) then 
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Wolniej, musisz poczekac " .. exhaustion.get(cid, storage) .. "sekundy.")
        return 0 
    end 
exhaustion.set(cid, storage, exh)

	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)
	elseif(coin.from ~= nil) then
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
	end

	return true
end
 
Last edited:
Status
Not open for further replies.

Similar threads

Back
Top