What's new

Item shop daje nieskonczonosc item

Status
Not open for further replies.

blad

Active User
Joined
Nov 21, 2008
Messages
111
Reaction score
2
Witam, wiem ?e zak?adam zbyt du?o temat?w, ale chcia?bym si? dowiedziec dlaczego gdy kupie Item w itemshop na moim ots, to nie dostane go 1 tylko niesko?czono??. Chcia?bym, aby tylko, gdy zakupie mpa dostane 1
 

Yarech

Active User
Joined
Jul 26, 2010
Messages
117
Reaction score
10
Odp: Item shop daje nieskonczonosc item

Cze?? :)

No to musisz sobie ustawi? w DotPay jak zak?adasz na przyk?ad now? itemke za SMS.
Ja Ci tego nie opisz? dok?adnie poniewa? nie posiadam jeszcze konta na DotPay'u.

Tam gdzie? Ci powinno pisa? co? takiego chyba jak:

Czy kod ma by? jednorazowy ? (I tam wybierasz w?a?nie t? opcj?)

Pozdrawiam,
Yarech
 

Danne

User
Joined
Sep 29, 2010
Messages
16
Reaction score
4
Odp: Item shop daje nieskonczonosc item

Jak wchodzisz w Admin Shop, i Add Items, wybierasz guzik Items, i wpisujesz
Punkty,
ID przedmiotu,
Ilo??[tu wpiszesz 1],
Opis(widoczny w sms shop)
i Nazw? przedmiotu.

Regards,
Danne.
 

blad

Active User
Joined
Nov 21, 2008
Messages
111
Reaction score
2
Odp: Item shop daje nieskonczonosc item

Nie pomog?o dalej dodaje
 

Danne

User
Joined
Sep 29, 2010
Messages
16
Reaction score
4
Odp: Item shop daje nieskonczonosc item

Powiedzia? by?, jaki to przedmiot bo jest du?a ilo?? przedmiot?w kt?re mog? si? nie ko?czy?, np Manarune, Ultimate Healing Rune, Potions itd. itp.
 

Faxania

Active User
Joined
Apr 6, 2010
Messages
82
Reaction score
4
Odp: Item shop daje nieskonczonosc item

1. opcja

Punkty,
ID przedmiotu,
Ilo??[tu wpiszesz 1],
Opis(widoczny w sms shop)
i Nazw? przedmiotu.

2. opcja
zakladasz dotpay sms to wpierw wybierasz 1opcje a potem dalej i wybierasz 2opcje wtedy kod bedzie jednorazowy i zapisany do nieaktywnych w dotpay
 

blad

Active User
Joined
Nov 21, 2008
Messages
111
Reaction score
2
Odp: Item shop daje nieskonczonosc item

Nie rozumiecie, jak kupi?em MPA w moim Item Shop to przychodzi wszystko ok, ale jak mam cap to ca?y czas go dodaje. Chodzi o to, ?e mam 1000 cap to dostane tyle MPA, a? sie sko?czy cap.

M?j shop.lua, mo?e co? tu ?le

HTML:
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- time (in seconds) between connections to SQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
function onThink(interval, lastExecution)
    local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';")
    if(result_plr:getID() ~= -1) then
        while(true) do
            id = tonumber(result_plr:getDataInt("id"))
            action = tostring(result_plr:getDataString("action"))
            delete = tonumber(result_plr:getDataInt("delete_it"))
            cid = getCreatureByName(tostring(result_plr:getDataString("name")))
            if isPlayer(cid) then
                local itemtogive_id = tonumber(result_plr:getDataInt("param1"))
                local itemtogive_count = tonumber(result_plr:getDataInt("param2"))
                local container_id = tonumber(result_plr:getDataInt("param3"))
                local container_count = tonumber(result_plr:getDataInt("param4"))
                local add_item_type = tostring(result_plr:getDataString("param5"))
                local add_item_name = tostring(result_plr:getDataString("param6"))
                local received_item = 0
                local full_weight = 0
                if add_item_type == 'container' then
                    container_weight = getItemWeightById(container_id, 1)
                    if isItemRune(itemtogive_id) then
                        items_weight = container_count * getItemWeightById(itemtogive_id, 1)
                    else
                        items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count)
                    end
                    full_weight = items_weight + container_weight
                else
                    full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
                    if isItemRune(itemtogive_id) then
                        full_weight = getItemWeightById(itemtogive_id, 1)
                    else
                        full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
                    end
                end
                local free_cap = getPlayerFreeCap(cid)
                if full_weight <= free_cap then
                    if add_item_type == 'container' then
                        local new_container = doCreateItemEx(container_id, 1)
                        local iter = 0
                        while iter ~= container_count do
                            doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
                            iter = iter + 1
                        end
                        received_item = doPlayerAddItemEx(cid, new_container)
                    else
                        local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
                        received_item = doPlayerAddItemEx(cid, new_item)
                    end

                        doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.')
                        db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
                        db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
                else
                    doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')
                end
            end
            if not(result_plr:next()) then
                break
            end
        end
        result_plr:free()
    end
    return TRUE
end
 
Last edited:

Xavizou

Advanced User
Joined
Dec 26, 2009
Messages
176
Reaction score
20
Odp: Item shop daje nieskonczonosc item

Jaki? chujowy skrypt, zmie? go na ten:



btw. doda?e? linijki do bazy danych? I czy jaki? b??d wyskakuje w konsoli?
 
Last edited:

blad

Active User
Joined
Nov 21, 2008
Messages
111
Reaction score
2
Odp: Item shop daje nieskonczonosc item

Nic nie pomog?o
 
Status
Not open for further replies.
Top