Ir para conteúdo
  • Cadastre-se

[Resolvido] Comando Frags


Posts Recomendados

Estou precizando de um comando !frags baixei um mapa aqui e nao veio esse comando kk,mais tem que ser aquele que da pra ve quanto mato e tals qual dos outros Ots normalmenti Vlw Obrigado.

Link para o post
Compartilhar em outros sites

tenta esse:

local config = {

useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),

advancedFragList = getBooleanFromString(getConfigValue('advancedFragList'))

}



function onSay(cid, words, param, channel)

if(not config.useFragHandler) then

return false

end



local time = os.time()

local times = {today = (time - 86400), week = (time - (7 * 86400))}



local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")

if(result:getID() ~= -1) then

repeat

local content = {

name = result:getDataString("name"),

level = result:getDataInt("level"),

date = result:getDataInt("date")

}

if(content.date > times.today) then

table.insert(contents.day, content)

elseif(content.date > times.week) then

table.insert(contents.week, content)

else

table.insert(contents.month, content)

end

until not result:next()

result:free()

end



local size = {

day = table.maxn(contents.day),

week = table.maxn(contents.week),

month = table.maxn(contents.month)

}

if(config.advancedFragList) then

local result = "Frags de hoje: " .. size.day .. ".   Red skull= 5.  Black Skull= 7."

if(size.day > 0) then

for _, content in ipairs(contents.day) do

result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

end



result = result .. "\n"

end



result = result .. "\nFrags na semana: " .. (size.day + size.week) .. ".   Red Skull= 15.  Black Skull= 20."

if(size.week > 0) then

for _, content in ipairs(contents.week) do

result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

end



result = result .. "\n"

end



result = result .. "\nFrags no mes: " .. (size.day + size.week + size.month) .. ".   Red Skull= 25.  Black Skull= 30."

if(size.month > 0) then

for _, content in ipairs(contents.month) do

result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

end



result = result .. "\n"

end



local skullEnd = getPlayerSkullEnd(cid)

if(skullEnd > 0) then

result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)

end



doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, result)

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")

if(size.day > 0) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")

end



local skullEnd = getPlayerSkullEnd(cid)

if(skullEnd > 0) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))

end

end



return true

end

vodkart

Link para o post
Compartilhar em outros sites

Cara tem muitos Tutoriais no Google no Tibiaking só procurar, 

acho que não era preciso um tópico novo assim rsr

 

Mais se o do Daaniel não funcionar eu te passo o meu 

Link para o post
Compartilhar em outros sites

@ Daniel eu usei ess script que vc passo e deu esse erro na executavel mais lembrando o comando nao Funfo

 

 

[01/08/2013 21:37:27] Lua Script Error: [TalkAction Interface] 

[01/08/2013 21:37:27] data/talkactions/scripts/frags.lua
 
[01/08/2013 21:37:27] data/lib/function.lua:436: attempt to index local 'str' (a nil value)
[01/08/2013 21:37:27] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/frags.lua)
 
[01/08/2013 21:37:27] Reloaded talk actions.
 

 

@Tonyhalk

Rs eu poderia ate tentar ta ligado mais como eu usei umas script de frags que eu tinha e nao deu certo entao resolvi pedi ajuda aqui né

Link para o post
Compartilhar em outros sites

tenta:

local config = {

	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),

	advancedFragList = getBooleanFromString(getConfigValue('advancedFragList'))

}



function onSay(cid, words, param, channel)

	if(not config.useFragHandler) then

		return false

	end



	local time = os.time()

	local times = {today = (time - 86400), week = (time - (7 * 86400))}



	local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")

	if(result:getID() ~= -1) then

		repeat

			local content = {

				name = result:getDataString("name"),

				level = result:getDataInt("level"),

				date = result:getDataInt("date")

			}

			if(content.date > times.today) then

				table.insert(contents.day, content)

			elseif(content.date > times.week) then

				table.insert(contents.week, content)

			else

				table.insert(contents.month, content)

			end

		until not result:next()

		result:free()

	end



	local size = {

		day = table.maxn(contents.day),

		week = table.maxn(contents.week),

		month = table.maxn(contents.month)

	}

	if(config.advancedFragList) then

		local result = "Frags gained today: " .. size.day .. "."

		if(size.day > 0) then

			for _, content in ipairs(contents.day) do

				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

			end



			result = result .. "\n"

		end



		result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."

		if(size.week > 0) then

			for _, content in ipairs(contents.week) do

				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

			end



			result = result .. "\n"

		end



		result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."

		if(size.month > 0) then

			for _, content in ipairs(contents.month) do

				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

			end



			result = result .. "\n"

		end



		local skullEnd = getPlayerSkullEnd(cid)

		if(skullEnd > 0) then

			result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)

		end



		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, result)

	else

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")

		if(size.day > 0) then

			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")

		end



		local skullEnd = getPlayerSkullEnd(cid)

		if(skullEnd > 0) then

			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))

		end

	end



	return true

end
Link para o post
Compartilhar em outros sites

agora deu isso

 

[01/08/2013 21:46:18] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/frags.lua)
[01/08/2013 21:46:18] data/talkactions/scripts/frags.lua:169: 'end' expected (to close 'function' at line 11) near 'endv'
[01/08/2013 21:46:19] Reloaded talk actions.
 
 
Bom to começando acha que nao tem a tabela Frags na minha database pq quando baixei o mapa ja veio sem Frags
Link para o post
Compartilhar em outros sites

