papam77 Posted April 26, 2013 Share Posted April 26, 2013 Hello i wanna delete spectate player name. << PLAYERNAME >> How can delete it ? I can't find it. ----------------------------------------------------------------------- -- Spectate ----------------------------------------------------------------------- Spectate = {} Spectate.active = false Spectate.target = nil Spectate.blockUntilTimes = {} Spectate.savePos = false Spectate.manual = false Spectate.droppedCameraTimer = Timer:create() Spectate.tickTimer = Timer:create() Spectate.fadedout = true Spectate.blockManual = false Spectate.blockManualTimer = nil Spectate.Render = false Spectate.TargetPlayer = nil -- Request to switch on function Spectate.start(type) outputDebug( 'SPECTATE', 'Spectate.start '..type ) assert(type=='manual' or type=='auto', "Spectate.start : type == auto or manual") Spectate.blockManual = false if type == 'manual' then if Spectate.active then return -- Ignore if manual request and already on end Spectate.savePos = true -- Savepos and start if manual request and was off elseif type == 'auto' then Spectate.savePos = false -- Clear restore pos if an auto spectate is requested end if not Spectate.active then Spectate._start() -- Switch on here, if was off end end -- Request to switch off function Spectate.stop(type) outputDebug( 'SPECTATE', 'Spectate.stop '..type ) assert(type=='manual' or type=='auto', "Spectate.stop : type == auto or manual") if type == 'auto' then Spectate.savePos = false -- Clear restore pos if an auto spectate is requested end if Spectate.active then Spectate._stop() -- Switch off here, if was on end end function Spectate._start() outputDebug( 'SPECTATE', 'Spectate._start ' ) triggerServerEvent('onClientNotifySpectate', g_Me, true ) assert(not Spectate.active, "Spectate._start - not Spectate.active") local screenWidth, screenHeight = guiGetScreenSize() Spectate.updateGuiFadedOut() guiLabelSetHorizontalAlign(g_GUI.speclabel, 'center') hideGUIComponents('specprevhi', 'specnexthi') if Spectate.savePos then savePosition() end Spectate.setTarget( Spectate.findNewTarget(g_Me,1) ) bindKey('arrow_l', 'down', Spectate.previous) bindKey('arrow_r', 'down', Spectate.next) MovePlayerAway.start() Spectate.setTarget( Spectate.target ) Spectate.validateTarget(Spectate.target) Spectate.tickTimer:setTimer( Spectate.tick, 500, 0 ) end -- Stop spectating. Will restore position if Spectate.savePos is set function Spectate._stop() Spectate.cancelDropCamera() Spectate.tickTimer:killTimer() triggerServerEvent('onClientNotifySpectate', g_Me, false ) outputDebug( 'SPECTATE', 'Spectate._stop ' ) assert(Spectate.active, "Spectate._stop - Spectate.active") for i,name in ipairs({'specprev', 'specprevhi', 'specnext', 'specnexthi', 'speclabel'}) do if g_GUI[name] then destroyElement(g_GUI[name]) g_GUI[name] = nil end end unbindKey('arrow_l', 'down', Spectate.previous) unbindKey('arrow_r', 'down', Spectate.next) MovePlayerAway.stop() setCameraTarget(g_Me) Spectate.target = nil Spectate.active = false Spectate.Render = false if Spectate.savePos then Spectate.savePos = false restorePosition() end end function Spectate.previous(bGUIFeedback) Spectate.setTarget( Spectate.findNewTarget(Spectate.target,-1) ) if bGUIFeedback then setGUIComponentsVisible({ specprev = false, specprevhi = true }) setTimer(setGUIComponentsVisible, 100, 1, { specprevhi = false, specprev = true }) end end function Spectate.next(bGUIFeedback) Spectate.setTarget( Spectate.findNewTarget(Spectate.target,1) ) if bGUIFeedback then setGUIComponentsVisible({ specnext = false, specnexthi = true }) setTimer(setGUIComponentsVisible, 100, 1, { specnexthi = false, specnext = true }) end end Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now