Ir para conteúdo
  • 0

[Duvida] Estou Com Um Problema!


LeoTK

Pergunta

BOM GALERA ESTOU COM UM PROBLEMA EU COLOQUEI SYSTEMA VIP NO MEU OT POR .!BUYVIP MAIS QUANDO A PESSOA COMPRA O VIP O NOME DELA FICA [Vip] NOME DA PESSOA AI QUE TA O PROBLEMA A PESSOA QUANDO COMPRA VIP NAO PODE USAR O POKEMON INICIAL QUE FALA QUE NAO PERTENCA A ELA COMO FASSO PRA ARRUMAR ISSO???

 

+rep

 

"SE ESTIVER NA AREA ERRADO FAVOR DE MOVER OBRIGADO"

 

mdr.gifmdr.gifmdr.gifmdr.gifmdr.gifmdr.gif

Link para o comentário
Compartilhar em outros sites

10 respostass a esta questão

Posts Recomendados

  • 0

local hitmonchans = {

["Hitmonchan"] = {

[0] = {out = 559, eff = 112, type = FIGHTINGDAMAGE}, --outfit normal

[1] = {out = 1075, eff = 35, type = FIREDAMAGE}, --outfit fogo

[2] = {out = 1077, eff = 48, type = ELECTRICDAMAGE}, --outfit raio

[3] = {out = 1078, eff = 43, type = ICEDAMAGE}, --outfit gelo

[4] = {out = 1076, eff = 140, type = GHOSTDAMAGE} --outfit ghost

},

 

["Shiny Hitmonchan"] = {

--aconcelho trocar a outfit do shiny hitmonchan pela do elite hitmonchan do PO...

[0] = {out = 837, eff = 112, type = FIGHTINGDAMAGE}, --outfit normal

[1] = {out = 1080, eff = 35, type = FIREDAMAGE}, --outfit fogo

[2] = {out = 1081, eff = 48, type = ELECTRICDAMAGE}, --outfit raio

[3] = {out = 1082, eff = 43, type = ICEDAMAGE}, --outfit gelo

[4] = {out = 1079, eff = 140, type = GHOSTDAMAGE} --outfit ghost

}

}

function onUse(cid, item, frompos, item2, topos)

 

if exhaustion.get(cid, 6666) and exhaustion.get(cid, 6666) > 0 then return true end

 

local owner = getItemAttribute(item.uid, "firstpoke")

 

if owner and owner ~= getCreatureName(cid) then

doPlayerSendCancel(cid, "This pokemon belongs to "..owner..", it is his first pokemon. Please, give it back to him.")

return true

end

 

if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then

return true

end

 

local btype = getPokeballType(item.itemid)

 

local effect = pokeballs[btype].effect

if not effect then

effect = 21

end

 

if item.itemid == pokeballs[btype].use then

 

if getPlayerStorageValue(cid, 990) == 1 then -- GYM

doPlayerSendCancel(cid, "You can't return your pokemon during gym battles.")

return true

end

 

if #getCreatureSummons(cid) <= 0 then

if isInArray(pokeballs[btype].all, item.itemid) then

doTransformItem(item.uid, pokeballs[btype].off)

doItemSetAttribute(item.uid, "hp", 0)

doPlayerSendCancel(cid, "This pokemon is fainted.")

return true

end

end

 

local z = getCreatureSummons(cid)[1]

 

if getCreatureCondition(z, CONDITION_INVISIBLE) and not isGhostPokemon(z) then

return true

end

 

doReturnPokemon(cid, z, item, effect)

 

elseif item.itemid == pokeballs[btype].on then

 

if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then

doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")

return TRUE

end

 

local thishp = getItemAttribute(item.uid, "hp")

 

if thishp <= 0 then

if isInArray(pokeballs[btype].all, item.itemid) then

doTransformItem(item.uid, pokeballs[btype].off)

doItemSetAttribute(item.uid, "hp", 0)

doPlayerSendCancel(cid, "This pokemon is fainted.")

return true

end

end

 

local pokemon = getItemAttribute(item.uid, "poke")

 

if not pokes[pokemon] then

return true

end

 

local x = pokes[pokemon]

local boosts = getItemAttribute(item.uid, "boost") or 0

 

if getPlayerLevel(cid) + pokemonMaxLevelAbovePlayer < getItemAttribute(item.uid, "level") + boosts then

doPlayerSendCancel(cid, "Your pokemon's level is much higher than yours, you can't use him.")

return true

