Ir para conteúdo

Featured Replies

Postado

Olá ao executar a talkactions /tour  aparece o seguinte erro:

 

errotalk.png

 

Segue os seguintes scripts acima mencionado:

 

011-string.lua Na linha 43: tmp = str:sub(pos):trim()

 

string.explode = function (str, sep, limit)
	if(type(sep) ~= 'string' or isInArray({tostring(str):len(), sep:len()}, 0)) then
		return {}
	end

	local i, pos, tmp, t = 0, 1, "", {}
	for s, e in function() return string.find(str, sep, pos) end do
		tmp = str:sub(pos, s - 1):trim()
		table.insert(t, tmp)
		pos = e + 1

		i = i + 1
		if(limit ~= nil and i == limit) then
			break
		end
	end

	tmp = str:sub(pos):trim()
	table.insert(t, tmp)
	return t
end

 

Tour.lua Na linha 46: local playerstring = string.explode(getGlobalStorageValue(listsubscribe), ",") 

 

local playerduel = 223023 -- playerstorage
local subscribe = 223024 -- playerstorage 
local enabledtour = 223025 -- globalstorage
local listsubscribe = 223026 -- globalstorage
local countsubscribe = 223027 -- globalstorage
local start = 223028 -- globalstorage
local goldsub = 223029 -- globalstorage
local silversub = 223030 -- globalstorage
local bronzesub = 223031 -- globalstorage
local gold = 1
local silver = 2
local bronze = 3
function onSay(cid, words, param, frompos)

        --local players = getPlayersOnline()
      
		if getGlobalStorageValue(enabledtour) <= 0 then
return doPlayerSendTextMessage(cid,22,"Não está tendo evento.")
end

local modalidade = getGlobalStorageValue(enabledtour)
local frasemod = "Bronze"
if modalidade == gold then
frasemod = "Gold"
elseif modalidade == silver then
frasemod = "Silver"
end

		local playerstring = string.explode(getGlobalStorageValue(listsubscribe), ",") 
		local subscribes = getGlobalStorageValue(countsubscribe)
		  local xxs = "Numero de Inscritos "..subscribes.." \nCategoria : "..frasemod.."\n"
		 xxs = xxs .."C = Classificado\nB = Batalhando\nA = Aguardando\n\n"


 for _, pid in ipairs(playerstring) do
 local player = getPlayerByName(pid)
 if isPlayer(player) then
if getPlayerStorageValue(player,subscribe) >= 1 and getPlayerStorageValue(player,playerduel) >= 1 then
xxs = xxs .."[".. getCreatureName(player) .. "][C] [B] [on] lv = "..getPlayerLevel(player).."\n"
end
if getPlayerStorageValue(player,subscribe) >= 1 and getPlayerStorageValue(player,playerduel) <= 0 then
xxs = xxs .."[".. getCreatureName(player) .. "][C][A] [on] lv = "..getPlayerLevel(player).."\n"
end
else
xxs = xxs .."[".. pid .. "][OFFLINE] \n"
end

end
doShowTextDialog(cid, 2501,  xxs)
return true

end

 

 

REP+ sem duvidar! agradeço desde já.

  • Respostas 10
  • Visualizações 505
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Diretor
15 minutos atrás, Mikhael disse:

Olá ao executar a talkactions /tour  aparece o seguinte erro:

 

errotalk.png

 

Segue os seguintes scripts acima mencionado:

 

011-string.lua Na linha 43: tmp = str:sub(pos):trim()

 


string.explode = function (str, sep, limit)
	if(type(sep) ~= 'string' or isInArray({tostring(str):len(), sep:len()}, 0)) then
		return {}
	end

	local i, pos, tmp, t = 0, 1, "", {}
	for s, e in function() return string.find(str, sep, pos) end do
		tmp = str:sub(pos, s - 1):trim()
		table.insert(t, tmp)
		pos = e + 1

		i = i + 1
		if(limit ~= nil and i == limit) then
			break
		end
	end

	tmp = str:sub(pos):trim()
	table.insert(t, tmp)
	return t
end

 

Tour.lua Na linha 46: local playerstring = string.explode(getGlobalStorageValue(listsubscribe), ",") 

 


local playerduel = 223023 -- playerstorage
local subscribe = 223024 -- playerstorage 
local enabledtour = 223025 -- globalstorage
local listsubscribe = 223026 -- globalstorage
local countsubscribe = 223027 -- globalstorage
local start = 223028 -- globalstorage
local goldsub = 223029 -- globalstorage
local silversub = 223030 -- globalstorage
local bronzesub = 223031 -- globalstorage
local gold = 1
local silver = 2
local bronze = 3
function onSay(cid, words, param, frompos)

        --local players = getPlayersOnline()
      
		if getGlobalStorageValue(enabledtour) <= 0 then
return doPlayerSendTextMessage(cid,22,"Não está tendo evento.")
end

