Ir para conteúdo
  • Cadastre-se

[Resolvido] player morre e da erro no distro


Posts Recomendados

[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

Link para o post
Compartilhar em outros sites

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

 

Link para o post
Compartilhar em outros sites
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

Link para o post
Compartilhar em outros sites

[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.

O erro da linha 32 eu fixei

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

Att.

Giovani Rodrigo

Editado por GiovaniRodrigo (veja o histórico de edições)
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

 

Link para o post
Compartilhar em outros sites

[paste]frETN4Wv[/paste]

MaXwEllDeN o seu, deu so esse erro abaixo.

[16/5/2013 14:44:17] [Error - CreatureScript Interface]

[16/5/2013 14:44:17] data/creaturescripts/scripts/playerdeath.lua:onDeath

[16/5/2013 14:44:17] Description:

[16/5/2013 14:44:17] (LuaInterface::luaGetCreatureName) Creature not found

[16/5/2013 14:44:17] mysql_real_query(): INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (8, 1368726257, 7, '', ''); - MYSQL ERROR: Unknown column 'time' in 'field list' (1054)

como pode ver eu to abrindo o ot com o XAMPP, Sera que nao é erro no DATABASE ??? pelo oque eu to vendo parece.

Pelo menos agora esta aparecendo o Corpo no chao, coisa que antes nao aparecia, mais ainda continua a nao cair O loot.

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

 omera.jpg

 

Vaga de Scripts, Pro projeto.Contato PM

Link para o post
Compartilhar em outros sites

RESOLVIDO... ACHEI UM SCRIPT QUE ESTAVA GUARDADO EM OUTRO OT AQUI..

 

SE QUISEREM.

 

 

function onDeath(cid, corpse, deathList)

--[[Death Channel
local strings = {""}
local t, position = 1, 1

local deathType = "killed"
local toSlain, toCrushed, toEliminated = 3, 9, 15

        if #deathList >= toSlain and #deathList < toCrushed then
                deathType = "slain"
        elseif #deathList >= toCrushed and #deathList < toEliminated then
                deathType = "crushed"
        elseif #deathList >= toEliminated then
                deathType = "eliminated"
        end

        for _, pid in ipairs(deathList) do
                if isCreature(pid) == true then
                        strings[position] = t == 1 and "" or strings[position] .. ", "
                        strings[position] = strings[position] .. getCreatureName(pid) .. ""
                        t = t + 1
                else
                        strings[position] = t == 1 and "" or strings[position] .. ", "
                        strings[position] = strings[position] .."a field item"
                        t = t + 1
                end
        end

        for i, str in ipairs(strings) do
                if(str:sub(str:len()) ~= ",") then
                        str = str .. "."
                end

                msg = getCreatureName(cid) .. " was " .. deathType .. " at level " .. getPlayerLevel(cid) .. " by " .. str
        end

        for _, oid in ipairs(getPlayersOnline()) do
                doPlayerSendChannelMessage(oid, "Death channel", msg, TALKTYPE_CHANNEL_O, CHANNEL_DEATH)
        end]]
		
	--[[Heart Reward
	if isPlayer(cid) then
		doSendMagicEffect(getCreaturePosition(cid), 0)
		local v = { killer_name = getCreatureName(deathList[1]), killer_level = getPlayerLevel(deathList[1]), target_name = getCreatureName(cid), target_level = getPlayerLevel(cid) }
		local reward = doAddContainerItem(corpse.uid, 5943, 1)
		doItemSetAttribute(reward, "description", "" .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed at level " .. v.target_level .. " by " .. v.killer_name .. " who was level " .. v.killer_level .. " at the time. " .. (getCreatureSkullType(cid) <= SKULL_GREEN and "[unjustified]" or "[Justified]"))
		doItemSetAttribute(reward, "name", v.target_name .."'s Heart")
	end]]

    return true
end 

 

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

 omera.jpg

 

Vaga de Scripts, Pro projeto.Contato PM

Link para o post
Compartilhar em outros sites

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