Postado Março 28, 2014 11 anos EU USEI ESSE SCRIPT <globalevent name="shop" interval="30" script="shop.lua"/>e nas pasta scripts, crie um arquivo chamado shop.lua e add isso dentro:-- ### 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 scriptSQL_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) thenwhile(true) doid = 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 thenlocal 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 = 0local full_weight = 0if add_item_type == 'container' thencontainer_weight = getItemWeightById(container_id, 1)if isItemRune(itemtogive_id) == TRUE thenitems_weight = container_count * getItemWeightById(itemtogive_id, 1)elseitems_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count)endfull_weight = items_weight + container_weightelsefull_weight = getItemWeightById(itemtogive_id, itemtogive_count)if isItemRune(itemtogive_id) == TRUE thenfull_weight = getItemWeightById(itemtogive_id, 1)elsefull_weight = getItemWeightById(itemtogive_id, itemtogive_count)endendlocal free_cap = getPlayerFreeCap(cid)if full_weight <= free_cap thenif add_item_type == 'container' thenlocal new_container = doCreateItemEx(container_id, 1)local iter = 0while iter ~= container_count dodoAddContainerItem(new_container, itemtogive_id, itemtogive_count)iter = iter + 1endreceived_item = doPlayerAddItemEx(cid, new_container)elselocal new_item = doCreateItemEx(itemtogive_id, itemtogive_count)received_item = doPlayerAddItemEx(cid, new_item)endif received_item == RETURNVALUE_NOERROR thendoPlayerSendTextMessage(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 .. ";")elsedoPlayerSendTextMessage(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.')endelsedoPlayerSendTextMessage(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.')endendif not(result_plr:next()) thenbreakendendresult_plr:free()endreturn TRUEend ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ AI DEU ESSE ERRO [28/3/2014 13:26:59] [Error - LuaInterface::loadFile] data/globalevents/scripts/shop.lua:100: '=' expected near '>' [28/3/2014 13:26:59] [Error - Event::checkScript] Cannot load script (data/globalevents/scripts/shop.lua) [28/3/2014 13:26:59] data/globalevents/scripts/shop.lua:100: '=' expected near '>' ALGUÉM SABE RESOLVER?
Postado Março 28, 2014 11 anos o console tá te falando exatamente aonde tá o problema e qual é o problema data/globalevents/scripts/shop.lua:100: '=' expected near '>' o problema é no script shop.lua na linha 100: era esperado um = perto de > Tentei resolver pra você mas parece que seu script tem 78 linhas, então não tem como o erro ser na linha 100. Se você editou o script antes de postar aqui, poste a versão original pra gente tentar te ajudar Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Março 28, 2014 11 anos Amigão, posta o código todo ai, se não n vai dar pra ajudar, Ta dando erro na linha 100 do seu código, vc passou 72 linhas... Não tenha medo de postar seu script, estamos aqui para ajudar.
Postado Março 28, 2014 11 anos Amigão, posta o código todo ai, se não n vai dar pra ajudar, Ta dando erro na linha 100 do seu código, vc passou 72 linhas... Não tenha medo de postar seu script, estamos aqui para ajudar.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.