end

 

doSummonMonster(cid, pokemon)

 

local pk = getCreatureSummons(cid)[1]

if not isCreature(pk) then return true end

------------------------passiva hitmonchan------------------------------

if isSummon(pk) then

--local e = getCreatureMaster(cid)

local nameHIT = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke")

local hands = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "hands")

if nameHIT == "Shiny Hitmonchan" or nameHIT == "Hitmonchan" then

if getItemAttribute(getPlayerSlotItem(cid, 8).uid, "hands") then

doSetCreatureOutfit(pk, {lookType = hitmonchans[nameHIT][hands].out}, -1)

else

doPlayerSendTextMessage(cid, 27, "Contact a GameMaster! Error in passive system! Attribute \"hands\" missing")

end

end

end

-------------------------------------------------------------------------

 

if getCreatureName(pk) == "Ditto" then

 

local left = getItemAttribute(item.uid, "transLeft")

local name = getItemAttribute(item.uid, "transName")

 

if left and left > 0 then

setPlayerStorageValue(pk, 1010, name)

doSetCreatureOutfit(pk, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1)

addEvent(deTransform, left * 1000, pk, getItemAttribute(item.uid, "transTurn"))

doItemSetAttribute(item.uid, "transBegin", os.clock())

else

setPlayerStorageValue(pk, 1010, "Ditto")

end

end

 

if isGhostPokemon(pk) then doTeleportThing(pk, getPosByDir(getThingPos(cid), math.random(0, 7)), false) end

 

doCreatureSetLookDir(pk, 2)

 

adjustStatus(pk, item.uid, true, false, true)

doAddPokemonInOwnList(cid, pokemon)

 

doTransformItem(item.uid, item.itemid+1)

 

local pokename = getItemAttribute(item.uid, "nick") or getCreatureName(pk)

 

local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)

doCreatureSay(cid, mgo, TALKTYPE_SAY)

 

doSendMagicEffect(getCreaturePosition(pk), effect)

 

else

 

doPlayerSendCancel(cid, "This pokemon is fainted.")

 

end

 

if useKpdoDlls then

doUpdateMoves(cid)

end

return true

end

 

<p>a otra</p>

<p> </p>

<p> </p>

<div>function onLogout(cid)</div>

<div> </div>

<div>if getPlayerStorageValue(cid, 888) >= 1 then</div>

<div>doPlayerSendCancel(cid, "You cant logout during control mind.")</div>

<div>return false</div>

<div>end</div>

<div> </div>

<div>local summon = getCreatureSummons(cid)[1]</div>

<div>local thisitem = getPlayerSlotItem(cid, 8)</div>

<div>local btype = getPokeballType(thisitem.itemid)</div>

<div> </div>

<div>if #getCreatureSummons(cid) == 1 and thisitem.uid > 1 then</div>

<div>doItemSetAttribute(thisitem.uid, "hp", getCreatureHealth(summon) / getCreatureMaxHealth(summon))</div>

<div>doTransformItem(thisitem.uid, pokeballs[btype].on)</div>

<div> </div>

<div>doSendMagicEffect(getThingPos(summon), pokeballs[btype].effect)</div>

<div>doRemoveCreature(summon)</div>

<div>end</div>

<div> </div>

<div>if getCreatureOutfit(cid).lookType == 814 then</div>

<div>doPlayerStopWatching(cid)</div>

<div>end</div>

<div> </div>

<div>if getPlayerStorageValue(cid, 17000) >= 1 then</div>

<div>markFlyingPos(cid, getThingPos(cid))</div>

<div>end</div>

<div> </div>

<div>return TRUE</div>

<div>end</div>

<div> </div>

<div>local deathtexts = {"Oh no! POKENAME, come back!", "Come back, POKENAME!", "That's enough, POKENAME!", "You did well, POKENAME!",</div>

<div>   "You need to rest, POKENAME!", "Nice job, POKENAME!", "POKENAME, you are too hurt!"}</div>

<div> </div>

<div>function onDeath(cid, deathList)</div>

<div> </div>

<div>local owner = getCreatureMaster(cid)</div>

<div> </div>

<div>local thisball = getPlayerSlotItem(owner, 8)</div>

<div>local btype = getPokeballType(thisball.itemid)</div>

<div> </div>

<div>doSendMagicEffect(getThingPos(cid), pokeballs[btype].effect)</div>

<div>doTransformItem(thisball.uid, pokeballs[btype].off)</div>

<div> </div>

<div>doPlayerSendTextMessage(owner, 22, "Your pokemon fainted.")</div>

<div> </div>

<div>local say = deathtexts[math.random(#deathtexts)]</div>

<div>say = string.gsub(say, "POKENAME", getCreatureName(cid))</div>

<div> </div>

<div>if getPlayerStorageValue(cid, 33) <= 0 then</div>

<div>doCreatureSay(owner, say, TALKTYPE_SAY)</div>

<div>end</div>

<div> </div>

<div>doItemSetAttribute(thisball.uid, "hp", 0)</div>

<div>doItemSetAttribute(thisball.uid, "happy", getPlayerStorageValue(cid, 1008) - happyLostOnDeath)</div>

<div>doItemSetAttribute(thisball.uid, "hunger", getPlayerStorageValue(cid, 1009))</div>

<div> </div>

<div>doRemoveCreature(cid)</div>

<div> </div>

<div>return false</div>

<div>end</div>

 

Link para o comentário
Compartilhar em outros sites

  • 0

troca essa linha:

if owner and owner ~= getCreatureName(cid) then

 

por essa

if owner and owner ~= getCreatureName(cid) and owner =~ "[Vip] "..getCreatureName(cid) then
Editado por Eskylo
Link para o comentário
Compartilhar em outros sites

  • 0

valeu vo tenta

 

obrigado +rep pra tu

 

ahhhh nao deu certo aparece "you canoot use this object"

 

 

local hitmonchans = {

["Hitmonchan"] = {

[0] = {out = 559, eff = 112, type = FIGHTINGDAMAGE}, --outfit normal

[1] = {out = 1075, eff = 35, type = FIREDAMAGE}, --outfit fogo

[2] = {out = 1077, eff = 48, type = ELECTRICDAMAGE}, --outfit raio

[3] = {out = 1078, eff = 43, type = ICEDAMAGE}, --outfit gelo

[4] = {out = 1076, eff = 140, type = GHOSTDAMAGE} --outfit ghost

},

 

["Shiny Hitmonchan"] = {

--aconcelho trocar a outfit do shiny hitmonchan pela do elite hitmonchan do PO...

[0] = {out = 837, eff = 112, type = FIGHTINGDAMAGE}, --outfit normal

[1] = {out = 1080, eff = 35, type = FIREDAMAGE}, --outfit fogo

[2] = {out = 1081, eff = 48, type = ELECTRICDAMAGE}, --outfit raio

[3] = {out = 1082, eff = 43, type = ICEDAMAGE}, --outfit gelo

[4] = {out = 1079, eff = 140, type = GHOSTDAMAGE} --outfit ghost

}

}

function onUse(cid, item, frompos, item2, topos)

if exhaustion.get(cid, 6666) and exhaustion.get(cid, 6666) > 0 then return true end

local owner = getItemAttribute(item.uid, "firstpoke")

if owner and owner ~= getCreatureName(cid) and owner =~ "[Vip] "..getCreatureName(cid) then

doPlayerSendCancel(cid, "This pokemon belongs to "..owner..", it is his first pokemon. Please, give it back to him.")

return true

end

if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then

return true

end

local btype = getPokeballType(item.itemid)

local effect = pokeballs[btype].effect

if not effect then

effect = 21

end

if item.itemid == pokeballs[btype].use then

if getPlayerStorageValue(cid, 990) == 1 then -- GYM

doPlayerSendCancel(cid, "You can't return your pokemon during gym battles.")

return true

end

if #getCreatureSummons(cid) <= 0 then

if isInArray(pokeballs[btype].all, item.itemid) then

doTransformItem(item.uid, pokeballs[btype].off)

doItemSetAttribute(item.uid, "hp", 0)

doPlayerSendCancel(cid, "This pokemon is fainted.")

return true

end

end

local z = getCreatureSummons(cid)[1]

if getCreatureCondition(z, CONDITION_INVISIBLE) and not isGhostPokemon(z) then

return true

end

doReturnPokemon(cid, z, item, effect)

elseif item.itemid == pokeballs[btype].on then

if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then

doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")

return TRUE

end

local thishp = getItemAttribute(item.uid, "hp")

if thishp <= 0 then

if isInArray(pokeballs[btype].all, item.itemid) then

doTransformItem(item.uid, pokeballs[btype].off)

doItemSetAttribute(item.uid, "hp", 0)

doPlayerSendCancel(cid, "This pokemon is fainted.")

return true

end

end

local pokemon = getItemAttribute(item.uid, "poke")

if not pokes[pokemon] then

return true

end

local x = pokes[pokemon]

local boosts = getItemAttribute(item.uid, "boost") or 0

if getPlayerLevel(cid) + pokemonMaxLevelAbovePlayer < getItemAttribute(item.uid, "level") + boosts then

doPlayerSendCancel(cid, "Your pokemon's level is much higher than yours, you can't use him.")

return true

end

doSummonMonster(cid, pokemon)

local pk = getCreatureSummons(cid)[1]

if not isCreature(pk) then return true end

------------------------passiva hitmonchan------------------------------

if isSummon(pk) then

--local e = getCreatureMaster(cid)

local nameHIT = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke")

local hands = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "hands")

if nameHIT == "Shiny Hitmonchan" or nameHIT == "Hitmonchan" then

if getItemAttribute(getPlayerSlotItem(cid, 8).uid, "hands") then

doSetCreatureOutfit(pk, {lookType = hitmonchans[nameHIT][hands].out}, -1)

else

doPlayerSendTextMessage(cid, 27, "Contact a GameMaster! Error in passive system! Attribute \"hands\" missing")

end

end

end

-------------------------------------------------------------------------

if getCreatureName(pk) == "Ditto" then

local left = getItemAttribute(item.uid, "transLeft")

local name = getItemAttribute(item.uid, "transName")

if left and left > 0 then

setPlayerStorageValue(pk, 1010, name)

doSetCreatureOutfit(pk, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1)

addEvent(deTransform, left * 1000, pk, getItemAttribute(item.uid, "transTurn"))

doItemSetAttribute(item.uid, "transBegin", os.clock())

else

setPlayerStorageValue(pk, 1010, "Ditto")

end

end

if isGhostPokemon(pk) then doTeleportThing(pk, getPosByDir(getThingPos(cid), math.random(0, 7)), false) end

doCreatureSetLookDir(pk, 2)

adjustStatus(pk, item.uid, true, false, true)

doAddPokemonInOwnList(cid, pokemon)

doTransformItem(item.uid, item.itemid+1)

local pokename = getItemAttribute(item.uid, "nick") or getCreatureName(pk)

local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)

doCreatureSay(cid, mgo, TALKTYPE_SAY)

doSendMagicEffect(getCreaturePosition(pk), effect)

else

doPlayerSendCancel(cid, "This pokemon is fainted.")

end

if useKpdoDlls then

doUpdateMoves(cid)

end

return true

end

 

 

 

 

TA DO JEITO QUE TU MANDO

Link para o comentário
Compartilhar em outros sites

  • 0

mals cara, que fail meu...

 

consertei:

if owner and owner ~= getCreatureName(cid) and owner ~= "[Vip] "..getCreatureName(cid) then

 

o certo é sempre ~=

eu tinha colocado =~

aí bugo o script por isso tava dando 'u cannot use'

Link para o comentário
Compartilhar em outros sites

  • 0

O certo mesmo seria

 

if owner and owner ~= getCreatureName(cid) or owner ~= "[Vip] "..getCreatureName(cid) then

 

Se coloca and precisa o nome sem [VIP] ter vip ou seja e bug na certa.

 

Não esqueça

 

"And" signfica "é" se voce querer fazer mais uma verificaçao sendo que as duas seria cobradas

 

"Or" e se um valor for nil ou false no ai ele vai e retorna outra verificaçao

 

 

Se estiver errado não faz mal me pode me corrigir todo mundo erra.

Link para o comentário
Compartilhar em outros sites

  • 0

sim, and significa 'e'

or significa 'ou'

 

nesse script se vc n for o dono entao vai dar diferente nos dois certo, se vc for o dono vai dar certo em um dos dois...

 

por isso q eu coloquei and and pra se der diferente nos dois vai cair em 'essa poke nao é sua'

Link para o comentário
Compartilhar em outros sites

  • 0

Olha tambem dá se usa string.find olha:

 

local owner = getItemAttribute(item.uid, "firstpoke")

 

local name= getPlayerName(cid)

if not string.find(owner, name) then

 

 

E mais pratico.

Link para o comentário
Compartilhar em outros sites

  • 0

mas aí o o jogador de nick ' thor ' poderia usar o poke do cara de nick ' mega thor '

 

pode ser q n ocorra por coniscidencia, mas pode ser q o cara crie pra começar com 2 pokes...

Link para o comentário
Compartilhar em outros sites

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