Jump to content

setCameraMatrix delay


freudo

Recommended Posts

Posted

Hello friends,
I have a problem. I have a little delay when I watch the player.

 

Code:

function randomSpectatePlayer() 
    local playerGroup = getElementData(localPlayer, "player:group") or false 
    if playerGroup then 
        local inGame = getElementData(localPlayer, "player:game") or false 
        for k,v in ipairs(playerGroup) do 
            if isElement(v) and getElementData(v, "player:game") and getElementData(localPlayer, "player:onSpawn") then
                if v ~= localPlayer then
                    setElementFrozen ( localPlayer, true )
                    oldDim = getElementInterior(localPlayer)
                    oldInt = getElementDimension(localPlayer)
                    setElementInterior(localPlayer, getElementInterior(v))
                    setElementDimension(localPlayer, getElementDimension(v))
                    setCameraInterior(localPlayer, getCameraInterior(v))
                    spectating = v
                    setCameraTarget ( v )
                    outputChatBox("[SPECTATE] #ffffffYou spectating now "..getPlayerName(v), 255,100,100,true)
                    outputChatBox("[SPECTATE] #ffffffIf you want back to lobby use #ff0000/back #ffffffcommand.", 255,100,100,true)
                    addCommandHandler("back", onStopSpectating)
                end
            end
        end
    end
end

 

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted

I think distance delay, how I can fix it?

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted (edited)

Well your topic talks about a function you don't even use, how ever you also should break the loop.

Edit: The delay may be caused cause loop and way you get data, you should organize more such spectator system otherwise lag will keep, is really needed  do all such things everytime you call to a random spectate target?

Edited by MisterQuestions
  • Like 1

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Posted

yes it's random.

WOC-DD Destruction Derby

-Level system

-Clan system

-Topwins

-Event system for EXP

-Podium with animation

And more

350x20_FFFFF_FFFFF_00000_00000.png

Posted
15 minutes ago, barikat said:

yes it's random.

Seems like you don't even understand what i said.

 

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...