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

Pomóżcie!

Status
Not open for further replies.

own3d

Sup?
Joined
Feb 10, 2009
Messages
83
Reaction score
0
Location
Poland
Mam mały problem... chcę dodać do swojego serwera nowy typ monet (smile coin) ale jakoś mi to nie wychodzi...
smile coin ma id.9020 (wygląd vampire lord token- ma fajny smajl :) )

przerobiony skrypt w moim wykonaniu wygląda tak:
Code:
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_SMILE_COIN, effect = TEXTCOLOR_TEAL
	},
	[ITEM_SMILE_COIN] = {
		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

liczę na waszą pomoc :D
dam rep++

PS uzywam tfs 0.3.5pl1
 
w data/lib/constant.lua
musisz dodać ITEM_SMILE_COIN = 9020
 
w data/lib/constant.lua
musisz dodać ITEM_SMILE_COIN = 9020

omg rep++
jesteś boski! :D

PS:Napisalem to samo na support i.... od wczoraj kurwa czekalem, tylko jeden dzisiaj sie o cos spytal... :S
 
Status
Not open for further replies.

Similar threads

Back
Top