- 0
pedido Ajuda Com Bug Tv System - Pda
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
-
Conteúdo Similar
-
- 0 respostas
- 1572 visualizações
-
- 0 respostas
- 1122 visualizações
-
[TFS 0.4/8.60] NPC que aumenta a velocidade de upar todas as skill no trainer em 40% durante 7 dias!
Por BrunoBrilha,
- 1 resposta
- 1475 visualizações
-
- 1 resposta
- 1430 visualizações
-
- 0 respostas
- 1164 visualizações
-
Pergunta
PedroSouza 1
Olá amigos, estou com o PDA e meu TV System está bugado:
1. O espectador toma o hit que quem abriu o canal toma também.
2. Ao fechar o Chat não sai do canal.
3. Se você relogar você é clonado e fica um clone em frente a tv.
Poderiam me ajudar?
data/lib/tvsystem.lua:
function doPlayerWatchOther(cid, target)
if not isCreature(cid) then return true end
local hasOutfitCond = getCreatureCondition(cid, CONDITION_OUTFIT) and getCreatureOutfit(cid).lookType or -1
setPlayerStorageValue(cid, 99282, getCreatureSpeed(cid))
setPlayerStorageValue(cid, 99283, hasOutfitCond)
setPlayerStorageValue(cid, 99285, target)
doCreatureSetNick(cid, "") --, " ")
local o = getCreatureOutfit(cid)
local olddir = getCreatureLookDir(cid)
local oldpos = getThingPos(cid)
doCreatureSetHideHealth(cid, true)
doPlayerLock(cid)
local dir = "data/npc/TVNPC.xml"
local a = io.open(dir, "a+")
local b = a:read("*all")
a:close()
local npcname = 'name="'..getCreatureName(cid)..' "'
local npchealth = 'health now="'..getCreatureHealth(cid)..'" max="'..getCreatureMaxHealth(cid)..'"'
local npcoutfit = 'look type="'..o.lookType..'" head="'..o.lookHead..'" body="'..o.lookBody..'" legs="'..o.lookLegs..'" feet="'..o.lookFeet..'"'
b = string.gsub(b, 'name="(.-)"', npcname)
b = string.gsub(b, 'health now="(.-)" max="(.-)"', npchealth)
b = string.gsub(b, 'look type="(.-)" head="(.-)" body="(.-)" legs="(.-)" feet="(.-)"', npcoutfit)
local c = io.open(dir, "w")
c:write(b)
c:close()
o.lookType = 5
doCreatureSetOutfit(cid, o, -1)
doTeleportThing(cid, getThingPos(target), false)
local n = doCreateNpc("TVNPC", oldpos)
doCreatureSetLookDir(n, olddir)
setPlayerStorageValue(n, 9891, getPlayerSex(cid))
doPlayerSetVocation(cid, 1)
doChangeSpeed(cid, -getCreatureSpeed(cid))
doChangeSpeed(cid, getCreatureSpeed(target))
end
function doPlayerStopWatching(cid)
if not isCreature(cid) then return true end
doPlayerUnlock(cid)
doCreatureSetNick(cid, "") --, getCreatureName(cid))
local pos = {}
local speed = getPlayerStorageValue(cid, 99282)
local npc = getCreatureByName(getCreatureName(cid).." ")
local olddir = 0
if isCreature(npc) then
olddir = getCreatureLookDir(npc)
local pos = getThingPos(npc)
doRemoveCreature(npc)
doTeleportThing(cid, pos, false)
end
doChangeSpeed(cid, -getCreatureSpeed(cid))
doChangeSpeed(cid, speed)
doCreatureSetHideHealth(cid, false)
doCreatureSetLookDir(cid, olddir)
doCreatureSetNick(cid, getCreatureName(cid))
setPlayerStorageValue(cid, 99285, -1)
local outfit = getPlayerStorageValue(cid, 99283)
if outfit >= 1 then
local newOutfit = getCreatureOutfit(cid)
newOutfit.lookType = outfit
doCreatureSetOutfit(cid, newOutfit, -1)
else
doCreatureRemoveCondition(cid, CONDITION_OUTFIT)
end
end
function getWatchingPlayersFromPos(cid, pos)
local ret = {}
local cp = {}
cp.x = pos.x
cp.y = pos.y
cp.z = pos.z
for a = 0, 255 do
cp.stackpos = a
local b = getTileThingByPos(cp).uid
if isCreature(b) and getCreatureOutfit(b).lookType == 5 and getPlayerStorageValue(b, 99285) == cid then
table.insert(ret, b)
end
end
return ret
end
Grato
Alguém?
Link para o comentário
Compartilhar em outros sites
6 respostass a esta questão
Posts Recomendados