Ir para conteúdo

Featured Replies

Postado

poko360 , algo mais ?

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

  • Respostas 28
  • Visualizações 2.8k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Se a função de ver os resets do player for igual à: getResets(cid) Sim,    mas se for tipo, ou qualquer outra coisa... getPlayerResets(cid) é só você substituir... qualquer coisa, posta aqui.

  • local resetmin = 1  function onCastSpell(cid, var) if getResets(cid) >= resetmin then return doCombat(cid, combat, var) else     return doPlayerSendCancel(cid, "Sorry, you need ".. resetmin .."

  • Continua assim: local resetmin = 1  function onCastSpell(cid, var) if getResets(cid) >= resetmin then doCombat(cid, combat, var) else     return doPlayerSendCancel(cid, "Sorry, you need ".. re

Postado
  • Autor

desculpe nao responder mais cedo,

 

eu mudei de sistema de reset pra esse

--[[ SCRIPTING> MarcelloMkez <scriptING ]]


--[[ [supreme Reset System]
Autor: rafhael
Versión: 1.0
TFS: 0.3.6
Testeado en: 8.60
Fórum:


[Características]
~ Versión 1.0 ~


- Resets no Look; 
- Premium Account ou não;
- Mudar Vocação;
- Limite de Resets;
- Opções para Abilitar e Desabilitar Condições;


[Em Construção]


- Stages Free e Premium;
- 'Talvez' um novo sistema de mudar Vocação;
sem data para postagem. ]]






function onSay(cid, words, param)


--[Configurações de Condição]__


config = { --[[verdadeiro / Falso]]


needPa = false, -- Precisa de Premium Account? [true / false]
needPz = true, -- Precisa estar em Protection Zone? [true / false] 
battle = true, -- Precisa estar sem Batlle para Resetar? [true / false]
withe = false, -- Players PK Withe pode Resetar? [true / false] 
red = false, -- Players PK Red pode Resetar? [true / false]
tp = true, -- Teleportar para o Templo após o reset? [true / false]
look = true, -- Mostrar Resets no Look do Player? [true / false]
addLimite = true, -- Abilitar Limite de Resets? [true / false]
setClasse = false, -- Mudar Vocação do player quando resetar? [true / false]
storage = 2310, -- Storage [valor]




--[Configurações do Reset]__


resetStatus = { 


player = getPlayerGUID(cid), -- Não Mude.
lvl = 100000 , -- Level Necessário para Resetar. [valor]
lvlreset = 100, -- Level que retornará após o Reset. [valor]
limite = 5, -- Máximo de resets que um player pode chegar. [valor]
newClasse = 0, -- Id da Nova Vocação após o Reset. [valor]
tempo= 3 -- Tempo para o Player deslogar para Resetar. Em segundos. [valor]
},
} 


--[Funções]__


function Reseting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.query("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.query("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end


function noAll(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
db.query("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.query("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end


function noTeleporting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.query("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.query("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end


function noLook(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.query("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.query("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end


function noClasse(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.query("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.query("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end


function setClasse(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
db.query("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
db.query("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end


function look(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
db.query("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.query("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end


function teleporting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.query("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
db.query("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end


function getResets(cid)
resets = getPlayerStorageValue(cid,config.storage)


if resets < 1 then
resets = 1
end
return resets


end




local resets = getResets(cid)
local needLvl ="Você precisa de "..config.resetStatus.lvl-getPlayerLevel(cid).." level's para resetar."
local msg ="~~[Reset: "..getResets(cid).."]~~ 'Sucesso ao Resetar! Você será deslogado em "..config.resetStatus.tempo.." Segundos."




--[Condiçoes]__ 


if(config.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"Você Precisa estar em Protection Zone Para Resetar.")
return TRUE


elseif(config.addLimite == true) and (getResets(cid) == config.resetStatus.limite) then
doPlayerSendTextMessage(cid, 22, "Você ja atingiu o Limite de Resets.")
return TRUE


elseif(config.withe == false) and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid,22,"Você ta PK White, por isso não pode resetar.")
return TRUE


elseif(config.red == false) and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"Você ta PK Red, por isso não pode resetar.")
return TRUE


elseif(config.needPa == true) and not isPremium(cid) then
doPlayerSendTextMessage(cid,22,"Você Precisa ser Premium Account para Resetar.")
return TRUE


elseif(config.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"Você Precisa estar sem Battle para Resetar.") 
return TRUE


elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == true) then
addEvent(Reseting, config.resetStatus.tempo* 1000, cid)


elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == false) then
addEvent(noAll, config.resetStatus.tempo* 1000, cid)


elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == true) then
addEvent(noTeleporting, config.resetStatus.tempo* 1000, cid)


elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == true) then
addEvent(noLook, config.resetStatus.tempo* 1000, cid)


elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == false) then
addEvent(noClasse, config.resetStatus.tempo* 1000, cid)


elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == true) then
addEvent(setClasse, config.resetStatus.tempo* 1000, cid)


elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == false) then
addEvent(look, config.resetStatus.tempo* 1000, cid)


elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == false) then
addEvent(teleporting, config.resetStatus.tempo* 1000, cid)


elseif doPlayerSendCancel(cid, needLvl) then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end


if doPlayerPopupFYI(cid, msg) then


end
return TRUE


end


--[By: rafhael]__

 

qual eu devo colocar nos spells?

 

 

 

( aproveitando o post, se voce puder me ajuda pra criar 1 rank reset pra esse script ? obrigado !)

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

Postado

Continua assim:

local resetmin = 1 

function onCastSpell(cid, var)

if getResets(cid) >= resetmin then
 doCombat(cid, combat, var)
else
    return doPlayerSendCancel(cid, "Sorry, you need ".. resetmin .." reset to use this spell.") and doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end

Testa lá...
vou ver o rank reset, o ideal é criar um tópico, manda link via pm...

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

Postado
  • Autor

eu testei aqui e nao funcionou :(

 

deu um error tipo assim

"end" to close function at line 28 <eof>

local config = {
    hits = 2, -- quantos hits vai dar
    effect = 0, -- efeito
    distance_effect = 39, -- efeito de distance
    delay = 300, -- tempo entre os hits
    damage = COMBAT_POISONDAMAGE -- tipo de combat
}


local combat = createCombatObject()
local function doHitCreature(target, cid, times)
    if isCreature(cid) and isCreature(target) and times ~= 0 then
local min = math.ceil(getPlayerLevel(cid) * 1.4)
doTargetCombatHealth(cid, target, config.damage, -min, -min, config.effect)
        doSendDistanceShoot(getThingPos(cid), getThingPos(target), config.distance_effect)
        addEvent(doHitCreature, config.delay, target, cid, times-1)
    end
    return true
end


function onTargetCreature(cid, target)
    return addEvent(doHitCreature, 1, target, cid, config.hits)
end


setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")


local resetmin = 1 


function onCastSpell(cid, var)


if getResets(cid) >= resetmin then
return doCombat(cid, combat, var)
else
    return doPlayerSendCancel(cid, "Sorry, you need ".. resetmin .." reset to use this spell.") and doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end

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

Postado
local config = {
    hits = 2, -- quantos hits vai dar
    effect = 0, -- efeito
    distance_effect = 39, -- efeito de distance
    delay = 300, -- tempo entre os hits
    damage = COMBAT_POISONDAMAGE -- tipo de combat
}


local combat = createCombatObject()
local function doHitCreature(target, cid, times)
    if isCreature(cid) and isCreature(target) and times ~= 0 then
local min = math.ceil(getPlayerLevel(cid) * 1.4)
doTargetCombatHealth(cid, target, config.damage, -min, -min, config.effect)
        doSendDistanceShoot(getThingPos(cid), getThingPos(target), config.distance_effect)
        addEvent(doHitCreature, config.delay, target, cid, times-1)
    end
    return true
end


function onTargetCreature(cid, target)
    return addEvent(doHitCreature, 1, target, cid, config.hits)
end


setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")


local resetmin = 1 

function onCastSpell(cid, var)
	if getResets(cid) >= resetmin then
		doCombat(cid, combat, var)
	else
		doPlayerSendCancel(cid, "Sorry, you need ".. resetmin .." reset to use this spell.") 
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
	end
return true
end

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

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.6k

Informação Importante

Confirmação de Termo