Ir para conteúdo

Featured Replies

Postado

Eae galera tenho um script feito por ("zipter98") < Todos Creditos para ele

 

tag do meu talk

<talkaction words="!pvpon;!pvpoff" event="script" value="pvpon.lua"/>
local msg = "Agora seu sistema PvP está %s."
function onSay(cid, words, param)
local _table = {
    ["!pvpon"] = {"ativado", 1},
    ["!pvpoff"] = {"desativado", 0},
}
    if _table[param:lower()] then
        local mode = _table[param:lower()]
        setPlayerStorageValue(cid, 91821, mode[2])
        doPlayerSendTextMessage(cid, 27, msg:format(mode[1]))
    end
    return true
end
 Tags:
    <event type="statschange" name="PvPStats" event="script" value="pvp.lua"/>
    <event type="target" name="PvPTarget" event="script" value="pvp.lua"/> 
    <event type="login" name="PvPLogin" event="script" value="pvp.lua"/> 
function onTarget(cid, target)
    if isPlayer(target) and isPlayer(cid) then
        if getPlayerStorageValue(cid, 91821) < 1 then
            doPlayerSendCancel(cid, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o.")
            return false
        end
    end
    return true
end
 
function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isPlayer(attacker) and type == STATSCHANGE_HEALTHLOSS then
        if getPlayerStorageValue(attacker, 91821) < 1 then
            doPlayerSendCancel(attacker, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o.")
            return false
        end
    end
    return true
end
 
function onLogin(cid)
    registerCreatureEvent(cid, "PvPTarget")
    registerCreatureEvent(cid, "PvPStats")
    return true
end

 

 

Então esse script é bem antigo,acho que não é da versão que eu uso ("8.60,tfs 0.4) 

quando eu digito "!pvpon ou !pvpoff" não aparece nada,então não sei se esta ativo ou não,alguém poderia ajudar?

O rei de seu proprio destino é aquele que luta pela gloria do amanhã!
Discord : ZoR#9373


 

Resolvido por KotZletY

Ir para solução
  • Respostas 30
  • Visualizações 3.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @ZikaLord  local msg = "Agora seu sistema PvP está %s." function onSay(cid, words, param) local _table = { ["on"] = {"ativado", 1}, ["off"] = {"desativado", 0}, } if _table[param:lower

  • @Influencia o sistema é para servidores 0.4 protocolo 8.60. Por isso não funcionou.   Hoje ou amanhã converto para sua versão! 

Posted Images

Postado
  • Solução

@ZikaLord 

local msg = "Agora seu sistema PvP está %s."
function onSay(cid, words, param)
local _table = {
    ["on"] = {"ativado", 1},
    ["off"] = {"desativado", 0},
}
    if _table[param:lower()] then
        local mode = _table[param:lower()]
        setPlayerStorageValue(cid, 91821, mode[2])
        doPlayerSendTextMessage(cid, 27, "Seu pvp foi "..msg:format(mode[1]))
    end
    return true
end

 

e a tag xml deve estar assim:

<talkaction words="!pvp" event="script" value="pvpon.lua"/>

E então quando ele falar !pvp ae ele deve adicionar o param que é checado no script: !pvp on irá ativar e !pvp off irá desativar.

 

 

creaturescripts:

Spoiler

function onCombat(cid, target)
    if isPlayer(target) and isPlayer(cid) then
     if getPlayerStorageValue(cid, 91821) <= 0 then
      doPlayerSendCancel(cid, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o falando !pvp on.")
      return false
     elseif getPlayerStorageValue(target, 91821) <= 0 then
      doPlayerSendCancel(cid, "Seu target, está com o pvp desativado, ele precisa ativar para você poder ataca-lo.")
      return false
     end
	end
   return true
end

 
function onLogin(cid)
 registerCreatureEvent(cid, "PvPCombat")
 setPlayerStorageValue(cid, 91821, 1)
 return true
end

 

 

Tags creaturescripts.xml:

<event type="combat" name="PvPCombat" event="script" value="pvp.lua"/>
<event type="login" name="PvPLogin" event="script" value="pvp.lua"/> 

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Postado
Em 12/08/2017 em 22:45, ZikaLord disse:

Eae galera tenho um script feito por ("zipter98") < Todos Creditos para ele

 


function onTarget(cid, target)
    if isPlayer(target) and isPlayer(cid) then
        if getPlayerStorageValue(cid, 91821) < 1 then
            doPlayerSendCancel(cid, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o.")
            return false
        end
    end
    return true
end
 
function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isPlayer(attacker) and type == STATSCHANGE_HEALTHLOSS then
        if getPlayerStorageValue(attacker, 91821) < 1 then
            doPlayerSendCancel(attacker, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o.")
            return false
        end
    end
    return true
end
 
function onLogin(cid)
    registerCreatureEvent(cid, "PvPTarget")
    registerCreatureEvent(cid, "PvPStats")
    return true
end

 

 

 

Vim do futuro, e daqui alguns dias você vai fazer um tópico aki no fórum falando que o player pega pk quando ataca com magia de área outro player com chakra sheild ativado.  Então mude essa parte do sistema para essa:

 

Spoiler

function onTarget(cid, target)
    if isPlayer(target) and isPlayer(cid) then
        if getPlayerStorageValue(cid, 91821) < 1 then
            doPlayerSendCancel(cid, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o falando !pvp on.")
            return false
        end
    end
    return true
end
 
function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isPlayer(attacker) and type == STATSCHANGE_HEALTHLOSS then
        if getPlayerStorageValue(attacker, 91821) < 1 then
            doPlayerSendCancel(attacker, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o.")
            return false
        end
    end
        if isPlayer(cid) and isPlayer(attacker) and type == STATSCHANGE_MANALOSS then        
    if getPlayerStorageValue(attacker, 91821) < 1 then
            doPlayerSendCancel(attacker, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o.")
            return false
        end
        end
    return true
end
 
function onLogin(cid)
    registerCreatureEvent(cid, "pvptarget")
    registerCreatureEvent(cid, "pvpstats")
    return true
end

 

 

 

Host bom para hospedar seu jogo => https://shre.ink/OminiHost

 

Postado
  • Autor
10 horas atrás, quemtuacha disse:

 

 

Vim do futuro, e daqui alguns dias você vai fazer um tópico aki no fórum falando que o player pega pk quando ataca com magia de área outro player com chakra sheild ativado.  Então mude essa parte do sistema para essa:

 

  Mostrar conteúdo oculto

function onTarget(cid, target)
    if isPlayer(target) and isPlayer(cid) then
        if getPlayerStorageValue(cid, 91821) < 1 then
            doPlayerSendCancel(cid, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o falando !pvp on.")
            return false
        end
    end
    return true
end
 
function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(cid) and isPlayer(attacker) and type == STATSCHANGE_HEALTHLOSS then
        if getPlayerStorageValue(attacker, 91821) < 1 then
            doPlayerSendCancel(attacker, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o.")
            return false
        end
    end
        if isPlayer(cid) and isPlayer(attacker) and type == STATSCHANGE_MANALOSS then        
    if getPlayerStorageValue(attacker, 91821) < 1 then
            doPlayerSendCancel(attacker, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o.")
            return false
        end
        end
    return true
end
 
function onLogin(cid)
    registerCreatureEvent(cid, "pvptarget")
    registerCreatureEvent(cid, "pvpstats")
    return true
end

 

 

eu troquei mas mesmo assim da pra atacar.

 

Meu Login.lua

Spoiler

local config = {
 loginMessage = getConfigValue('loginMessage'),
 useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
boost.addSkills(cid)
 local loss = getConfigValue('deathLostPercent')
 if(loss ~= nil) then
  doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
 end



 local accountManager = getPlayerAccountManager(cid)
 if(accountManager == MANAGER_NONE) then
  local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
  if(lastLogin > 0) then
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
   str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
  end

  doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
 elseif(accountManager == MANAGER_NAMELOCK) then
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
 elseif(accountManager == MANAGER_ACCOUNT) then
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
 else
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
 end

 if(not isPlayerGhost(cid)) then
  doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
 end

 registerCreatureEvent(cid, "Mail")
 registerCreatureEvent(cid, "GuildMotd")

 registerCreatureEvent(cid, "Idle")
 if(config.useFragHandler) then
  registerCreatureEvent(cid, "SkullCheck")
 end
registerCreatureEvent(cid, "Biohazard")
registerCreatureEvent(cid, "ZombieAttack")
registerCreatureEvent(cid, "WeaponMana")
registerCreatureEvent(cid, "showVoc")       
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "Outfit")
registerCreatureEvent(cid, "MonsteDeath")
registerCreatureEvent(cid, "ExameJouninDead")
registerCreatureEvent(cid, "ExameJouninBoss")
setPlayerStorageValue(cid, 8855, -1)
registerCreatureEvent(cid, "Senha")
registerCreatureEvent(cid, "eventotimes")
registerCreatureEvent(cid, "ExpBonus")
registerCreatureEvent(cid, "report")
registerCreatureEvent(cid, "attackguild")
registerCreatureEvent(cid, "DeathHP")
registerCreatureEvent(cid, "FirstItems")
registerCreatureEvent(cid, "Reward")
registerCreatureEvent(cid, "KamuiMuzan")
registerCreatureEvent(cid, "UP")
registerCreatureEvent(cid, "Niwdeath")
registerCreatureEvent(cid, "Izanagi")
-----------GRAN CASTLE -----------
registerCreatureEvent(cid, "Gran Tower")
registerCreatureEvent(cid, "Gran Aura")
registerCreatureEvent(cid, "Gran Aura Stats")
registerCreatureEvent(cid, "Gran Aura Logout")
registerCreatureEvent(cid, "Gran Tower Target")
--- CRITICAL SYSTEM ----
registerCreatureEvent(cid, "critical")
if getPlayerStorageValue(cid, 48903) == -1 then
        setPlayerStorageValue(cid, 48903, 0) 
    end
---------- PlayerPort---------------
if getPlayerStorageValue(cid, 49708) ~= 0 then
        setPlayerStorageValue(cid, 49708, 0) 
end
        if getPlayerGuildId(cid) > 0 then
             local guild = getPlayerGuildId(cid)
            doGuildAddEnemy(guild, enemy, 0, WAR_GUILD)
        else
        end
 return true
end

 

 

O rei de seu proprio destino é aquele que luta pela gloria do amanhã!
Discord : ZoR#9373


 

Postado
27 minutos atrás, ZikaLord disse:

eu troquei mas mesmo assim da pra atacar.

 

Meu Login.lua

  Ocultar conteúdo


local config = {
 loginMessage = getConfigValue('loginMessage'),
 useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
boost.addSkills(cid)
 local loss = getConfigValue('deathLostPercent')
 if(loss ~= nil) then
  doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
 end



 local accountManager = getPlayerAccountManager(cid)
 if(accountManager == MANAGER_NONE) then
  local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
  if(lastLogin > 0) then
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
   str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
  end

  doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
 elseif(accountManager == MANAGER_NAMELOCK) then
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
 elseif(accountManager == MANAGER_ACCOUNT) then
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
 else
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
 end

 if(not isPlayerGhost(cid)) then
  doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
 end

 registerCreatureEvent(cid, "Mail")
 registerCreatureEvent(cid, "GuildMotd")

 registerCreatureEvent(cid, "Idle")
 if(config.useFragHandler) then
  registerCreatureEvent(cid, "SkullCheck")
 end
registerCreatureEvent(cid, "Biohazard")
registerCreatureEvent(cid, "ZombieAttack")
registerCreatureEvent(cid, "WeaponMana")
registerCreatureEvent(cid, "showVoc")       
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "Outfit")
registerCreatureEvent(cid, "MonsteDeath")
registerCreatureEvent(cid, "ExameJouninDead")
registerCreatureEvent(cid, "ExameJouninBoss")
setPlayerStorageValue(cid, 8855, -1)
registerCreatureEvent(cid, "Senha")
registerCreatureEvent(cid, "eventotimes")
registerCreatureEvent(cid, "ExpBonus")
registerCreatureEvent(cid, "report")
registerCreatureEvent(cid, "attackguild")
registerCreatureEvent(cid, "DeathHP")
registerCreatureEvent(cid, "FirstItems")
registerCreatureEvent(cid, "Reward")
registerCreatureEvent(cid, "KamuiMuzan")
registerCreatureEvent(cid, "UP")
registerCreatureEvent(cid, "Niwdeath")
registerCreatureEvent(cid, "Izanagi")
-----------GRAN CASTLE -----------
registerCreatureEvent(cid, "Gran Tower")
registerCreatureEvent(cid, "Gran Aura")
registerCreatureEvent(cid, "Gran Aura Stats")
registerCreatureEvent(cid, "Gran Aura Logout")
registerCreatureEvent(cid, "Gran Tower Target")
--- CRITICAL SYSTEM ----
registerCreatureEvent(cid, "critical")
if getPlayerStorageValue(cid, 48903) == -1 then
        setPlayerStorageValue(cid, 48903, 0) 
    end
---------- PlayerPort---------------
if getPlayerStorageValue(cid, 49708) ~= 0 then
        setPlayerStorageValue(cid, 49708, 0) 
end
        if getPlayerGuildId(cid) > 0 then
             local guild = getPlayerGuildId(cid)
            doGuildAddEnemy(guild, enemy, 0, WAR_GUILD)
        else
        end
 return true
end

 

 

Pode ser o case sensitive do linux.

 

no script q te passei tem essa parte:

  registerCreatureEvent(cid, "pvptarget")
  registerCreatureEvent(cid, "pvpstats")

 

troque por essa por essa:

 

registerCreatureEvent(cid, "PvPTarget")

registerCreatureEvent(cid, "PvPStats")

 

 

 

Host bom para hospedar seu jogo => https://shre.ink/OminiHost

 

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