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

Windows Money bug

feeniiix

New Member
Joined
Oct 31, 2013
Messages
114
Reaction score
4
need help with the money when i have 100 platium coin and klick on it be 1 cc but the 100 platium coint is still there so u can do as mutch money u want how to fix that

plx help!!
 
Last edited by a moderator:
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, 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

Action Script = Changegold.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, 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
 
yes if i click on 100 plat coints i get 1 cc but the 100 plat coints is still in my backpack so i can get how many cc i want -.-
 
use this:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if item.itemid == ITEM_GOLD_COIN and item.type == ITEMCOUNT_MAX then
     doChangeTypeItem(item.uid, item.type - item.type)
     doPlayerAddItem(cid, ITEM_PLATINUM_COIN, 1)
   elseif item.itemid == ITEM_PLATINUM_COIN and item.type == ITEMCOUNT_MAX then
     doChangeTypeItem(item.uid, item.type - item.type)
     doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, 1)
   elseif item.itemid == ITEM_PLATINUM_COIN and item.type < ITEMCOUNT_MAX then
     doChangeTypeItem(item.uid, item.type - 1)
     doPlayerAddItem(cid, ITEM_GOLD_COIN, ITEMCOUNT_MAX)
   elseif item.itemid == ITEM_CRYSTAL_COIN then
     doChangeTypeItem(item.uid, item.type - 1)
     doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
   else
     return false
   end
   return true
end
 
Ok then, Go into your action folder and move any gold changing script to a different folder that you know you will be able to find it if you need it again. and open a new notepad document and copy this in it
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == ITEM_GOLD_COIN and item.type == ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, ITEM_PLATINUM_COIN, 1)
    elseif item.itemid == ITEM_PLATINUM_COIN and item.type == ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, 1)
    elseif item.itemid == ITEM_PLATINUM_COIN and item.type < ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, ITEM_GOLD_COIN, ITEMCOUNT_MAX)
    elseif item.itemid == ITEM_CRYSTAL_COIN then
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
    else
        return FALSE
    end
    return TRUE
end

And save it as the same name you had it b4 [name here].lua
Make sure it saves as a .lua document or it won't work. If its a .txt it will not work

ALSO double click the actions.xml to open it up and double check to see that the name matches the one of the .lua file.

I do not know how your sever folders are set up other wise I would give you a more descriptive instructions on changing this, you said your a bit new to this but I do not take you as an idiot.
If you can not follow these instructions I can make a quick vid for you showing you how to change this.

If the script doesn't work in general please tell me and I can think of another way to fix your problem :)
 
Ok then, Go into your action folder and move any gold changing script to a different folder that you know you will be able to find it if you need it again. and open a new notepad document and copy this in it
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == ITEM_GOLD_COIN and item.type == ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, ITEM_PLATINUM_COIN, 1)
    elseif item.itemid == ITEM_PLATINUM_COIN and item.type == ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - item.type)
        doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, 1)
    elseif item.itemid == ITEM_PLATINUM_COIN and item.type < ITEMCOUNT_MAX then
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, ITEM_GOLD_COIN, ITEMCOUNT_MAX)
    elseif item.itemid == ITEM_CRYSTAL_COIN then
        doChangeTypeItem(item.uid, item.type - 1)
        doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
    else
        return FALSE
    end
    return TRUE
end

And save it as the same name you had it b4 [name here].lua
Make sure it saves as a .lua document or it won't work. If its a .txt it will not work

ALSO double click the actions.xml to open it up and double check to see that the name matches the one of the .lua file.

I do not know how your sever folders are set up other wise I would give you a more descriptive instructions on changing this, you said your a bit new to this but I do not take you as an idiot.
If you can not follow these instructions I can make a quick vid for you showing you how to change this.

If the script doesn't work in general please tell me and I can think of another way to fix your problem :)

Lua Script Error: [Action Interface]
data/actions/scripts/other/changegold.lua:eek:nUse
data/actions/scripts/other/changegold.lua:12: attempt to call global 'doChangeTypeItem' (a nil value)
 
Then you're not using TFS1.0 or TFS0.3.6

Check your svn again.

Or maybe the function is bugged in that release... either way, download and compile (or just download) another source
 
Back
Top