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

AAC [Znote AAC] Something is wrong with my installation

alectrona94

Member
Joined
Aug 10, 2019
Messages
143
Reaction score
7
Location
Egypt
recently ive managed to try making the website, everything went fine and the website loaded but nothing in the website is working, and whenever i tries to add the it says Updated accounts: 0 database.
1567553837564.png
 
Last edited:
Solution
My guess is that there is a type in the queue that is not handled thus making it stuck. I will try to implement a repeat ... until not result.next loop this weekend, which might sort it out.

Have you tried to make a new account, purchase etc a fire sword, (nothing else) then do the !shop talkaction in depot. Does that work?
I'm gonna need more information beside "nothing in the website is working" with a photo attached showing that existing accounts has been successfully converted to Znote AAC.

What does the website look like when you visit the front page?
What happens when you register an account? How does it look like?
Which server distribution are you using?
Which serverEngine is configured in config.php?

Is there any of the above questions you don't understand and need further elaboration on?
 
Last edited:
Nothing in the website is working, whenever i press any tab on the website it doesnt work, making new accounts/logging in doesn't work, im using 0.4 tfs

1567692344862.png
 
Last edited:
Nothing in the website is working, whenever i press any tab on the website it doesnt work, making new accounts/logging in doesn't work, im using 0.4 tfs

View attachment 38890

Your layout is working, the menu is showing, the widgets are working, even the top 5 players one apparently.

What configuration do you use here in config.php? Is it TFS_03?

PHP:
$config['ServerEngine'] = 'TFS_03';
 
Last edited:
Your layout is working, the menu is showing, the widgets are working, even the top 5 players one apparently.

What configuration do you use here in config.php? Is it TFS_03?

PHP:
$config['ServerEngine'] = 'TFS_03';
oh okay thats because i didnt change the engine to _03, okay so ive made everything and the shop system but once i say !shop i get this error in the console
1567699587247.png
 
Yeah, correct serverEngine configuration in config.php tend to make or break things. :)

oh okay thats because i didnt change the engine to _03, okay so ive made everything and the shop system but once i say !shop i get this error in the console
View attachment 38902

Your server probably doesn't support mounts.

Remove this piece from your znoteshop.lua file:
Lua:
-- ORDER TYPE 6 (Mounts)
if q_type == 6 then
	-- Make sure player don't already have this outfit and addon
	if not getPlayerMount(cid, q_itemid) then -- Failed to find a proper hasMount 0.3 function?
		db.executeQuery("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
		doPlayerAddMount(cid, q_itemid)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have received a new mount!")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You already have this mount!")
	end
end

And remove type 6 shop offers from config.php so people don't accidentally purchase mounts:
 
I did that the error in the console has been removed, but no action is taken in the game when i type !shop :s
Lua:
-- Znote Shop v1.0 for Znote AAC on TFS 0.3.6+ Crying Damson.
function onSay(cid, words, param)
    local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks.
    local cooldown = 15 -- in seconds.
    
    if getPlayerStorageValue(cid, storage) <= os.time() then
        setPlayerStorageValue(cid, storage, os.time() + cooldown)
        local accid = getAccountNumberByPlayerName(getCreatureName(cid))
        
        -- Create the query
        local orderQuery = db.storeQuery("SELECT `id`, `type`, `itemid`, `count` FROM `znote_shop_orders` WHERE `account_id` = " .. accid .. " LIMIT 1;")
        
        -- Detect if we got any results
        if orderQuery ~= false then
            -- Fetch order values
            local q_id = result.getDataInt(orderQuery, "id")
            local q_type = result.getDataInt(orderQuery, "type")
            local q_itemid = result.getDataInt(orderQuery, "itemid")
            local q_count = result.getDataInt(orderQuery, "count")
            result.free(orderQuery)
            -- ORDER TYPE 1 (Regular item shop products)
            if q_type == 1 then
                -- Get wheight
                local playerCap = getPlayerFreeCap(cid)
                local itemweight = getItemWeightById(q_itemid, q_count)
                    if playerCap >= itemweight and getTileInfo(getCreaturePosition(cid)).protection then
                        --backpack check
                        local backpack = getPlayerSlotItem(cid, 3)
                        local gotItem = false
                        if(backpack and backpack.itemid > 0) then
                            local received = doAddContainerItem(getPlayerSlotItem(cid, 3).uid, q_itemid,q_count)
                            if(received ~= false) then
                                db.executeQuery("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
                                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have recieved ".. q_count .." "..getItemNameById(q_itemid).."(s)!")
                                gotItem = true
                            end
                        end

                        if(not gotItem) then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have no available space in backpack to receive that item.")
                        end                       
                    else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Need more CAP and Need ProtectZone!")
                    end
            end
            -- ORDER TYPE 5 (Outfit and addon)
            if q_type == 5 then
                -- Make sure player don't already have this outfit and addon
                if not canPlayerWearOutfit(cid, q_itemid, q_count) then
                    db.executeQuery("DELETE FROM `znote_shop_orders` WHERE `id` = " .. q_id .. ";")
                    doPlayerAddOutfit(cid,q_itemid,q_count)
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have received a new outfit!")
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You already have this outfit and addon!")
                end
            end

            
            -- Add custom order types here
            -- Type 1 is for itemids (Already coded here)
            -- Type 2 is for premium (Coded on web)
            -- Type 3 is for gender change (Coded on web)
            -- Type 4 is for character name change (Coded on web)
            -- Type 5 is for character outfit and addon (Already coded here)
            -- So use type 7+ for custom stuff, like etc packages.
            -- if q_type == 7 then
            -- end
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have no orders.")
        end
        
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Can only be executed once every "..cooldown.." seconds. Remaining cooldown: ".. getPlayerStorageValue(cid, storage) - os.time())
    end
    return false
end
 
Last edited by a moderator:
My guess is that there is a type in the queue that is not handled thus making it stuck. I will try to implement a repeat ... until not result.next loop this weekend, which might sort it out.

Have you tried to make a new account, purchase etc a fire sword, (nothing else) then do the !shop talkaction in depot. Does that work?
 
Solution
@alectrona94 I have now released updated version of the shop scripts:

Let me know how they work, I have only tested the TFS 1.0 version, would be good if you could tell me if the TFS 0.3 version is working as well.
 
Oh Okay thanks for that i test it and give you my feedback and btw the old one worked

I found an issue with the old one:

1. Purchase gender or character name change.
2. Purchase itemid, like fire sword.
3. !shop talkaction to get item won't work until you use up the character name and gender change.

Latest version fixes that.
 
Back
Top