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

Edit Script

xLosT

Member
Joined
Jan 11, 2010
Messages
1,021
Reaction score
13
Location
Brasil, Rio Grande do Sul
need add to see when look at yourself

PHP:
function onLook(cid, thing, position, lookDistance)
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
if isPlayer(thing.uid) then
doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." has Killed: ["..getDeathsAndKills(thing.uid, "kill").."] Players.\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." has Died: ["..getDeathsAndKills(thing.uid, "death").."] Times")
end
return true
end
 
LUA:
if isPlayer(thing.uid) then 
doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." has Killed: ["..getDeathsAndKills(thing.uid, "kill").."] Players.\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." has Died: ["..getDeathsAndKills(thing.uid, "death").."] Times") 
end

to:
LUA:
if isPlayer(thing.uid) and thing.uid ~= cid then  
    doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." has Killed: ["..getDeathsAndKills(thing.uid, "kill").."] Players.\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." has Died: ["..getDeathsAndKills(thing.uid, "death").."] Times")
elseif isPlayer(thing.uid) and thing.uid == cid then
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You killed " .. getDeathsAndKills(cid, "kill") .. " people and died " .. getDeathsAndKills(cid, "death") .. " time(s).") 
end
 
It will not show in that message, to do that you would either need to write the whole look from sources into lua or edit special description to work on self.
It will just show an additional message with frags.
 
LUA:
function getDeathsAndKills(cid, type) -- by vodka. Edited by Darkhaos
	local query, d = db.getResult("SELECT COUNT(player_id) AS c FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)), 0 
		if (query:getID() ~= -1) then  
			d = query:getDataInt("c") 
			query:free() 
		end 
	return d   
end 

function onLook(cid, thing, position, lookDistance) 

	if isPlayer(thing.uid) then 
		return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerSex(thing.uid) == 0 and "She" or "He").." has Killed: ["..getDeathsAndKills(thing.uid, "kill").."] Players.\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." has Died: ["..getDeathsAndKills(thing.uid, "death").."] Times.") 
	end
end
 
Code:
[21:40:43.680] [Error - LuaInterface::loadFile] data/creaturescripts/scripts/KillsandDeath.lua:13: 'end' expected (to close 'if' at line 12) near ')'
[21:40:43.680] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/KillsandDeath.lua)
[21:40:43.680] data/creaturescripts/scripts/KillsandDeath.lua:13: 'end' expected (to close 'if' at line 12) near ')'
 
LUA:
function getDeathsAndKills(cid, type) -- by vodka. Edited by Darkhaos
	local query, d = db.getResult("SELECT COUNT(player_id) AS c FROM "..(tostring(type) == "kill" and "`player_killers`" or "`player_deaths`").." WHERE `player_id` = "..getPlayerGUID(cid)), 0 
	if (query:getID() ~= -1) then  
		d = query:getDataInt("c") 
		query:free() 
	end
	return d   
end 
 
function onLook(cid, thing, position, lookDistance) 
	if isPlayer(thing.uid) then 
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerSex(thing.uid) == 0 and "She" or "He").." has Killed: ["..getDeathsAndKills(thing.uid, "kill").."] Players.\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").." has Died: ["..getDeathsAndKills(thing.uid, "death").."] Times.") 
	end
	return true
end
 
Code:
[12:43:49.594] [Error - LuaInterface::loadFile] data/creaturescripts/scripts/KillsandDeath.lua:12: unexpected symbol near '..'
[12:43:49.594] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/KillsandDeath.lua)
[12:43:49.594] data/creaturescripts/scripts/KillsandDeath.lua:12: unexpected symbol near '..'
 
Back
Top