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

Death Level Loss (0.3 beta 2) bug

Limannen

Member
Joined
Nov 17, 2007
Messages
1,612
Reaction score
7
Location
Sweden
It seems to be a problem,
whenever I die by a monster/pk I don't loose any level.

Don't say:
*Change your loss % in config.lua
Cause that doesn't work !

Anyone know a solution?

/Limannen
 
What he said is right.

PHP:
UPDATE players SET loss_experience = 10 WHERE vocation < 5;
UPDATE players SET loss_experience = 7 WHERE vocation > 4;
 
Ah...but, you know the issue or not?
Cuz I cant ! It's boring with high lvls on your server that wars,
and don't loose any levels at all.

Playerdeath in creature scripts:
Code:
local config = {
	deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
	sqlType = getConfigInfo('sqlType'),
	maxDeathRecords = getConfigInfo('maxDeathRecords')
}

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
	if(config.deathListEnabled == TRUE) then
		local hitKillerName = "field item"
		local damageKillerName = ""
		if(lastHitKiller ~= FALSE) then
			if(isPlayer(lastHitKiller) == TRUE) then
				hitKillerName = getPlayerGUID(lastHitKiller)
			else
				hitKillerName = getCreatureName(lastHitKiller)
			end

			if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then
				if(isPlayer(mostDamageKiller) == TRUE) then
					damageKillerName = getPlayerGUID(mostDamageKiller)
				else
					damageKillerName = getCreatureName(mostDamageKiller)
				end
			end
		end

		db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");")
		local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
		if(rows:getID() ~= -1) then
			local amount = (rows:numRows(true) - config.maxDeathRecords)
			if(amount > 0) then
				if(config.sqlType == "sqlite") then
					for i = 1, amount do
						db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")
					end
				else
					db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";")
				end
			end
		end
	end
end
 
Last edited by a moderator:
Playerdeath in creature scripts:
Code:
local config = {
	deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
	sqlType = getConfigInfo('sqlType'),
	maxDeathRecords = getConfigInfo('maxDeathRecords')
}

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
	if(config.deathListEnabled == TRUE) then
		local hitKillerName = "field item"
		local damageKillerName = ""
		if(lastHitKiller ~= FALSE) then
			if(isPlayer(lastHitKiller) == TRUE) then
				hitKillerName = getPlayerGUID(lastHitKiller)
			else
				hitKillerName = getCreatureName(lastHitKiller)
			end

			if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then
				if(isPlayer(mostDamageKiller) == TRUE) then
					damageKillerName = getPlayerGUID(mostDamageKiller)
				else
					damageKillerName = getCreatureName(mostDamageKiller)
				end
			end
		end

		db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");")
		local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
		if(rows:getID() ~= -1) then
			local amount = (rows:numRows(true) - config.maxDeathRecords)
			if(amount > 0) then
				if(config.sqlType == "sqlite") then
					for i = 1, amount do
						db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")
					end
				else
					db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";")
				end
			end
		end
	end
end
return TRUE

So that's the right script then?
 
omigosh...

here, enjoy:

Code:
local config = {
	deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
	sqlType = getConfigInfo('sqlType'),
	maxDeathRecords = getConfigInfo('maxDeathRecords')
}

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
	if(config.deathListEnabled == TRUE) then
		local hitKillerName = "field item"
		local damageKillerName = ""
		if(lastHitKiller ~= FALSE) then
			if(isPlayer(lastHitKiller) == TRUE) then
				hitKillerName = getPlayerGUID(lastHitKiller)
			else
				hitKillerName = getCreatureName(lastHitKiller)
			end

			if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then
				if(isPlayer(mostDamageKiller) == TRUE) then
					damageKillerName = getPlayerGUID(mostDamageKiller)
				else
					damageKillerName = getCreatureName(mostDamageKiller)
				end
			end
		end

		db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");")
		local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
		if(rows:getID() ~= -1) then
			local amount = (rows:numRows(true) - config.maxDeathRecords)
			if(amount > 0) then
				if(config.sqlType == "sqlite") then
					for i = 1, amount do
						db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")
					end
				else
					db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";")
				end
			end
		end
	end
    return TRUE
end
 
FUCK ! This didn't work.

This is totally wierd...I mean, does all of the players has this problem then?
Cuz then 'erpot' got some really bugs on his ot :D
 
Every thought of executing
Code:
UPDATE `otserv`.`players` SET `loss_experience` = '10', `loss_mana` = '10', `loss_skills` = '10', `loss_items` = '10';

in phpmyadmin->database->SQL?

@Edit this worked for me
 
HEY, I noticed that
UPDATE players SET loss_experience = 10 WHERE vocation < 5;
UPDATE players SET loss_experience = 7 WHERE vocation > 4;

That this worked, but how do I add so every loss thing is 10% ?

Cuz the mana/skills are 0 !
 
Try like this ^^

If that aint working I can't help ya out


Code:
UPDATE players SET loss_mana = 10 WHERE vocation < 5;
UPDATE players SET loss_mana = 10 WHERE vocation > 4;


Code:
UPDATE players SET loss_skills = 10 WHERE vocation < 5;
UPDATE players SET loss_skills = 10 WHERE vocation > 4;


Code:
UPDATE players SET loss_items = 10 WHERE vocation < 5;
UPDATE players SET loss_items = 10 WHERE vocation > 4;
 
Back
Top