Ir para conteúdo

Featured Replies

Postado
[14/5/2013 17:45:7] [Error - CreatureScript Interface]
[14/5/2013 17:45:7] data/creaturescripts/scripts/playerdeath.lua:onDeath
[14/5/2013 17:45:7] Description:
[14/5/2013 17:45:7] (LuaInterface::luaGetCreatureName) Creature not found
[14/5/2013 17:45:7] [Error - CreatureScript Interface]
[14/5/2013 17:45:7] data/creaturescripts/scripts/playerdeath.lua:onDeath
[14/5/2013 17:45:7] Description:
[14/5/2013 17:45:7] (LuaInterface::luaGetCreatureName) Creature not found
[14/5/2013 17:45:7] [Error - CreatureScript Interface]
[14/5/2013 17:45:7] data/creaturescripts/scripts/playerdeath.lua:onDeath
[14/5/2013 17:45:7] Description:
[14/5/2013 17:45:7] (LuaInterface::luaGetCreatureName) Creature not found
[14/5/2013 17:45:7] [Error - CreatureScript Interface]
[14/5/2013 17:45:7] data/creaturescripts/scripts/playerdeath.lua:onDeath
[14/5/2013 17:45:7] Description:
[14/5/2013 17:45:7] data/creaturescripts/scripts/playerdeath.lua:32: attempt to call field 'executequery' (a nil value)
[14/5/2013 17:45:7] stack traceback:
[14/5/2013 17:45:7]  data/creaturescripts/scripts/playerdeath.lua:32: in function <data/creaturescripts/scripts/playerdeath.lua:9>
[14/5/2013 17:45:7] Omeranty has logged out.
[14/5/2013 17:45:11] Omeranty has logged in.

 

 omera.jpg

 

Vaga de Scripts, Pro projeto.Contato PM

  • Respostas 8
  • Visualizações 1k
  • Created
  • Última resposta

Top Posters In This Topic

Postado

Up

Mande o script do arquivo playerdeath.lua...

Spoiler

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}

if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

Postado
  • Autor
local config = {
	deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
	sqlType = getConfigInfo('sqlType'),
	maxDeathRecords = getConfigInfo('maxDeathRecords')
}

config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
	if(config.deathListEnabled ~= TRUE) then
		return
	end

	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:getRows(true) - config.maxDeathRecords
		if(amount > 0) then
			if(config.sqlType == DATABASE_ENGINE_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

 omera.jpg

 

Vaga de Scripts, Pro projeto.Contato PM

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