se não der pede pro tony passar o dele:

local config = {

	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),

	advancedFragList = getBooleanFromString(getConfigValue('advancedFragList'))

}



function onSay(cid, words, param, channel)

	if(not config.useFragHandler) then

		return false

	end



	local time = os.time()

	local times = {today = (time - 86400), week = (time - (7 * 86400))}



	local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")

	if(result:getID() ~= -1) then

		repeat

			local content = {

				name = result:getDataString("name"),

				level = result:getDataInt("level"),

				date = result:getDataInt("date")

			}

			if(content.date > times.today) then

				table.insert(contents.day, content)

			elseif(content.date > times.week) then

				table.insert(contents.week, content)

			else

				table.insert(contents.month, content)

			end

		until not result:next()

		result:free()

	end



	local size = {

		day = table.maxn(contents.day),

		week = table.maxn(contents.week),

		month = table.maxn(contents.month)

	}

	if(config.advancedFragList) then

		local result = "Frags gained today: " .. size.day .. "."

		if(size.day > 0) then

			for _, content in ipairs(contents.day) do

				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

			end



			result = result .. "\n"

		end



		result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."

		if(size.week > 0) then

			for _, content in ipairs(contents.week) do

				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

			end



			result = result .. "\n"

		end



		result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."

		if(size.month > 0) then

			for _, content in ipairs(contents.month) do

				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

			end



			result = result .. "\n"

		end



		local skullEnd = getPlayerSkullEnd(cid)

		if(skullEnd > 0) then

			result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)

		end



		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, result)

	else

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")

		if(size.day > 0) then

			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")

		end



		local skullEnd = getPlayerSkullEnd(cid)

		if(skullEnd > 0) then

			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))

		end

	return true

	end
Link para o post
Compartilhar em outros sites

Nossa se é loco nao deu pqp da o mesmo erro de antes, no meu xml ta assim a Tag

 

<talkaction words="!frags" event="script" value="frags.lua"/>

 

TonyHalk

 

Se der passa sua ai Colega, Vlws do Rep+ pra quem me ajuda nessa rsrs

Link para o post
Compartilhar em outros sites

Pow é um mapa Baiak 8.6 é o EriBaiak tem ate pra download ele aqui no Tikia King

Link para o post
Compartilhar em outros sites

cara usa esse script denovo! deleta tudo do .lua antes de colar, você deichou um v depois de um end eu axo, é provável que seja isso, mas se não der eu posto a outra correção:

(quanto ao primeiro bug, do primeiro script é um problema na sua lib, mas é muito mais complexo não vou poder ajudar)

local config = {

	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),

	advancedFragList = getBooleanFromString(getConfigValue('advancedFragList'))

}



function onSay(cid, words, param, channel)

	if(not config.useFragHandler) then

		return false

	end



	local time = os.time()

	local times = {today = (time - 86400), week = (time - (7 * 86400))}



	local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")

	if(result:getID() ~= -1) then

		repeat

			local content = {

				name = result:getDataString("name"),

				level = result:getDataInt("level"),

				date = result:getDataInt("date")

			}

			if(content.date > times.today) then

				table.insert(contents.day, content)

			elseif(content.date > times.week) then

				table.insert(contents.week, content)

			else

				table.insert(contents.month, content)

			end

		until not result:next()

		result:free()

	end



	local size = {

		day = table.maxn(contents.day),

		week = table.maxn(contents.week),

		month = table.maxn(contents.month)

	}

	if(config.advancedFragList) then

		local result = "Frags gained today: " .. size.day .. "."

		if(size.day > 0) then

			for _, content in ipairs(contents.day) do

				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

			end



			result = result .. "\n"

		end



		result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."

		if(size.week > 0) then

			for _, content in ipairs(contents.week) do

				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

			end



			result = result .. "\n"

		end



		result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."

		if(size.month > 0) then

			for _, content in ipairs(contents.month) do

				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level

			end



			result = result .. "\n"

		end



		local skullEnd = getPlayerSkullEnd(cid)

		if(skullEnd > 0) then

			result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)

		end



		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, result)

	else

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")

		if(size.day > 0) then

			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")

		end



		local skullEnd = getPlayerSkullEnd(cid)

		if(skullEnd > 0) then

			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))

		end

	end



	return true

end
Link para o post
Compartilhar em outros sites

Nao deu dinovo veio, e tbm ja verifiquei nao fico um V. deu esse erro

 

 

[01/08/2013 22:07:20] Lua Script Error: [TalkAction Interface] 

[01/08/2013 22:07:20] data/talkactions/scripts/frags.lua
 
[01/08/2013 22:07:20] data/lib/function.lua:436: attempt to index local 'str' (a nil value)
[01/08/2013 22:07:20] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/frags.lua)
Link para o post
Compartilhar em outros sites

sim como falei, eu conversei com um scripter amigo meu, ele falou que isso ai é erro no lib, e que é muito complexo de resolver, tenta trocar o lib, pega de outro server da mesma versão

Link para o post
Compartilhar em outros sites

Sim Mano é erro na Lib mesmo eu andei trokando o arquivo Function da Lib e saiu o erro que dava na Executavel, mais quando eu executo o comando !frags nao apareci nada

Link para o post
Compartilhar em outros sites
  • 2 weeks later...

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo