ricardocisneiro 0 Postado Novembro 26, 2015 Share Postado Novembro 26, 2015 Ola pessoal estou com 1 problema com meu Duel System quando coloco para duelar e escolho a quantidade de pokemons abre 1 aba de chat com a quantidade de pokemons e não inicia duelo... vou colocar meu duel system.lua para vcs verem function checkDuel(cid)if getPlayerStorageValue(cid, 52481) >= 1 thensetPlayerStorageValue(cid, 52481, getPlayerStorageValue(cid, 52481)-1)doSendAnimatedText(getThingPos(cid), "POKE DOWN", 65)endif getPlayerStorageValue(cid, 52481) == 0 then --alterado v1.6.1local sid = getPlayerByName(getPlayerStorageValue(cid, 52482))if isCreature(sid) thenaddEvent(doSendAnimatedText, 1000, getThingPosWithDebug(sid), "Winner", COLOR_ELECTRIC)resetDuelStorages(sid)doCreatureSetSkullType(sid, 0)doRemoveCondition(sid, CONDITION_INFIGHT)endaddEvent(doSendAnimatedText, 1000, getThingPosWithDebug(cid), "Loser", COLOR_BURN)resetDuelStorages(cid)doCreatureSetSkullType(cid, 0)doRemoveCondition(cid, CONDITION_INFIGHT)endendfunction resetDuelStorages(cid)if not isCreature(cid) then return false endsetPlayerStorageValue(cid, 52480, -1)setPlayerStorageValue(cid, 52481, -1)setPlayerStorageValue(cid, 52482, -1)setPlayerStorageValue(cid, 52483, -1)setPlayerStorageValue(cid, 6598754, -1)return trueendfunction beginDuel(cid, pid, n)if not isCreature(cid) or not isCreature(pid) then return true endif n == 0 thensetPlayerStorageValue(cid, 6598754, 10)setPlayerStorageValue(cid, 52482, getCreatureName(pid))doSendAnimatedText(getThingPosWithDebug(cid), "START", 215)doSendAnimatedText(getThingPosWithDebug(pid), "START", 215)return true --alterado v1.6.1elsedoSendAnimatedText(getThingPosWithDebug(cid), ""..n.."!", 215)n = n-1endaddEvent(beginDuel, 1000, cid, pid, n)endfunction endInviting(cid)if isCreature(cid) and getPlayerStorageValue(cid, 52483) == 0 thensetPlayerStorageValue(cid, 52480, -1) --sto de duelosetPlayerStorageValue(cid, 52481, -1) --sto de pokes no duelsetPlayerStorageValue(cid, 52482, -1) --sto do player q vai duela contigo --alterado v1.6 duel systemsetPlayerStorageValue(cid, 52483, -1) --sto de aceitaçao de duelsetPlayerStorageValue(cid, 6598754, -1) --sto do canAttackOtherdoCreatureSetSkullType(cid, 0)doPlayerSendTextMessage(cid, 20, "The other player don't accepted the duel...")endend up Link para o comentário Compartilhar em outros sites More sharing options...
Deadpool 862 Postado Novembro 26, 2015 Share Postado Novembro 26, 2015 Adicionou o arquivo no creaurescript? "Tvsys" Link para o comentário Compartilhar em outros sites More sharing options...
ricardocisneiro 0 Postado Novembro 27, 2015 Autor Share Postado Novembro 27, 2015 Adicionou o arquivo no creaurescript? "Tvsys" Não teria como me enviar o arquivo? [26/11/2015 14:33:58] [Error - CreatureScript Interface] [26/11/2015 14:33:58] data/creaturescripts/scripts/tvsys.lua:onJoinChannel [26/11/2015 14:33:58] Description: [26/11/2015 14:33:58] data/creaturescripts/scripts/tvsys.lua:34: attempt to index a number value [26/11/2015 14:33:58] stack traceback: [26/11/2015 14:33:58] data/creaturescripts/scripts/tvsys.lua:34: in function Adicionei o arquivo que peguei de 1 outro PDA e da o serguinte erro na Distro @Up @Up Link para o comentário Compartilhar em outros sites More sharing options...
Deadpool 862 Postado Novembro 27, 2015 Share Postado Novembro 27, 2015 Manda a linha 34.. Link para o comentário Compartilhar em outros sites More sharing options...
ricardocisneiro 0 Postado Novembro 30, 2015 Autor Share Postado Novembro 30, 2015 tvsys.lua function onJoinChannel(cid, channelId, users, isTv)if channelId == 10 thendoShowPokemonStatistics(cid)return falseendif channelId == 11 thenif reloadHighscoresWhenUsingPc thendoReloadHighscores()enddoPlayerPopupFYI(cid, getHighscoreString(8))return falseendif channelId == 12 thenif reloadHighscoresWhenUsingPc thendoReloadHighscores()enddoPlayerPopupFYI(cid, getHighscoreString(6))return falseend--////////////////////////////////////////////////////////////////////////////////////////--if channelId >= 19 and channelId <= 21 then --alterado v1.8 \/setPlayerStorageValue(cid, 52480, (channelId-18))setPlayerStorageValue(cid, 52484, ((channelId-18)*2)-1)doSendAnimatedText(getThingPosWithDebug(cid), (channelId-18).."x"..(channelId-18), COLOR_BURN)doPlayerSetVocation(cid, 8)openChannelDialog(cid)return falseendif channelId >= 13 and channelId <= 18 thenlocal sid = getPlayerByName(getPlayerStorageValue(cid, 52483):match("(.*),"))---------------- Proteçao para ter um oponente valido!if not isCreature(sid) thendoPlayerSendTextMessage(cid, 20, "The other player isn't online! Duel is canceled!")doPlayerSetVocation(cid, 1)for i = 1, #storagesDuel dosetPlayerStorageValue(cid, storagesDuel, -1)enddoCreatureSetSkullType(cid, 0)return falseend---------------- Proteçao para os 2 players terem a qntdade de pokes pro duellocal pokes1 = getLivePokeballs(cid, getPlayerSlotItem(cid, 3).uid, true)local pokes2 = getLivePokeballs(sid, getPlayerSlotItem(sid, 3).uid, true)if #pokes1 < (channelId-12) or #pokes2 < (channelId-12) thenlocal tpw = getPlayerStorageValue(cid, 52480) > 1 and "ally" or "opponent"doPlayerSendTextMessage(cid, 20, "You or your "..tpw.." doesn't have that amount of pokemons in their bags! Duel are canceled!")doPlayerSetVocation(cid, 1)for i = 1, #storagesDuel dosetPlayerStorageValue(cid, storagesDuel, -1)enddoCreatureSetSkullType(cid, 0)return falseend----------------if getPlayerStorageValue(cid, 52480) > 1 thensetPlayerStorageValue(cid, 52482, getPlayerStorageValue(cid, 52482).. getCreatureName(sid)..",")setPlayerStorageValue(cid, 52483, "")end----------------doSendAnimatedText(getThingPos(cid), (channelId-12).." Poke"..(channelId > 13 and "s" or ""), COLOR_BURN)setPlayerStorageValue(cid, 52481, (channelId-12))setPlayerStorageValue(sid, 52485, getCreatureName(cid))setPlayerStorageValue(sid, 52481, (channelId-12))local players, pokes = getPlayerStorageValue(cid, 52480), getPlayerStorageValue(cid, 52481)local str = {} --alterado v1.9 \/table.insert(str, getCreatureName(cid).." is inviting you to a duel! Use order in him to accept it!\n")table.insert(str, "Info Battle: Duel "..players.."x"..players.." - "..pokes.." pokes.")doPlayerSendTextMessage(sid, 20, table.concat(str))addEvent(doSendAnimatedText, 1000, getThingPos(cid), "BATTLE", COLOR_ELECTRIC)doPlayerSetVocation(cid, 1)return falseend--////////////////////////////////////////////////////////////////////////////////////////--if channelId >= 100 and channelId <= 10000 thenlocal owner = getPlayerByGUID(getChannelOwner(channelId))if isChannelTv(channelId) thenif isCreature(owner) thenif owner ~= cid thendoPlayerWatchOther(cid, owner)local plural = #users == 1 and "" or "s"doPlayerSendChannelMessage(owner, "TV Channel", getCreatureName(cid)..' is now watching your channel (currently '..#users..' player'..plural..' watching this channel).', 15, channelId)elsesetPlayerStorageValue(cid, 99284, 1)endendelseif owner == cid thensetPlayerStorageValue(cid, 99284, 2)endreturn trueendreturn trueendfunction onLeaveChannel(cid, channelId, users)if channelId >= 100 and channelId <= 10000 thenlocal owner = getPlayerByGUID(getChannelOwner(channelId))if isChannelTv(channelId) thenif owner ~= cid and getCreatureOutfit(cid).lookType == 814 thendoPlayerStopWatching(cid)local plural = #users == 2 and "" or "s"doPlayerSendChannelMessage(owner, "TV Channel", getCreatureName(cid)..' is not watching your channel anymore (currently '..#users - (1)..' player'..plural..' watching this channel).', 15, channelId)elseif owner == cid thensetPlayerStorageValue(cid, 99284, -1)doSendAnimatedText(getThingPos(cid), "CAM OFF", 180)for stops = 1, #users doif users[stops] ~= owner thendoPlayerStopWatching(users[stops])endendendelseif owner == cid thensetPlayerStorageValue(cid, 99284, -1)endreturn trueendreturn trueendfunction onWalk(cid, fromPosition, toPosition)-- Código não é mais necessário, feito em c++-- Code deprecated, made in c++--if not canWalkOnPos(toPosition, false, false, false, true, false) and getPlayerStorageValue(cid, 17000) >= 1 then-- doTeleportThing(cid, fromPosition, false)-- doPlayerSendCancel(cid, "Sorry, not possible.")--endif getPlayerStorageValue(cid, 99284) <= 0 then return true endlocal speed = getCreatureSpeed(cid)local a = getWatchingPlayersFromPos(cid, fromPosition)for b = 1, #a doif getCreatureSpeed(a) ~= speed thendoChangeSpeed(a, - getCreatureSpeed(a))doChangeSpeed(a, speed)enddoTeleportThing(a, toPosition, true)endreturn trueendlocal permited = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s","t", "u", "v", "x", "w", ",", "'", '"',"y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", ".", "!", "@", "#", "$", "%", "&", "*", "(", ")","-", "_", "+", "/", ";", ":", "?", "^", "~", "{", "[", "}", "]", ">", "<", "£", "¢", "¬"}function onTextEdit(cid, item, newText)if item.itemid == 12330 thenif getPlayerStorageValue(cid, 99284) >= 1 thendoPlayerSendCancel(cid, "You are already on air!")return falseendlocal channelName = getCreatureName(cid).."'s TV Channel"if string.len(newText) <= 0 thendoPlayerSendCancel(cid, "Your channel is going to be shown as \""..getCreatureName(cid).."'s TV Channel\".")elseif string.len(newText) > 25 thendoPlayerSendCancel(cid, "Your channel name can't have more than 25 characters.")return falseelsechannelName = newTextendsetPlayerStorageValue(cid, 99284, 1)setPlayerStorageValue(cid, 99285, "")setPlayerStorageValue(cid, 99285, channelName)doPlayerCreatePrivateChannel(cid, channelName)doSendAnimatedText(getThingPos(cid), "ON AIR!", COLOR_GRASS)return falseendreturn trueend Manda a linha 34.. up Link para o comentário Compartilhar em outros sites More sharing options...
ricardocisneiro 0 Postado Dezembro 4, 2015 Autor Share Postado Dezembro 4, 2015 up+ Link para o comentário Compartilhar em outros sites More sharing options...
ricardocisneiro 0 Postado Dezembro 7, 2015 Autor Share Postado Dezembro 7, 2015 up+ Link para o comentário Compartilhar em outros sites More sharing options...
Stigal 584 Postado Abril 21, 2018 Share Postado Abril 21, 2018 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 More sharing options...
Posts Recomendados