local modalidade = getGlobalStorageValue(enabledtour)
local frasemod = "Bronze"
if modalidade == gold then
frasemod = "Gold"
elseif modalidade == silver then
frasemod = "Silver"
end

		local playerstring = string.explode(getGlobalStorageValue(listsubscribe), ",") 
		local subscribes = getGlobalStorageValue(countsubscribe)
		  local xxs = "Numero de Inscritos "..subscribes.." \nCategoria : "..frasemod.."\n"
		 xxs = xxs .."C = Classificado\nB = Batalhando\nA = Aguardando\n\n"


 for _, pid in ipairs(playerstring) do
 local player = getPlayerByName(pid)
 if isPlayer(player) then
if getPlayerStorageValue(player,subscribe) >= 1 and getPlayerStorageValue(player,playerduel) >= 1 then
xxs = xxs .."[".. getCreatureName(player) .. "][C] [B] [on] lv = "..getPlayerLevel(player).."\n"
end
if getPlayerStorageValue(player,subscribe) >= 1 and getPlayerStorageValue(player,playerduel) <= 0 then
xxs = xxs .."[".. getCreatureName(player) .. "][C][A] [on] lv = "..getPlayerLevel(player).."\n"
end
else
xxs = xxs .."[".. pid .. "][OFFLINE] \n"
end

end
doShowTextDialog(cid, 2501,  xxs)
return true

end

 

 

REP+ sem duvidar! agradeço desde já.

 

 

string.split = function (str)
    local t = {}
    return not str:gsub("%w+", function(s) table.insert(t, s) return "" end):find("%S") and t or {}
end

string.trim = function (str)
    return str:gsub("^%s*(.-)%s*$", "%1")
end

string.explode = function (str, sep, limit)
    if(type(sep) ~= 'string' or isInArray({tostring(str):len(), sep:len()}, 0)) then
        return {}
    end

    local i, pos, tmp, t = 0, 1, "", {}
    for s, e in function() return string.find(str, sep, pos) end do
        tmp = str:sub(pos, s - 1):trim()
        table.insert(t, tmp)
        pos = e + 1

        i = i + 1
        if(limit ~= nil and i == limit) then
            break
        end
    end

    tmp = str:sub(pos):trim()
    table.insert(t, tmp)
    return t
end

string.expand = function (str)
    return string.gsub(str, "$(%w+)", function(n) return _G[n] end)
end

string.timediff = function (diff)
    local format = {
        {"week", diff / 60 / 60 / 24 / 7},
        {"day", diff / 60 / 60 / 24 % 7},
        {"hour", diff / 60 / 60 % 24},
        {"minute", diff / 60 % 60},
        {"second", diff % 60}
    }

    local t = {}
    for k, v in ipairs(format) do
        local d, tmp = math.floor(v[2]), ""
        if(d > 0) then
            tmp = (k < table.maxn(format) and (table.maxn(t) > 0 and ", " or "") or " and ") .. d .. " " .. v[1] .. (d ~= 1 and "s" or "")
            table.insert(t, tmp)
        end
    end

    return t
end

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Postado
  • Autor
1 minuto atrás, Alexy Brocanello disse:

 

 

 

string.split = function (str)
    local t = {}
    return not str:gsub("%w+", function(s) table.insert(t, s) return "" end):find("%S") and t or {}
end

string.trim = function (str)
    return str:gsub("^%s*(.-)%s*$", "%1")
end

string.explode = function (str, sep, limit)
    if(type(sep) ~= 'string' or isInArray({tostring(str):len(), sep:len()}, 0)) then
        return {}
    end

    local i, pos, tmp, t = 0, 1, "", {}
    for s, e in function() return string.find(str, sep, pos) end do
        tmp = str:sub(pos, s - 1):trim()
        table.insert(t, tmp)
        pos = e + 1

        i = i + 1
        if(limit ~= nil and i == limit) then
            break
        end
    end

    tmp = str:sub(pos):trim()
    table.insert(t, tmp)
    return t
end

string.expand = function (str)
    return string.gsub(str, "$(%w+)", function(n) return _G[n] end)
end

string.timediff = function (diff)
    local format = {
        {"week", diff / 60 / 60 / 24 / 7},
        {"day", diff / 60 / 60 / 24 % 7},
        {"hour", diff / 60 / 60 % 24},
        {"minute", diff / 60 % 60},
        {"second", diff % 60}
    }

    local t = {}
    for k, v in ipairs(format) do
        local d, tmp = math.floor(v[2]), ""
        if(d > 0) then
            tmp = (k < table.maxn(format) and (table.maxn(t) > 0 and ", " or "") or " and ") .. d .. " " .. v[1] .. (d ~= 1 and "s" or "")
            table.insert(t, tmp)
        end
    end

    return t
end

 

 

 

 

Onde adicionaria esse code ?

 

 

 

 

 

Postado
  • Diretor
4 minutos atrás, Mikhael disse:

 

 

 

Onde adicionaria esse code ?

 

 

 

 

 

011-string.lua paga o seu e bote esse

Editado por Alexy Brocanello (veja o histórico de edições)

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo