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

Windows Vip end.

you sent me this:

PHP:
function onThink(interval, lastExecution, thinkInterval)
	local Query = db.getResult("SELECT `id`, `vip_time` FROM `accounts` WHERE `accounts`.`vip` = 1")
	if Query:getID() == -1 then
		return true
	end
	for i = 1, Query:getRows() do
		local AccID = Query:getDataInt('id')
		local VipTime = Query:getDataInt('vip_time')
		if VipTime >= os.time() then
			db.executeQuery("UPDATE `accounts` SET `vip_days` = ".. math.ceil((VipTime - os.time()) / 86400) .." WHERE `accounts`.`id` = ".. AccID .." LIMIT 1;")
		else
			db.executeQuery("UPDATE `accounts` SET `vip_time` = 0, `vip_days` = 0, `vip` = 0 WHERE `accounts`.`id` = ".. AccID .." LIMIT 1;")
			db.executeQuery("UPDATE `players` SET `reset_temple` = 1 WHERE `players`.`account_id` = ".. AccID ..";")
		end
		Query:next()
	end
	Query:free()
	return true
end

gave this error:
PHP:
[9:40:02.714] mysql_real_query(): SELECT `id`, `vip_time` FROM `accounts` WHERE `accounts`.`vip` = 1 - MYSQL ERROR: Unknown column 'accounts.vip' in 'where clause' (1054)

all right here says I do not have a column vip.
But I really do not have this column.
i have somente a column vip_time.
will that this work?

PHP:
function onThink(interval, lastExecution, thinkInterval)
	local Query = db.getResult("SELECT `id`, `vip_time` FROM `accounts` WHERE `accounts`.`vip_time` = 0")
	if Query:getID() == -1 then
		return true
	end
	for i = 1, Query:getRows() do
		local AccID = Query:getDataInt('id')
		local VipTime = Query:getDataInt('vip_time')
		if VipTime >= os.time() then
			db.executeQuery("UPDATE `accounts` SET `vip_days` = ".. math.ceil((VipTime - os.time()) / 86400) .." WHERE `accounts`.`id` = ".. AccID .." LIMIT 1;")
		else
			db.executeQuery("UPDATE `accounts` SET `vip_time` = 0, `vip_days` = 0, `vip` = 0 WHERE `accounts`.`id` = ".. AccID .." LIMIT 1;")
			db.executeQuery("UPDATE `players` SET `reset_temple` = 1 WHERE `players`.`account_id` = ".. AccID ..";")
		end
		Query:next()
	end
	Query:free()
	return true
end
 
cyko i modified for:

PHP:
function onThink(interval, lastExecution, thinkInterval)
    local Query = db.getResult("SELECT `id`, `vip_time` FROM `accounts` WHERE `accounts`.`vip_time` = 0")
    if Query:getID() == -1 then
        return true
    end
    for i = 1, Query:getRows() do
        local AccID = Query:getDataInt('id')
        local VipTime = Query:getDataInt('vip_time')
        if VipTime >= os.time() then
            db.executeQuery("UPDATE `accounts` SET `vip_days` = ".. math.ceil((Vip_Time - os.time()) / 86400) .." WHERE `accounts`.`id` = ".. AccID .." LIMIT 1;")
        else
            db.executeQuery("UPDATE `accounts` SET `vip_time` = 0 WHERE `accounts`.`id` = ".. AccID .." LIMIT 1;")

        end
        Query:next()
    end
    Query:free()
    return true
end

no have more erros in console.
more the system no works.
 
Back
Top