Ir para conteúdo

[Arquivado]Recompensa Pela Morte


Antiemoxlr

Posts Recomendados

Assim eu fis No Ot 8.40 uma recompensa que quando você mata o player aparece a skull dele como Poresenplo

You See To Skull Reconhecid No Name lvl 666 kiled by Antiemoxlr lvl 666<

Va en Creature script e coloque isto Na pasta Playerdeath

 

dofile("./config.lua")

 

function onDeath(cid, corpse, killer)

local playerpos = getPlayerPosition(cid)

local skull = doCreateItem(2229 ,1,playerpos)

doSetItemSpecialDescription(skull, 'Skull to ' .. getCreatureName(cid) .. ' Killed by ' .. getCreatureName(killer) .. ' at level '.. getPlayerLevel(cid) ..'')

doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You are dead.")

if deathListEnabled == "yes" then

if sqlType == "mysql" then

env = assert(luasql.mysql())

con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))

else -- sqlite

env = assert(luasql.sqlite3())

con = assert(env:connect(sqliteDatabase))

end

local byPlayer = FALSE

if killer == FALSE then

killerName = "field item"

else

if isPlayer(killer) == TRUE then

byPlayer = TRUE

end

killerName = getCreatureName(killer)

end

assert(con:execute("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", '" .. escapeString(killerName) .. "', " .. byPlayer .. ");"))

local cursor = assert(con:execute("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";"))

local deathRecords = numRows(cursor)

if sqlType == "mysql" then

while deathRecords > maxDeathRecords do

delete = assert(con:execute("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1;"))

deathRecords = deathRecords - 1

end

else

while deathRecords > maxDeathRecords do

delete = assert(con:execute("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);"))

deathRecords = deathRecords - 1

end

end

con:close()

env:close()

end

end

 

 

 

 

Olha Funcionol No meu ot Vamos ver se Funciona no seu =p

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...
  • 8 years later...
Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...