vagnerkuntz
New Member
- Joined
- Jun 1, 2012
- Messages
- 45
- Reaction score
- 0
Personal Hello can anyone help me in this script
the error that is giving is that messages do not stop is out several eg if u already have the skill can not be more there is a charge up the msg ...
and here's the mistake that happens in GlobalEvents
[Error - GlobalEvents:
nThink] Couldn't execute event: shop
here the script
the error that is giving is that messages do not stop is out several eg if u already have the skill can not be more there is a charge up the msg ...
and here's the mistake that happens in GlobalEvents
[Error - GlobalEvents:
here the script
SQL_interval = 30
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 add_item_type = tostring(result_plr:getDataString("param5"))
local add_item_name = tostring(result_plr:getDataString("param6"))
if getPlayerStorageValue(cid, itemtogive_id) == 1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você não pode adquirir a mesma skill 2x!!!')
db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
return FALSE
end
if add_item_type == 'item' then
if getPlayerStorageValue(cid, itemtogive_id) == 0 then
setPlayerStorageValue(cid, itemtogive_id, itemtogive_count)
doSendMagicEffect(getCreaturePos(cid), 65)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você acaba de receber a Special Skill '.. add_item_name ..' do FoxWorld 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, MESSAGE_STATUS_CONSOLE_RED, '>> '.. 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
end
end
if not(result_plr:next()) then
break
end
result_plr:free()
end
end
return TRUE
end
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 add_item_type = tostring(result_plr:getDataString("param5"))
local add_item_name = tostring(result_plr:getDataString("param6"))
if getPlayerStorageValue(cid, itemtogive_id) == 1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você não pode adquirir a mesma skill 2x!!!')
db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
return FALSE
end
if add_item_type == 'item' then
if getPlayerStorageValue(cid, itemtogive_id) == 0 then
setPlayerStorageValue(cid, itemtogive_id, itemtogive_count)
doSendMagicEffect(getCreaturePos(cid), 65)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você acaba de receber a Special Skill '.. add_item_name ..' do FoxWorld 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, MESSAGE_STATUS_CONSOLE_RED, '>> '.. 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
end
end
if not(result_plr:next()) then
break
end
result_plr:free()
end
end
return TRUE
end
Last edited: