não falta algo nisso
doPlayerSetStorageValue(cid, 438209)
sera assim
doPlayerSetStorageValue(cid, 438209, 1)?
Por Gabriel Netto, 27 de jul. de 2016 em Scripts
não falta algo nisso
doPlayerSetStorageValue(cid, 438209)
sera assim
doPlayerSetStorageValue(cid, 438209, 1)?
info
Grupo: Barão
Registrado: 04/07/16
Posts: 242
Reputação: +100
Gênero: Masculino

info
Grupo: Herói
Registrado: 07/03/16
Posts: 1.4k
Reputação: +385
Gênero: Masculino

Muda o nome da função para: setPlayerStorageValue(cid,key,value)
4 horas atrás, Gabriel Netto disse:
estranho testa assim
local master = getCreatureMaster(cid) or cid
doPlayerSetStorageValue(master, 438209, 1)
obs: setPlayerStorageValue e a própria doPlayerSetStorageValue
Editado Julho 27 por nociam
info
Grupo: Diretor
Registrado: 12/05/12
Posts: 818
Reputação: +578
Gênero: Masculino
Char no Tibia: [ADM] Night

function onStepIn(cid, item, position, fromPosition) local inicialitem = {2175, 2190, 2651, 2461, 2649, 2643, 2050, 1988, 2120} if getPlayerLevel(cid) < 8 then if getPlayerVocation(cid) ~= 1 then doPlayerSetVocation(cid, 1) doPlayerSendCancel(cid, "você virou um Sorcerer") doPlayerSendTextMessage(cid, 22, "Você virou um poderoso mago. Magos dominam os elementos mais rebeldes da natureza, sendo eles o fogo e a energia. Inicialmente, eles sabem as magias: ...") doSendMagicEffect(getThingPos(cid), 10) if getPlayerStorageValue(cid, 438209) == -1 then for i = 1, #inicialitem, 1 do doPlayerAddItem(cid, inicialitem[i]) i = i + 1 end setPlayerStorageValue(cid, 438209, 1) return false end if getPlayerStorageValue(cid, 328190) == -1 then doPlayerAddItem(cid, 7620, 10) doPlayerAddItem(cid, 8704, 2) setPlayerStorageValue(cid, 328190, 1) return false end else doPlayerSendCancel(cid, "você já é um sorcerer") end else doPlayerSendTextMessage(cid, 22, "Você já ultrapassou o nível 7 e não pode mais testar as vocações. Fale com a Sara.") endreturn trueend
info
Grupo: Barão
Registrado: 04/07/16
Posts: 242
Reputação: +100
Gênero: Masculino

6 horas atrás, nociam disse:estranho testa assim
local master = getCreatureMaster(cid) or cid
doPlayerSetStorageValue(master, 438209, 1)
obs: setPlayerStorageValue e a própria doPlayerSetStorageValue
Brother, se getCreatureMaster(cid) equivale a cid não tem pra quê eu alocar numa variável. Só vai pesar no processador ehaueah.
4 horas atrás, Yan Liima disse:
Spoiler
function onStepIn(cid, item, position, fromPosition) local inicialitem = {2175, 2190, 2651, 2461, 2649, 2643, 2050, 1988, 2120} if getPlayerLevel(cid) < 8 then if getPlayerVocation(cid) ~= 1 then doPlayerSetVocation(cid, 1) doPlayerSendCancel(cid, "você virou um Sorcerer") doPlayerSendTextMessage(cid, 22, "Você virou um poderoso mago. Magos dominam os elementos mais rebeldes da natureza, sendo eles o fogo e a energia. Inicialmente, eles sabem as magias: ...") doSendMagicEffect(getThingPos(cid), 10) if getPlayerStorageValue(cid, 438209) == -1 then for i = 1, #inicialitem, 1 do doPlayerAddItem(cid, inicialitem[i]) i = i + 1 end setPlayerStorageValue(cid, 438209, 1) return false end if getPlayerStorageValue(cid, 328190) == -1 then doPlayerAddItem(cid, 7620, 10) doPlayerAddItem(cid, 8704, 2) setPlayerStorageValue(cid, 328190, 1) return false end else doPlayerSendCancel(cid, "você já é um sorcerer") end else doPlayerSendTextMessage(cid, 22, "Você já ultrapassou o nível 7 e não pode mais testar as vocações. Fale com a Sara.") endreturn trueend
O problema é que eu tava pondo o "1" no get e não no set, ehauehuahe
Agora funcionou direitin, valeu, amanhã te dou rep+, já tô no limite de hoje <3
@EDIT: queria ajuda em outra coisa. Eu fiz meio que uma gambiarra aí pros itens não irem parar no "lugar errado". Como eu defino pra qual slot vai ir o item? Como eu to usando o tfs 0.4 não tem definição de item pras hands ehaheaheu, e se alguém souber como modificar isso nas sources, agradeço duplamente
Editado Julho 28 por Gabriel Netto
info
Grupo: Barão
Registrado: 04/07/16
Posts: 242
Reputação: +100
Gênero: Masculino
E aí galera, beleza?
Vim pedir ajuda com um script nesse tópico. Não, não é um pedido de script ehaueahu.
Faz o maior tempo que não scripto, aí resolvi fazer um só pra aquecer e de quebra usar. O que ele faz? É um onStepIn, ele vê o lvl, a vocation, troca ela, se não tiver o storage dá os mana potions e se não tiver o storage dá um set. É bem parecido com o script de dawnport.
Funciona tudo certinho, o set é criado, e os pots tmb. Mas não seta as storages e o player consegue farmar os equips. O foda é que nem erro na distro dá, e creio que não seja erro no código. Suponho que seja na db, mas slá, olhem o code:
function onStepIn(cid, item, position, fromPosition) local inicialitem = { 2175, 2190, 2651, 2461, 2649, 2643, 2050, 1988, 2120} if getPlayerLevel(cid) < 8 then if getPlayerVocation(cid) ~= 1 then doPlayerSetVocation(cid, 1) doPlayerSendCancel(cid, "você virou um Sorcerer") doPlayerSendTextMessage(cid, 22, "Você virou um poderoso mago. Magos dominam os elementos mais rebeldes da natureza, sendo eles o fogo e a energia. Inicialmente, eles sabem as magias: ...") doSendMagicEffect(getThingPos(cid), 10) if (getPlayerStorageValue(cid, 438209)) == -1 then for i = 1, #inicialitem, 1 do doPlayerAddItem(cid, inicialitem[i]) i = i + 1 end doPlayerSetStorageValue(cid, 438209) return false end if (getPlayerStorageValue(cid, 328190)) == -1 then doPlayerAddItem(cid, 7620, 10) doPlayerAddItem(cid, 8704, 2) doPlayerSetStorageValue(cid, 328190) return false end else doPlayerSendCancel(cid, "você já é um sorcerer") end else doPlayerSendTextMessage(cid, 22, "Você já ultrapassou o nível 7 e não pode mais testar as vocações. Fale com a Sara.") endreturn trueend