Postado Abril 27, 2013 12 anos No caso, até funciona (somente os frags não resetam), mas quando vou colocar no default... ele pede para tirar a foreign key de player_vip, e depois account_vip e assim vai. (Eu teria que tirar a foreign key de todos, e não é isso exatamente o que eu quero) A intenção mesmo é resetar frags, deaths, quests, skills, level e first items assim que o player morrer ou deslogar. (Eu quero preservar as outras funções como: houses, vip e etc) Desculpe se me expressei mal, perdão :/ Script Death Modifique o arquivo playerdeath.lua que se encontra na pasta data/creaturescripts/scripts function onDeath(cid, corpse, deathList) local strings = {""} local t, position = 1, 1 local deathType = "killed" local toSlain, toCrushed = 3, 9 if #deathList >= toSlain then deathType = "slain" elseif #deathList >= toCrushed then deathType = "crushed" end for _, pid in ipairs(deathList) do strings[position] = t == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .. getCreatureName(pid) .. "" t = t + 1 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 if isPlayer(cid) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 100) doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 100) doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 100) doCreatureSetDropLoot(cid, true) db.executeQuery('DELETE FROM player_storage WHERE id '.. getPlayerGUID(cid) ..';') return TRUE end return TRUE end Script Logout Crie um arquivo chamado logoutloss.lua na pasta data/creaturescripts/scripts e cole isso if isPlayer(cid) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 100) doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 100) doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 100) doCreatureSetDropLoot(cid, true) db.executeQuery('DELETE FROM player_storage WHERE id '.. getPlayerGUID(cid) ..';') return TRUE end return true end Adicione no arquivo creaturescripts.xml que se encontra na pasta data/creaturescripts a seguinte linha <event type = "logout" name = "logoutLoss" event = "script" value = "logoutloss.lua" /> Adicione no arquivo login.lua que se encontra na pasta data/creaturescripts/scripts a seguinte linha registerCreatureEvent(cid, "logoutLoss") Não foi testado, se der erro avise. Dúvidas? Me avise. Att. Giovani Rodrigo Editado Abril 27, 2013 12 anos 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
Postado Abril 27, 2013 12 anos Autor Creio que não pegou, joguei fora os items, e matei o player, os items não resetaram, ele não resetou o level para o level inicial (no caso 100), ele foi pra 96 o.O Os frags também não resetaram e nem as quests (nem ao morrer e nem ao deslogar) :/ (skills e magic level, já dei um jeito) E o level, eu consegui fazer que voltasse ao inicial assim que morresse, mas não consegui colocar pra voltar o level inicial quando deslogasse :/ Editado Abril 27, 2013 12 anos por Cayanz (veja o histórico de edições)
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.