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

[HOMEPAGE] Pictures are not in shop

Maxens

Member
Joined
Apr 9, 2009
Messages
479
Reaction score
7
Location
Germany
Hello!

If i add a offer to my shop (for example VIP Medal with itemID 5785) it doesnt show the item on the page!!

EDIT: And players dont recieve their items^^ :(

Look here:

33fdziq.png


If you help me you get rep++^^
 
Last edited:
go to your data base and change the offer id of the vip medal to the number of the pic ( if vip medal is id "3" change it to id "5785")

if your players don't recieve objects just change your shop.lua, i think is the best way, rep+ is welcomed :D

edit better explained:

you have to change the offer id in z_shop or some table of shop where offers are stored and change the ID to the number of the image that you want to display. My gesior worked like that and i was like 3 hours to discover why it didn't work properly, if it's your case you got it in 10 mins xd
 
Last edited:
yep did it.. i paste in the image from google of the vip medal...named id 5785 and added it into the iamges folder where the other items are..

i try to add another item with a picture which was already in the folder...i will edit this post if something happened

The image still doesnt appear on the homepage -.-
 
click on the image you want see with 2º button of the mouse and then look just the image in navigator, you will see the path there, it depends wich navigator you use, if you use chrome, 2º button click in the last option (inspect element) and select resources and then in frames will be all the images of your web, select one and you will see the path

I think that in others navigators are 2º button of the mouse and "open image in other..." you will see just the image in the navigator and the path in the URL
 
omg xd

so change the path to you file where you got all the images or create a file called item_images and then put the images inside, and you got it

and later if it still doesn't work try to do that i explain you with the ID, but first and the most basic is to see if the route is the correct
 
Last edited:
1.Goto data/globalevents and in globalevents.xml add
Code:
<globalevent name="shop" interval="1" script="shop.lua" />

Then go to data/globalevents/scripts and create file called shop.lua and in it paste in this
Code:
-- ### 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) == TRUE 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) == TRUE 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) == TRUE 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
                    if received_item == RETURNVALUE_NOERROR then
                        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. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
                    end
                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

2.Where do you put the pictures that you want shown in the shop? & also what type are they ? [jpg,png,gif etc]
 
1. Thanks a lot! Ill try it later...! :) EDIT: Yeah the players recieve their items! dude thanks a lot <3<33

2. i was putting the pictures in EVERY folder cuz i wanted to see where to put them in but nothin happened... they're .GIF
 
Back
Top