Removido.
RO
event
Erro LineAnimation Snowball Event
Por royalcalvineitor, 23 de abr. de 2023 em Scripts
snowball
script
erro
animation
3
2.5k
1 ano depois...
23 de dezembro de 2024 às 19:27
Editado Fevereiro 24 por Yan Oliveira
Links de golpe e com vírus
info
Grupo: Cavaleiro
Registrado: 05/10/17
Posts: 185
Reputação: +43
Gênero: Masculino

24 de dezembro de 2024 às 09:13
local Snowtalk = TalkAction("!snowball") function Snowtalk.onSay(cid, words, param, channel) local k = string.split(param, ",") if k[1] ~= nil then if string.upper(k[1]) == 'INFO' then local score = {} local output = "Você tem " .. getPlayerStorageValue(cid, SBW_SCORE) .. " pontos.\nVocê tem " .. getPlayerStorageValue(cid, SBW_AMMO) .. "x munições.\n------------------\nO maior matador:\n" for _, pid in ipairs(getOnlinePlayers()) do if getPlayerStorageValue(pid, SBW_INEVENT) then table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, SBW_SCORE)}) end end local lx = #score if lx > 3 then lx = 3 end table.sort(score, function(a, b) return a[2] > b[2] end) for i = 1, lx do output = output .. i .. ". " .. score[i][1] .. " [" .. score[i][2] .. "].\n" end doPlayerPopupFYI(cid, output) elseif string.upper(k[1]) == 'ATIRAR' then if getPlayerStorageValue(cid, SBW_INEVENT) == 1 and not getTileInfo(getThingPos(cid)).protection then if getPlayerStorageValue(cid, SBW_EXAUSTHED) <= 1 then if getPlayerStorageValue(cid, SBW_AMMO) > 0 then if SBW_STATUS == 'on' then if not SBW_AMMOINFI then setGlobalStorageValue(cid, SBW_AMMO, getPlayerStorageValue(cid, SBW_AMMO) - 1) end setGlobalStorageValue(cid, SBW_EXAUSTHED, 2) lineAnimation(getCreatureDirection(cid), getCreaturePosition(cid), 13, cid, 1, 1, 1, 1, 1, 1, 1, 1) addEvent(setGlobalStorageValue, SBW_SHOOTEXAUSTHED, cid, SBW_EXAUSTHED, 1) if getPlayerStorageValue(cid, SBW_AMMO) ~= 1 then doPlayerSendTextMessage(cid, 27, "Restam " .. getPlayerStorageValue(cid, SBW_AMMO) .. "x bolas de neve.") else doPlayerSendTextMessage(cid, 27, "Usando sua última bola de neve, recarregue.") end end else doPlayerSendCancel(cid, "Você está sem bolas de neve, recarregue no centro do campo ou mate um inimigo.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end else doPlayerPopupFYI(cid, "Acalme-se, você deve esperar para atirar novamente.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return false end else doPlayerPopupFYI(cid, "Você precisa estar dentro do evento ou fora da área protegida.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end end end return true end function lineAnimation(lookDir, playerPos, effect, cid, fvar, fpos, ffound, fposV, fcheck, fvcid, floopCounter, fvpid) local var = fvar local pos = playerPos local found = ffound local posV = fposV local check = fcheck local vcid = fvcid local loopCounter = floopCounter local vpid = fvpid if var < 2 then vcid = cid end pos = playerPos if not isInWallArray(convert(lookDir, pos)) then doSendDistanceShoot(pos, convert(lookDir, pos), effect) pos = convert(lookDir, pos) var = var + 1 posV = convertV(lookDir, playerPos) for _, pid in ipairs(getOnlinePlayers()) do if getCreaturePosition(pid).x == pos.x and getCreaturePosition(pid).y == pos.y and getCreaturePosition(pid).z == pos.z then vpid = pid if vpid ~= vcid then if var > 2 then if getCreaturePosition(pid).x == posV.x and getCreaturePosition(pid).y == posV.y and getCreaturePosition(pid).z == posV.z then killPlayer(pid, pos, vcid) if lookDir == 0 or lookDir == 2 then var = 6 else var = 8 end end end killPlayer(pid, pos, vcid) if lookDir == 0 or lookDir == 2 then var = 6 else var = 8 end end end loopCounter = loopCounter + 1 end if (lookDir == 0 or lookDir == 2) and var ~= 6 then addEvent(lineAnimation, SBW_BALLSPEED, lookDir, pos, effect, nil, var, pos, found, posV, check, vcid, loopCounter, vpid) elseif (lookDir == 1 or lookDir == 3) and var ~= 8 then addEvent(lineAnimation, SBW_BALLSPEED, lookDir, pos, effect, nil, var, pos, found, posV, check, vcid, loopCounter, vpid) else var = 1 end else doSendMagicEffect(convert(lookDir, pos), 2) var = 1 end end function convert(lookDir, pos) local positions = { [0] = {x = pos.x, y = pos.y - 1, z = pos.z}, [1] = {x = pos.x + 1, y = pos.y, z = pos.z}, [2] = {x = pos.x, y = pos.y + 1, z = pos.z}, [3] = {x = pos.x - 1, y = pos.y, z = pos.z}, } return positions[lookDir] end function convertV(lookDir, pos) local positions = { [0] = {x = pos.x, y = pos.y + 1, z = pos.z}, [1] = {x = pos.x - 1, y = pos.y, z = pos.z}, [2] = {x = pos.x, y = pos.y - 1, z = pos.z}, [3] = {x = pos.x + 1, y = pos.y, z = pos.z}, } return positions[lookDir] end function isInWallArray(pos) for _, wallId in ipairs(SBW_WALLSID) do if getTileItemById(pos, wallId).itemid == wallId then return true end end return false end function killPlayer(cid, pos, killer) local tl = SBW_AREA[1] local br = SBW_AREA[2] local posti local isPossibleToTeleportPlayer = false while not isPossibleToTeleportPlayer do posti = Position(math.random(tl.x, br.x), math.random(tl.y, br.y), 7) if not isInWallArray(posti) then isPossibleToTeleportPlayer = true end end doTeleportThing(cid, posti) doSendMagicEffect(pos, 2) doSendMagicEffect(posti, 6) doSendAnimatedText(pos, getCreatureName(killer), 55) doPlayerSendTextMessage(cid, 27, "Você morreu para " .. getCreatureName(killer) .. ".") setGlobalStorageValue(killer, SBW_SCORE, getPlayerStorageValue(killer, SBW_SCORE) + SBW_POINTSKILL) doPlayerSendTextMessage(killer, 27, "Você matou " .. getCreatureName(cid) .. ".") if SBW_LOSTSCORE then setGlobalStorageValue(cid, SBW_SCORE, getPlayerStorageValue(cid, SBW_SCORE) - 1) end if SBW_RESETAMMO then setGlobalStorageValue(cid, SBW_AMMO, SBW_MINAMMO) end end Snowtalk:separator(" ") Snowtalk:register()
testa assim colega
Editado Dezembro 24 por El Rusher



info
Grupo: Campones
Registrado: 30/08/10
Posts: 2
Reputação: 0
Gênero: Masculino
Char no Tibia: Royal Calvineitor
Boa Tarde, estou tentando adaptar o snowball event para meu servidor, ja corrigi varios bugs, porém esse erro que não estou conseguindo resolver, pois não acho nenhuma documentação sobre
sempre que uso o comando !snowball Atirar aparece esse erro na distro, mas a animação segue fluida no servidor, alguém sabe como resolver esse erro? sobre a line animation