Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado
local function getDeathsAndKills(cid, type) -- by vodka
	local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0
	if query:getID() ~= -1 then 
		repeat
			d = d + 1
			until not query:next()
				query:free()
			end
		return d 
	end
end

local function getPoints(cid)
	local Info = db.getResult("SELECT `rep` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")
	local s = Info:getDataInt("s")
	Info:free()
	return s
	end
	if s <= -20 then
		x = "GranBigNoob"
	elseif s <= -10 then
		x = "Big Noob"
	elseif s <= -1 then
		x = "Noob"
	elseif s == 0 then
		x = "Citizen"
	elseif s >= 1 then
		x = "Avowed"
	elseif s >= 10 and s < 20 then
		x = "Respected"
	elseif s >= 20 and s < 30 then
		x = "Sagaz"
	elseif s >= 30 and s < 40 then
		x = "Domination"
	elseif s >= 40 and s < 20 then
		x = "Bloodbath"
	elseif s >= 50 then
		x = "Legendary"
	end
	if isPlayer(thing.uid) then
		doPlayerSetSpecialDescription(thing.uid, "\n".. (getPlayerSex(thing.uid) == 0 and "Ela" or "Ele") .." ja Matou: [".. getDeathsAndKills(thing.uid, "kill") .."] Players.\n".. (getPlayerSex(thing.uid) == 0 and "Ela" or "Ele") .." ja Morreu: [".. getDeathsAndKills(thing.uid, "death") .."] Vezes.\nReputação: ".. getPoints .." (".. x ..")." )
	end
end

function onLook(cid, thing, position, lookDistance)
	return getPoints(cid)
end

Deixa assim e me mostra o que acontece.

Eternera Tibia Server - RPG

  • Respostas 6
  • Visualizações 425
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor

Removi alguns "end" a mais que tinha e surgiu o seguinte erro:

 

local function getDeathsAndKills(cid, type) -- by vodka
	local query,d = db.getResult("SELECT `player_id` FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)),0
	if query:getID() ~= -1 then 
		repeat
			d = d + 1
			until not query:next()
				query:free()
			end
		return d 
	end


local function getPoints(cid)
	local Info = db.getResult("SELECT `rep` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")
	local s = Info:getDataInt("s")
	Info:free()
	return s
	end
	if s <= -20 then
		x = "GranBigNoob"
	elseif s <= -10 then
		x = "Big Noob"
	elseif s <= -1 then
		x = "Noob"
	elseif s == 0 then
		x = "Citizen"
	elseif s >= 1 then
		x = "Avowed"
	elseif s >= 10 and s < 20 then
		x = "Respected"
	elseif s >= 20 and s < 30 then
		x = "Sagaz"
	elseif s >= 30 and s < 40 then
		x = "Domination"
	elseif s >= 40 and s < 20 then
		x = "Bloodbath"
	elseif s >= 50 then
		x = "Legendary"
	end
	if isPlayer(thing.uid) then
		doPlayerSetSpecialDescription(thing.uid, "\n".. (getPlayerSex(thing.uid) == 0 and "Ela" or "Ele") .." ja Matou: [".. getDeathsAndKills(thing.uid, "kill") .."] Players.\n".. (getPlayerSex(thing.uid) == 0 and "Ela" or "Ele") .." ja Morreu: [".. getDeathsAndKills(thing.uid, "death") .."] Vezes.\nReputação: ".. getPoints .." (".. x ..")." )
	end

function onLook(cid, thing, position, lookDistance)
	return getPoints(cid)
end

[Error - Test Interface]
data/creaturescripts/scripts/lawl.lua
Description:
data/creaturescripts/scripts/lawl.lua:19: attempt to compare nil with number
[Error - Event::checkScript] Cannot load script (data/creaturescripts/scripts/lawl.lua)

 

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

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.6k

Informação Importante

Confirmação de Termo