Ir para conteúdo

[Encerrado] [NPC] NPC SAFFARI PDA


HxRedBully

Posts Recomendados

Alguem poderia me dizer o pq do meu npc saffari tar tirando do saffari apos jogar 1 ball?

focus = 0

talk_start = 0
target = 0
following = false
attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('See ya.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 3 then
selfSay('Olá a entrada no Saffari custará 50DL vc aceita??')
focus = cid
talk_start = os.clock()
elseif (msgcontains(msg, 'yes') ) then
if getPlayerItemCount(cid,2391) >= 1 getPlayerItemCount(cid,2393) >= 1 or getPlayerItemCount(cid,2392) >= 1 or getPlayerItemCount(cid,2394) >= 1 or getPlayerItemCount(cid,12617) >= 1 then
selfSay("Você não pode entrar no Saffari com nenhuma outra ball exceto a Great Ball!! Cya")
focus = 0
talk_start = 0
elseif getPlayerStorageValue(cid, 98796) >= 1 or getPlayerStorageValue(cid, 98797) >= 1 then
selfSay("Você já está na saffari zone!")
focus = 0
talk_start = 0
elseif doPlayerRemoveMoney(cid, 500) then --1000dl --alterado v1.9
setPlayerStorageValue(cid, 98796, 1)
setPlayerStorageValue(cid, 98797, 1)
doPlayerAddItem(cid, 2391, 30) --alterado v1.9
doTeleportThing(cid, SafariEnter)
doSendMagicEffect(getThingPos(cid), 21)
talk_start = os.clock()
else
selfSay("Você não tem dinheiro suficiente") --alterado v1.9
focus = 0
talk_start = 0
end
elseif (msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 3) then
selfSay('Sorry, Im busy at this moment.')
elseif (msgcontains(msg, 'bye') and focus == cid and getDistanceToCreature(cid) < 3) then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('See ya.')
end
focus = 0
end
end

Link para o comentário
Compartilhar em outros sites

Tente usar o meu, aqui está normal.

 

 

 

focus = 0
talk_start = 0
target = 0
following = false
attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('See ya.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 3 then
selfSay('Hello, i can let you enter in the saffari zone for 3000 Dollars, do you accept?')
focus = cid
talk_start = os.clock()
elseif (msgcontains(msg, 'yes') ) then
if getPlayerItemCount(cid,2391) >= 1 or getPlayerItemCount(cid,2394) >= 1 or getPlayerItemCount(cid,2392) >= 1 or getPlayerItemCount(cid,2393) >= 1 then
selfSay("You can't enter in the saffari zone with any type of pokeballs! Cya")
focus = 0
talk_start = 0
elseif getPlayerItemCount(cid,2152) < 30 and getPlayerItemCount(cid,2160) < 1 then
selfSay("You don't have that much of money. Cya")
focus = 0
talk_start = 0
elseif getPlayerStorageValue(cid, 98796) >= 1 or getPlayerStorageValue(cid, 98797) >= 1 then
selfSay("You already are in the saffari zone!")
focus = 0
talk_start = 0
else
setPlayerStorageValue(cid, 98796, 1)
setPlayerStorageValue(cid, 98797, 1)
doPlayerAddItem(cid, 2391, 30)
doPlayerRemoveMoney(cid, 300000)
doTeleportThing(cid, SafariEnter)
doSendMagicEffect(getThingPos(cid), 21)
talk_start = os.clock()
end
elseif (msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 3) then
selfSay('Sorry, Im busy at this moment.')
elseif (msgcontains(msg, 'bye') and focus == cid and getDistanceToCreature(cid) < 3) then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('See ya.')
end
focus = 0
end
end

Link para o comentário
Compartilhar em outros sites

 

Tente usar o meu, aqui está normal.

 

 

 

focus = 0
talk_start = 0
target = 0
following = false
attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('See ya.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 3 then
selfSay('Hello, i can let you enter in the saffari zone for 3000 Dollars, do you accept?')
focus = cid
talk_start = os.clock()
elseif (msgcontains(msg, 'yes') ) then
if getPlayerItemCount(cid,2391) >= 1 or getPlayerItemCount(cid,2394) >= 1 or getPlayerItemCount(cid,2392) >= 1 or getPlayerItemCount(cid,2393) >= 1 then
selfSay("You can't enter in the saffari zone with any type of pokeballs! Cya")
focus = 0
talk_start = 0
elseif getPlayerItemCount(cid,2152) < 30 and getPlayerItemCount(cid,2160) < 1 then
selfSay("You don't have that much of money. Cya")
focus = 0
talk_start = 0
elseif getPlayerStorageValue(cid, 98796) >= 1 or getPlayerStorageValue(cid, 98797) >= 1 then
selfSay("You already are in the saffari zone!")
focus = 0
talk_start = 0
else
setPlayerStorageValue(cid, 98796, 1)
setPlayerStorageValue(cid, 98797, 1)
doPlayerAddItem(cid, 2391, 30)
doPlayerRemoveMoney(cid, 300000)
doTeleportThing(cid, SafariEnter)
doSendMagicEffect(getThingPos(cid), 21)
talk_start = os.clock()
end
elseif (msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 3) then
selfSay('Sorry, Im busy at this moment.')
elseif (msgcontains(msg, 'bye') and focus == cid and getDistanceToCreature(cid) < 3) then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('See ya.')
end
focus = 0
end
end

 

Continua teleportando para fora apos tacar 1 ball C:

Link para o comentário
Compartilhar em outros sites

ola amigo, irei tentar ajudar

 

bom em saffari.lua deleta tudo que tiver la e coloca isso \/

 

focus = 0
talk_start = 0
target = 0
following = false
attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('See ya.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 3 then
selfSay('Hello, i can let you enter in the saffari zone for 500 Dollars, do you accept?')
focus = cid
talk_start = os.clock()
elseif (msgcontains(msg, 'yes') ) then
if getPlayerItemCount(cid,2391) >= 1 or getPlayerItemCount(cid,2394) >= 1 or getPlayerItemCount(cid,2392) >= 1 or getPlayerItemCount(cid,2393) >= 1 or getPlayerItemCount(cid, 12617) >= 1 then
selfSay("You can't enter in the saffari zone with any type of pokeballs! Cya")
focus = 0
talk_start = 0
elseif getPlayerStorageValue(cid, 98796) >= 1 or getPlayerStorageValue(cid, 98797) >= 1 then
selfSay("You already are in the saffari zone!")
focus = 0
talk_start = 0
elseif doPlayerRemoveMoney(cid, 50000) then --500dl --alterado v1.9
setPlayerStorageValue(cid, 98796, 1)
setPlayerStorageValue(cid, 98797, 1)
doPlayerAddItem(cid, 12617, 30) --alterado v1.9
doTeleportThing(cid, SafariEnter)
doSendMagicEffect(getThingPos(cid), 21)
talk_start = os.clock()
else
selfSay("You don't have that much of money. Cya") --alterado v1.9
focus = 0
talk_start = 0
end
elseif (msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 3) then
selfSay('Sorry, Im busy at this moment.')
elseif (msgcontains(msg, 'bye') and focus == cid and getDistanceToCreature(cid) < 3) then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end

function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('See ya.')
end
focus = 0
end
end

 

e no npc leila.xml deixe assim \/

 

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Leila" script="Saffari.lua" walkinterval="0" floorchange="0" access="5" level="100" maglevel="1">
<health now="15" max="15"/>
<look type="495" head="114" body="119" legs="114" feet="114" corpse="3058"/>

<parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME|, what you want?"/>
</parameters>
</npc>

 

assim esta igual o meu e esta funcionando 100% :>

Link para o comentário
Compartilhar em outros sites

No configuration,lua,

pode ter algo haver com seu problema

 

SafariEnter = {x=1592, y=1409, z=6}
SafariOut = {x = 1368, y = 1300, z = 6}
Leila.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Leila" script="Saffari.lua" walkinterval="0" floorchange="0" access="5" level="100" maglevel="1">
<health now="15" max="15"/>
<look type="495" head="114" body="119" legs="114" feet="114" corpse="3058"/>
<parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME|, what you want?"/>
</parameters>
</npc>

Editado por Pokerangers
Link para o comentário
Compartilhar em outros sites

 

No configuration,lua,

pode ter algo haver com seu problema

 

SafariEnter = {x=1592, y=1409, z=6}
SafariOut = {x = 1368, y = 1300, z = 6}
Leila.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Leila" script="Saffari.lua" walkinterval="0" floorchange="0" access="5" level="100" maglevel="1">
<health now="15" max="15"/>
<look type="495" head="114" body="119" legs="114" feet="114" corpse="3058"/>
<parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME|, what you want?"/>
</parameters>
</npc>

 

no configuration são só as cordenadas amigo ^^

Link para o comentário
Compartilhar em outros sites

 

 

No configuration,lua,

pode ter algo haver com seu problema

 

SafariEnter = {x=1592, y=1409, z=6}
SafariOut = {x = 1368, y = 1300, z = 6}
Leila.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Leila" script="Saffari.lua" walkinterval="0" floorchange="0" access="5" level="100" maglevel="1">
<health now="15" max="15"/>
<look type="495" head="114" body="119" legs="114" feet="114" corpse="3058"/>
<parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME|, what you want?"/>
</parameters>
</npc>

 

no configuration são só as cordenadas amigo ^^

 

Sim, eu sei, porem eu tive que arrumar isto no meu servidor,

Eu tinha um problema parecido...

Link para o comentário
Compartilhar em outros sites

@Snix
bom alterei para great ball e continuou saindo apos 1 ball

@Pokerangers
ai seria para mudar entrada/saida ;c
----
pelo visto esta configurado em algum lugar do pda que se tacar ball que n é saffari é teleportado C:

Editado por HxRedBully
Link para o comentário
Compartilhar em outros sites

ve seu arquivo catch.lua e procura por issu

 

if getPlayerStorageValue(cid, 98796) >= 1 and getPlayerItemCount(cid, 12617) <= 0 then --alterado v1.9
setPlayerStorageValue(cid, 98796, -1)
setPlayerStorageValue(cid, 98797, -1)
doTeleportThing(cid, SafariOut, false)
doSendMagicEffect(getThingPos(cid), 21)
doPlayerSendTextMessage(cid, 27, "You spend all your saffari balls, good luck in the next time...")
end
se issu "and getPlayerItemCount(cid, 12617) <= 0 then" nao estiver assim mude
Link para o comentário
Compartilhar em outros sites

  • 4 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...